diff options
author | Jin Yao <yao.jin@linux.intel.com> | 2020-03-24 23:07:10 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-04-03 14:37:55 +0200 |
commit | df7deb2cceef0546ab2115702da3421b7c61a8c0 (patch) | |
tree | 446701849d2dbd215e7463e62ffe4e43bda1ad38 /tools/perf/builtin-top.c | |
parent | perf symbols: Fix arm64 gap between kernel start and module end (diff) | |
download | linux-df7deb2cceef0546ab2115702da3421b7c61a8c0.tar.xz linux-df7deb2cceef0546ab2115702da3421b7c61a8c0.zip |
perf top: Support --group-sort-idx to change the sort order
'perf report' supports the option --group-sort-idx, which sorts the
output by the event at the index n in event group.
For example:
perf record -e cycles,instructions,cache-misses
perf report --group --group-sort-idx 2 --stdio
The perf-report output is sorted by cache-misses.
This patch supports --group-sort-idx in perf-top.
For example:
perf top --group -e cycles,instructions,cache-misses --group-sort-idx 2
The perf-top output is sorted by cache-misses.
Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Suggested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.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/20200324220711.6025-1-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 02ea2cf2a3d9..9ff7943d2014 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1560,6 +1560,10 @@ int cmd_top(int argc, const char **argv) "Record namespaces events"), OPT_BOOLEAN(0, "all-cgroups", &opts->record_cgroup, "Record cgroup events"), + OPT_INTEGER(0, "group-sort-idx", &symbol_conf.group_sort_idx, + "Sort the output by the event at the index n in group. " + "If n is invalid, sort by the first event. " + "WARNING: should be used on grouped events."), OPTS_EVSWITCH(&top.evswitch), OPT_END() }; |