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>