[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-161149513b3570ebd7fe14fc2ddc42cb46557e37@git.kernel.org>
Date: Sat, 28 Feb 2015 01:33:11 -0800
From: tip-bot for Yunlong Song <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: hpa@...or.com, acme@...hat.com, mingo@...hat.com,
linux-kernel@...r.kernel.org, paulus@...ba.org,
wangnan0@...wei.com, yunlong.song@...wei.com, tglx@...utronix.de,
a.p.zijlstra@...llo.nl, mingo@...nel.org
Subject: [tip:perf/core] perf list: Allow listing events with 'tracepoint'
prefix
Commit-ID: 161149513b3570ebd7fe14fc2ddc42cb46557e37
Gitweb: http://git.kernel.org/tip/161149513b3570ebd7fe14fc2ddc42cb46557e37
Author: Yunlong Song <yunlong.song@...wei.com>
AuthorDate: Fri, 27 Feb 2015 18:21:26 +0800
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 27 Feb 2015 15:51:51 -0300
perf list: Allow listing events with 'tracepoint' prefix
If somebody happens to name an event with the beginning of 'tracepoint'
(e.g. tracepoint_foo), then it will never be showed with perf list
event_glob, thus we parse the argument 'tracepoint' more carefully for
accuracy.
Example:
Before this patch:
$ perf list tracepoint_foo:*
jbd2:jbd2_start_commit [Tracepoint event]
jbd2:jbd2_commit_locking [Tracepoint event]
jbd2:jbd2_run_stats [Tracepoint event]
block:block_rq_issue [Tracepoint event]
block:block_bio_complete [Tracepoint event]
block:block_bio_backmerge [Tracepoint event]
block:block_getrq [Tracepoint event]
... ...
As shown above, all of the tracepoint events are printed. In fact, the
command's real intention is to print the events of tracepoint_foo.
After this patch:
$ perf list tracepoint_foo:*
tracepoint_foo:tp_foo_enter [Tracepoint event]
tracepoint_foo:tp_foo_exit [Tracepoint event]
As shown above, only the events of tracepoint_foo are printed.
Signed-off-by: Yunlong Song <yunlong.song@...wei.com>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/r/1425032491-20224-3-git-send-email-yunlong.song@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/builtin-list.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index ad8018e..2acbcf0 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -50,9 +50,7 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
}
for (i = 0; i < argc; ++i) {
- if (i)
- putchar('\n');
- if (strncmp(argv[i], "tracepoint", 10) == 0)
+ if (strcmp(argv[i], "tracepoint") == 0)
print_tracepoint_events(NULL, NULL, false);
else if (strcmp(argv[i], "hw") == 0 ||
strcmp(argv[i], "hardware") == 0)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists