1. 24 Nov, 2022 2 commits
    • Ian Rogers's avatar
      perf list: JSON escape encoding improvements · 1284ded7
      Ian Rogers authored
      
      Use strbuf to make the string under construction's length unlimited. Use
      the format %s to mean a literal string copy and %S to signify a need to
      escape the string. Add supported for escaping a newline character.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Caleb Biggers <caleb.biggers@intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Weilin Wang <weilin.wang@intel.com>
      Cc: Xin Gao <gaoxin@cdjrlc.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221118024607.409083-3-irogers@google.com
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1284ded7
    • Ian Rogers's avatar
      perf list: Support newlines in wordwrap · 1a9c20b4
      Ian Rogers authored
      
      Rather than a newline starting from column 0, record a newline was
      seen and then add the newline and space before the next word.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Caleb Biggers <caleb.biggers@intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Weilin Wang <weilin.wang@intel.com>
      Cc: Xin Gao <gaoxin@cdjrlc.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221118024607.409083-2-irogers@google.com
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1a9c20b4
  2. 23 Nov, 2022 2 commits
    • Ian Rogers's avatar
      perf list: Add JSON output option · 6ed24944
      Ian Rogers authored
      
      Output events and metrics in a JSON format by overriding the print
      callbacks. Currently other command line options aren't supported and
      metrics are repeated once per metric group.
      
      Committer testing:
      
        $ perf list cache
      
        List of pre-defined events (to be used in -e or -M):
      
          L1-dcache-load-misses                              [Hardware cache event]
          L1-dcache-loads                                    [Hardware cache event]
          L1-dcache-prefetches                               [Hardware cache event]
          L1-icache-load-misses                              [Hardware cache event]
          L1-icache-loads                                    [Hardware cache event]
          branch-load-misses                                 [Hardware cache event]
          branch-loads                                       [Hardware cache event]
          dTLB-load-misses                                   [Hardware cache event]
          dTLB-loads                                         [Hardware cache event]
          iTLB-load-misses                                   [Hardware cache event]
          iTLB-loads                                         [Hardware cache event]
        $ perf list --json cache
        [
        {
                "Unit": "cache",
                "EventName": "L1-dcache-load-misses",
                "EventType": "Hardware cache event"
        },
        {
                "Unit": "cache",
                "EventName": "L1-dcache-loads",
                "EventType": "Hardware cache event"
        },
        {
                "Unit": "cache",
                "EventName": "L1-dcache-prefetches",
                "EventType": "Hardware cache event"
        },
        {
                "Unit": "cache",
                "EventName": "L1-icache-load-misses",
                "EventType": "Hardware cache event"
        },
        {
                "Unit": "cache",
                "EventName": "L1-icache-loads",
                "EventType": "Hardware cache event"
        },
        {
                "Unit": "cache",
                "EventName": "branch-load-misses",
                "EventType": "Hardware cache event"
        },
        {
                "Unit": "cache",
                "EventName": "branch-loads",
                "EventType": "Hardware cache event"
        },
        {
                "Unit": "cache",
                "EventName": "dTLB-load-misses",
                "EventType": "Hardware cache event"
        },
        {
                "Unit": "cache",
                "EventName": "dTLB-loads",
                "EventType": "Hardware cache event"
        },
        {
                "Unit": "cache",
                "EventName": "iTLB-load-misses",
                "EventType": "Hardware cache event"
        },
        {
                "Unit": "cache",
                "EventName": "iTLB-loads",
                "EventType": "Hardware cache event"
        }
        ]
        $
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Caleb Biggers <caleb.biggers@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Weilin Wang <weilin.wang@intel.com>
      Cc: Xin Gao <gaoxin@cdjrlc.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: http://lore.kernel.org/lkml/20221114210723.2749751-11-irogers@google.com
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6ed24944
    • Ian Rogers's avatar
      perf list: Reorganize to use callbacks to allow honouring command line options · e5c6109f
      Ian Rogers authored
      
      Rather than controlling the list output with passed flags, add
      callbacks that are called when an event or metric are
      encountered. State is passed to the callback so that command line
      options can be respected, alternatively the callbacks can be changed.
      
      Fix a few bugs:
       - wordwrap to columns metric descriptions and expressions;
       - remove unnecessary whitespace after PMU event names;
       - the metric filter is a glob but matched using strstr which will
         always fail, switch to using a proper globmatch,
       - the detail flag gives details for extra kernel PMU events like
         branch-instructions.
      
      In metricgroup.c switch from struct mep being a rbtree of metricgroups
      containing a list of metrics, to the tree directly containing all the
      metrics. In general the alias for a name is passed to the print
      routine rather than being contained in the name with OR.
      
      Committer notes:
      
      Check the asprint() return to address this on fedora 36:
      
        util/print-events.c: In function ‘print_sdt_events’:
        util/print-events.c:183:33: error: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
          183 |                                 asprintf(&evt_name, "%s@%s(%.12s)", sdt_name->s, path, bid);
              |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cc1: all warnings being treated as errors
      
        $ gcc --version | head -1
        gcc (GCC) 12.2.1 20220819 (Red Hat 12.2.1-2)
        $
      
      Fix ps.pmu_glob setting when dealing with *:* events, it was being left
      with a freed pointer that then at the end of cmd_list() would be double
      freed.
      
      Check if pmu_name is NULL in default_print_event() before calling
      strglobmatch(pmu_name, ...) to avoid a segfault.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Caleb Biggers <caleb.biggers@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Weilin Wang <weilin.wang@intel.com>
      Cc: Xin Gao <gaoxin@cdjrlc.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: http://lore.kernel.org/lkml/20221114210723.2749751-10-irogers@google.com
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e5c6109f
  3. 15 Nov, 2022 1 commit
    • Ian Rogers's avatar
      perf list: Generalize limiting to a PMU name · ca0fe624
      Ian Rogers authored
      
      Deprecate the --cputype option and add a --unit option where '--unit
      cpu_atom' behaves like '--cputype atom'. The --unit option can be used
      with arbitrary PMUs, for example:
      
      ```
      $ perf list --unit msr pmu
      
      List of pre-defined events (to be used in -e or -M):
      
        msr/aperf/                                         [Kernel PMU event]
        msr/cpu_thermal_margin/                            [Kernel PMU event]
        msr/mperf/                                         [Kernel PMU event]
        msr/pperf/                                         [Kernel PMU event]
        msr/smi/                                           [Kernel PMU event]
        msr/tsc/                                           [Kernel PMU event]
      ```
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Caleb Biggers <caleb.biggers@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Weilin Wang <weilin.wang@intel.com>
      Cc: Xin Gao <gaoxin@cdjrlc.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: http://lore.kernel.org/lkml/20221114210723.2749751-6-irogers@google.com
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ca0fe624
  4. 14 Oct, 2022 1 commit
  5. 02 Aug, 2022 1 commit
    • Ian Rogers's avatar
      perf parse-events: Break out tracepoint and printing · 9b7c7728
      Ian Rogers authored
      
      Move print_*_events functions out of parse-events.c into a new
      print-events.c. Move tracepoint code into tracepoint.c or
      trace-event-info.c (sole user). This reduces the dependencies of
      parse-events.c and makes it more amenable to being a library in the
      future.
      
      Remove some unnecessary definitions from parse-events.h. Fix a
      checkpatch.pl warning on using unsigned rather than unsigned int.  Fix
      some line length warnings too.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lore.kernel.org/r/20220729204217.250166-3-irogers@google.com
      
      
      [ Add include linux/stddef.h before perf_events.h for systems where __always_inline isn't pulled in before used, such as older Alpine Linux ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9b7c7728
  6. 25 Oct, 2021 1 commit
    • Jin Yao's avatar
      perf list: Display hybrid PMU events with cpu type · 0e0ae874
      Jin Yao authored
      
      Add a new option '--cputype' to 'perf list' to display core-only PMU
      events or atom-only PMU events.
      
      Each hybrid PMU event has been assigned with a PMU name, this patch
      compares the PMU name before listing the result.
      
      For example:
      
        perf list --cputype atom
        ...
        cache:
          core_reject_l2q.any
               [Counts the number of request that were not accepted into the L2Q because the L2Q is FULL. Unit: cpu_atom]
        ...
      
      The "Unit: cpu_atom" is displayed in the brief description section
      to indicate this is an atom event.
      Signed-off-by: default avatarJin Yao <yao.jin@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jin Yao <yao.jin@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210903025239.22754-1-yao.jin@linux.intel.com
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0e0ae874
  7. 09 Sep, 2020 1 commit
  8. 28 May, 2020 1 commit
    • Ian Rogers's avatar
      perf list: Add metrics to command line usage · a90a1c54
      Ian Rogers authored
      
      Before:
      
       Usage: perf list [<options>] [hw|sw|cache|tracepoint|pmu|sdt|event_glob]
      
      After:
      
       Usage: perf list [<options>] [hw|sw|cache|tracepoint|pmu|sdt|metric|metricgroup|event_glob]
      
      Committer testing:
      
      Before and after we get these outputs on a Lenovo t480s (i7-8650U):
      
        # perf list metricgroup
      
        List of pre-defined events (to be used in -e):
      
        Metric Groups:
      
        BrMispredicts
        BrMispredicts_SMT
        Branches
        Cache_Misses
        DSB
        FLOPS
        FLOPS_SMT
        Fetch_BW
        IcMiss
        Instruction_Type
        Memory_BW
        Memory_Bound
        Memory_Lat
        No_group
        PGO
        Pipeline
        Power
        Retire
        SMT
        Summary
        TLB
        TLB_SMT
        TopDownL1
        TopDownL1_SMT
        TopdownL1
        TopdownL1_SMT
        #
      
        # perf list metric | head -11
      
        Metrics:
      
          Backend_Bound
               [This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend]
          Backend_Bound_SMT
               [This category represents fraction of slots where no uops are being delivered due to a lack of required resources for accepting new uops in the Backend. SMT version; use when SMT is enabled and measuring per logical CPU]
          Bad_Speculation
               [This category represents fraction of slots wasted due to incorrect speculations]
          Bad_Speculation_SMT
               [This category represents fraction of slots wasted due to incorrect speculations. SMT version; use when SMT is enabled and measuring per logical CPU]
        #
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20200522064546.164259-1-irogers@google.com
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a90a1c54
  9. 19 Oct, 2019 1 commit
    • Jin Yao's avatar
      perf list: Hide deprecated events by default · a7f6c8c8
      Jin Yao authored
      
      There are some deprecated events listed by perf list. But we can't
      remove them from perf list with ease because some old scripts may use
      them.
      
      Deprecated events are old names of renamed events.  When an event gets
      renamed the old name is kept around for some time and marked with
      Deprecated. The newer Intel event lists in the tree already have these
      headers.
      
      So we need to keep them in the event list, but provide a new option to
      show them. The new option is "--deprecated".
      
      With this patch, the deprecated events are hidden by default but they
      can be displayed when option "--deprecated" is enabled.
      Signed-off-by: default avatarJin Yao <yao.jin@linux.intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jin Yao <yao.jin@intel.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20191015025357.8708-1-yao.jin@linux.intel.com
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a7f6c8c8
  10. 25 Sep, 2019 1 commit
    • Kim Phillips's avatar
      perf list: Allow plurals for metric, metricgroup · 8788d369
      Kim Phillips authored
      Enhance usability by allowing the same plurality used in the output
      title, for the command line parameter.
      
      BEFORE, perf deceitfully acts as if there are no metrics to be had:
      
        $ perf list metrics
      
        List of pre-defined events (to be used in -e):
      
        Metric Groups:
      
        $
      
      But singular 'metric' shows a list of metrics:
      
        $ perf list metric
      
        List of pre-defined events (to be used in -e):
      
        Metrics:
      
          IPC
               [Instructions Per Cycle (per logical thread)]
          UPI
               [Uops Per Instruction]
      
      AFTER, when asking for 'metrics', we actually see the metrics get listed:
      
        $ perf list metrics
      
        List of pre-defined events (to be used in -e):
      
        Metrics:
      
          IPC
               [Instructions Per Cycle (per logical thread)]
          UPI
               [Uops Per Instruction]
      
      Fixes: 71b0acce
      
       ("perf list: Add metric groups to perf list")
      Signed-off-by: default avatarKim Phillips <kim.phillips@amd.com>
      Reviewed-by: default avatarAndi Kleen <ak@linux.intel.com>
      Tested-by: Arnaldo Carvalho de Melo ...
      8788d369
  11. 01 Sep, 2019 1 commit
  12. 31 Aug, 2019 1 commit
  13. 29 Aug, 2019 1 commit
  14. 01 Apr, 2019 1 commit
    • Andi Kleen's avatar
      perf list: Output tool events · 5e0861ba
      Andi Kleen authored
      Add support in 'perf list' to output tool internal events, currently
      only 'duration_time'.
      
      Committer testing:
      
        $ perf list dur*
      
        List of pre-defined events (to be used in -e):
      
          duration_time                                      [Tool event]
      
        Metric Groups:
      
        $ perf list sw
      
        List of pre-defined events (to be used in -e):
      
          alignment-faults                                   [Software event]
          bpf-output                                         [Software event]
          context-switches OR cs                             [Software event]
          cpu-clock                                          [Software event]
          cpu-migrations OR migrations                       [Software event]
          dummy                                              [Software event]
          emulation-faults                                   [Software event]
          major-faults                                       [Software event]
          minor-faults                                       [Software event]
          p...
      5e0861ba
  15. 19 Mar, 2019 1 commit
  16. 14 Feb, 2019 1 commit
  17. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard...
      b2441318
  18. 13 Sep, 2017 1 commit
    • Andi Kleen's avatar
      perf list: Add metric groups to perf list · 71b0acce
      Andi Kleen authored
      
      Add code to perf list to print metric groups, and metrics
      that don't have an event name. The metricgroup code collects
      the eventgroups and events into a rblist, and then prints
      them according to the configured filters.
      
      The metricgroups are printed by default, but can be
      limited by perf list metric or perf list metricgroup
      
        % perf list metricgroup
        ..
        Metric Groups:
      
        DSB:
          DSB_Coverage
                [Fraction of Uops delivered by the DSB (aka Decoded Icache; or Uop Cache)]
        FLOPS:
          GFLOPs
                [Giga Floating Point Operations Per Second]
        Frontend:
          IFetch_Line_Utilization
                [Rough Estimation of fraction of fetched lines bytes that were likely consumed by program instructions]
        Frontend_Bandwidth:
          DSB_Coverage
                [Fraction of Uops delivered by the DSB (aka Decoded Icache; or Uop Cache)]
        Memory_BW:
          MLP
                [Memory-Level-Parallelism (average number of L1 miss demand load when there is at least 1 such miss)]
      
      v2: Check return value of asprintf to fix warning on FC26
      Fix key in lookup/addition for the groups list
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20170831194036.30146-8-andi@firstfloor.org
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      71b0acce
  19. 27 Mar, 2017 1 commit
  20. 23 Mar, 2017 1 commit
  21. 08 Feb, 2017 1 commit
  22. 04 Oct, 2016 2 commits
  23. 14 Jul, 2016 1 commit
  24. 17 Dec, 2015 1 commit
  25. 01 Oct, 2015 1 commit
    • Arnaldo Carvalho de Melo's avatar
      perf list: Do event name substring search as last resort when no events found · dbc67409
      Arnaldo Carvalho de Melo authored
      
      Before:
      
        # perf list _alloc_ | head -10
        #
      
      After:
      
        # perf list _alloc_ | head -10
          ext4:ext4_alloc_da_blocks                          [Tracepoint event]
          ext4:ext4_get_implied_cluster_alloc_exit           [Tracepoint event]
          kmem:kmem_cache_alloc_node                         [Tracepoint event]
          kmem:mm_page_alloc_extfrag                         [Tracepoint event]
          kmem:mm_page_alloc_zone_locked                     [Tracepoint event]
          xen:xen_mmu_alloc_ptpage                           [Tracepoint event]
        #
      
      And it works for all types of events:
      
        # perf list br
      
        List of pre-defined events (to be used in -e):
      
          branch-instructions OR branches                    [Hardware event]
          branch-misses                                      [Hardware event]
      
          branch-load-misses                                 [Hardware cache event]
          branch-loads                                       [Hardware cache event]
      
          branch-instructions OR cpu/branch-instructions/    [Kernel PMU event]
          branch-misses OR cpu/branch-misses/                [Kernel PMU event]
      
          filelock:break_lease_block                         [Tracepoint event]
          filelock:break_lease_noblock                       [Tracepoint event]
          filelock:break_lease_unblock                       [Tracepoint event]
          syscalls:sys_enter_brk                             [Tracepoint event]
          syscalls:sys_exit_brk                              [Tracepoint event]
      
        #
      Suggested-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-qieivl18jdemoaghgndj36e6@git.kernel.org
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      dbc67409
  26. 30 Sep, 2015 1 commit
    • Arnaldo Carvalho de Melo's avatar
      perf list: Remove blank lines, headers when piping output · dfc431cb
      Arnaldo Carvalho de Melo authored
      So that one can, for instance, use it with wc -l:
      
        # perf list *:*write* | wc -l
        60
      
      Or to look for the "bio" tracepoints, without 'perf list' headers:
      
        # perf list *:*bio* | head
          block:block_bio_backmerge                          [Tracepoint event]
          block:block_bio_bounce                             [Tracepoint event]
          block:block_bio_complete                           [Tracepoint event]
          block:block_bio_frontmerge                         [Tracepoint event]
          block:block_bio_queue                              [Tracepoint event]
          block:block_bio_remap                              [Tracepoint event]
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-ts7sc0x8u4io4cifzkup4j44@git.kernel.org
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      dfc431cb
  27. 27 Feb, 2015 3 commits
  28. 13 Feb, 2015 1 commit
    • Yunlong Song's avatar
      perf list: Place the header text in its right position · 619a303c
      Yunlong Song authored
      
      The hearer text 'List of pre-defined events (to be used in -e):' is
      placed in an improper function, which causes an abnormal output, e.g.
      'perf list hw' shows no guiding text at all, and 'perf list hw
      L1-dcache*' shows the guiding text incorrectly in the middle of the
      output.
      
      Example
      Before this patch:
      
       $ perf list hw L1-dcache*
      
         branch-instructions OR branches                    [Hardware event]
         branch-misses                                      [Hardware event]
         bus-cycles                                         [Hardware event]
         cache-misses                                       [Hardware event]
         cache-references                                   [Hardware event]
         cpu-cycles OR cycles                               [Hardware event]
         instructions                                       [Hardware event]
         stalled-cycles-backend OR idle-cycles-backend      [Hardware event]
         stalled-cycles-frontend OR idle-cycles-frontend    [Hardware event]
      
       List of pre-defined events (to be used in -e):              <-- incorrect position
         L1-dcache-load-misses                              [Hardware cache event]
         L1-dcache-loads                                    [Hardware cache event]
         L1-dcache-prefetch-misses                          [Hardware cache event]
         L1-dcache-prefetches                               [Hardware cache event]
         L1-dcache-store-misses                             [Hardware cache event]
         L1-dcache-stores                                   [Hardware cache event]
      
      After this patch:
      
       $ perf list hw L1-dcache*
      
       List of pre-defined events (to be used in -e):              <-- correct position
      
         branch-instructions OR branches                    [Hardware event]
         branch-misses                                      [Hardware event]
         bus-cycles                                         [Hardware event]
         cache-misses                                       [Hardware event]
         cache-references                                   [Hardware event]
         cpu-cycles OR cycles                               [Hardware event]
         instructions                                       [Hardware event]
         stalled-cycles-backend OR idle-cycles-backend      [Hardware event]
         stalled-cycles-frontend OR idle-cycles-frontend    [Hardware event]
      
         L1-dcache-load-misses                              [Hardware cache event]
         L1-dcache-loads                                    [Hardware cache event]
         L1-dcache-prefetch-misses                          [Hardware cache event]
         L1-dcache-prefetches                               [Hardware cache event]
         L1-dcache-store-misses                             [Hardware cache event]
         L1-dcache-stores                                   [Hardware cache event]
      Signed-off-by: default avatarYunlong Song <yunlong.song@huawei.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1423833115-11199-8-git-send-email-yunlong.song@huawei.com
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      619a303c
  29. 03 Jan, 2015 1 commit
  30. 05 Nov, 2013 2 commits
  31. 12 Jul, 2013 1 commit
  32. 11 Sep, 2012 1 commit
    • Irina Tirdea's avatar
      perf tools: Use __maybe_used for unused variables · 1d037ca1
      Irina Tirdea authored
      
      perf defines both __used and __unused variables to use for marking
      unused variables. The variable __used is defined to
      __attribute__((__unused__)), which contradicts the kernel definition to
      __attribute__((__used__)) for new gcc versions. On Android, __used is
      also defined in system headers and this leads to warnings like: warning:
      '__used__' attribute ignored
      
      __unused is not defined in the kernel and is not a standard definition.
      If __unused is included everywhere instead of __used, this leads to
      conflicts with glibc headers, since glibc has a variables with this name
      in its headers.
      
      The best approach is to use __maybe_unused, the definition used in the
      kernel for __attribute__((unused)). In this way there is only one
      definition in perf sources (instead of 2 definitions that point to the
      same thing: __used and __unused) and it works on both Linux and Android.
      This patch simply replaces all instances of __used and __unused with
      __maybe_unused.
      Signed-off-by: default avatarIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: default avatarPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
      [ committer note: fixed up conflict with a116e05d
      
       in builtin-sched.c ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1d037ca1
  33. 09 Aug, 2012 1 commit
  34. 17 Feb, 2011 1 commit
    • Arnaldo Carvalho de Melo's avatar
      perf list: Allow filtering list of events · 668b8788
      Arnaldo Carvalho de Melo authored
      
      The man page has the details, here are some examples:
      
      [root@emilia ~]# perf list *fault*  *:*wait*
      
      List of pre-defined events (to be used in -e):
        page-faults OR faults                      [Software event]
        minor-faults                               [Software event]
        major-faults                               [Software event]
        alignment-faults                           [Software event]
        emulation-faults                           [Software event]
      
        radeon:radeon_fence_wait_begin             [Tracepoint event]
        radeon:radeon_fence_wait_end               [Tracepoint event]
        writeback:wbc_writeback_wait               [Tracepoint event]
        writeback:wbc_balance_dirty_wait           [Tracepoint event]
        writeback:writeback_congestion_wait        [Tracepoint event]
        writeback:writeback_wait_iff_congested     [Tracepoint event]
        sched:sched_wait_task                      [Tracepoint event]
        sched:sched_process_wait                   [Tracepoint event]
        sched:sched_stat_wait                      [Tracepoint event]
        sched:sched_stat_iowait                    [Tracepoint event]
        syscalls:sys_enter_epoll_wait              [Tracepoint event]
        syscalls:sys_exit_epoll_wait               [Tracepoint event]
        syscalls:sys_enter_epoll_pwait             [Tracepoint event]
        syscalls:sys_exit_epoll_pwait              [Tracepoint event]
        syscalls:sys_enter_rt_sigtimedwait         [Tracepoint event]
        syscalls:sys_exit_rt_sigtimedwait          [Tracepoint event]
        syscalls:sys_enter_waitid                  [Tracepoint event]
        syscalls:sys_exit_waitid                   [Tracepoint event]
        syscalls:sys_enter_wait4                   [Tracepoint event]
        syscalls:sys_exit_wait4                    [Tracepoint event]
        syscalls:sys_enter_waitpid                 [Tracepoint event]
        syscalls:sys_exit_waitpid                  [Tracepoint event]
      [root@emilia ~]#
      Suggested-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      668b8788