aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYunlong Song <yunlong.song@huawei.com>2015-02-13 08:11:55 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-02-13 09:57:50 -0500
commit619a303c1b8bd22abc549477d038ef9b5c1fe1bd (patch)
tree53a7bb7bbdfb2076b37e3793dff87ff6b09cc077
parent74390aa5567827add5058a3b26eff0ed06a629ba (diff)
perf list: Place the header text in its right position
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: Yunlong 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: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-list.c3
-rw-r--r--tools/perf/util/parse-events.c5
2 files changed, 3 insertions, 5 deletions
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index 198f3c3aff95..ad8018e26aa0 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -41,6 +41,9 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
41 return 0; 41 return 0;
42 } 42 }
43 43
44 if (!raw_dump)
45 printf("\nList of pre-defined events (to be used in -e):\n\n");
46
44 if (argc == 0) { 47 if (argc == 0) {
45 print_events(NULL, false); 48 print_events(NULL, false);
46 return 0; 49 return 0;
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index ecf069b1661f..109ba5c8c2e5 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1319,11 +1319,6 @@ static void print_symbol_events(const char *event_glob, unsigned type,
1319 */ 1319 */
1320void print_events(const char *event_glob, bool name_only) 1320void print_events(const char *event_glob, bool name_only)
1321{ 1321{
1322 if (!name_only) {
1323 printf("\n");
1324 printf("List of pre-defined events (to be used in -e):\n");
1325 }
1326
1327 print_symbol_events(event_glob, PERF_TYPE_HARDWARE, 1322 print_symbol_events(event_glob, PERF_TYPE_HARDWARE,
1328 event_symbols_hw, PERF_COUNT_HW_MAX, name_only); 1323 event_symbols_hw, PERF_COUNT_HW_MAX, name_only);
1329 1324