Commit 5e0861ba authored by Andi Kleen's avatar Andi Kleen Committed by Arnaldo Carvalho de Melo

perf list: Output tool events

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]
    page-faults OR faults                              [Software event]
    task-clock                                         [Software event]

    duration_time                                      [Tool event]

  $ perf list | grep duration
    duration_time                                      [Tool event]
         [L1D miss outstandings duration in cycles]
          page walk duration are excluded in Skylake]
          load. EPT page walk duration are excluded in Skylake]
          page walk duration are excluded in Skylake]
          store. EPT page walk duration are excluded in Skylake]
          (instruction fetch) request. EPT page walk duration are excluded in
          instruction fetch request. EPT page walk duration are excluded in
  $
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20190326221823.11518-5-andi@firstfloor.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3371f389
...@@ -70,10 +70,11 @@ int cmd_list(int argc, const char **argv) ...@@ -70,10 +70,11 @@ int cmd_list(int argc, const char **argv)
print_symbol_events(NULL, PERF_TYPE_HARDWARE, print_symbol_events(NULL, PERF_TYPE_HARDWARE,
event_symbols_hw, PERF_COUNT_HW_MAX, raw_dump); event_symbols_hw, PERF_COUNT_HW_MAX, raw_dump);
else if (strcmp(argv[i], "sw") == 0 || else if (strcmp(argv[i], "sw") == 0 ||
strcmp(argv[i], "software") == 0) strcmp(argv[i], "software") == 0) {
print_symbol_events(NULL, PERF_TYPE_SOFTWARE, print_symbol_events(NULL, PERF_TYPE_SOFTWARE,
event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump); event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump);
else if (strcmp(argv[i], "cache") == 0 || print_tool_events(NULL, raw_dump);
} else if (strcmp(argv[i], "cache") == 0 ||
strcmp(argv[i], "hwcache") == 0) strcmp(argv[i], "hwcache") == 0)
print_hwcache_events(NULL, raw_dump); print_hwcache_events(NULL, raw_dump);
else if (strcmp(argv[i], "pmu") == 0) else if (strcmp(argv[i], "pmu") == 0)
...@@ -113,6 +114,7 @@ int cmd_list(int argc, const char **argv) ...@@ -113,6 +114,7 @@ int cmd_list(int argc, const char **argv)
event_symbols_hw, PERF_COUNT_HW_MAX, raw_dump); event_symbols_hw, PERF_COUNT_HW_MAX, raw_dump);
print_symbol_events(s, PERF_TYPE_SOFTWARE, print_symbol_events(s, PERF_TYPE_SOFTWARE,
event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump); event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump);
print_tool_events(s, raw_dump);
print_hwcache_events(s, raw_dump); print_hwcache_events(s, raw_dump);
print_pmu_events(s, raw_dump, !desc_flag, print_pmu_events(s, raw_dump, !desc_flag,
long_desc_flag, long_desc_flag,
......
...@@ -2457,6 +2457,25 @@ int print_hwcache_events(const char *event_glob, bool name_only) ...@@ -2457,6 +2457,25 @@ int print_hwcache_events(const char *event_glob, bool name_only)
return evt_num; return evt_num;
} }
static void print_tool_event(const char *name, const char *event_glob,
bool name_only)
{
if (event_glob && !strglobmatch(name, event_glob))
return;
if (name_only)
printf("%s ", name);
else
printf(" %-50s [%s]\n", name, "Tool event");
}
void print_tool_events(const char *event_glob, bool name_only)
{
print_tool_event("duration_time", event_glob, name_only);
if (pager_in_use())
printf("\n");
}
void print_symbol_events(const char *event_glob, unsigned type, void print_symbol_events(const char *event_glob, unsigned type,
struct event_symbol *syms, unsigned max, struct event_symbol *syms, unsigned max,
bool name_only) bool name_only)
...@@ -2540,6 +2559,7 @@ void print_events(const char *event_glob, bool name_only, bool quiet_flag, ...@@ -2540,6 +2559,7 @@ void print_events(const char *event_glob, bool name_only, bool quiet_flag,
print_symbol_events(event_glob, PERF_TYPE_SOFTWARE, print_symbol_events(event_glob, PERF_TYPE_SOFTWARE,
event_symbols_sw, PERF_COUNT_SW_MAX, name_only); event_symbols_sw, PERF_COUNT_SW_MAX, name_only);
print_tool_events(event_glob, name_only);
print_hwcache_events(event_glob, name_only); print_hwcache_events(event_glob, name_only);
......
...@@ -204,6 +204,7 @@ extern struct event_symbol event_symbols_sw[]; ...@@ -204,6 +204,7 @@ extern struct event_symbol event_symbols_sw[];
void print_symbol_events(const char *event_glob, unsigned type, void print_symbol_events(const char *event_glob, unsigned type,
struct event_symbol *syms, unsigned max, struct event_symbol *syms, unsigned max,
bool name_only); bool name_only);
void print_tool_events(const char *event_glob, bool name_only);
void print_tracepoint_events(const char *subsys_glob, const char *event_glob, void print_tracepoint_events(const char *subsys_glob, const char *event_glob,
bool name_only); bool name_only);
int print_hwcache_events(const char *event_glob, bool name_only); int print_hwcache_events(const char *event_glob, bool name_only);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment