提交 df7deb2c 编写于 作者: J Jin Yao 提交者: Arnaldo Carvalho de Melo

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: NJin Yao <yao.jin@linux.intel.com>
Suggested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: NArnaldo 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.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 78886f3e
......@@ -53,6 +53,11 @@ Default is to monitor all CPUS.
--group::
Put the counters into a counter group.
--group-sort-idx::
Sort the output by the event at the index n in group. If n is invalid,
sort by the first event. It can support multiple groups with different
amount of events. WARNING: This should be used on grouped events.
-F <freq>::
--freq=<freq>::
Profile at this frequency. Use 'max' to use the currently maximum
......
......@@ -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()
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册