summaryrefslogtreecommitdiff
path: root/tools/perf/util/parse-events.y
diff options
context:
space:
mode:
authorHe Kuang <hekuang@huawei.com>2015-09-28 06:52:16 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-09-28 23:30:07 +0300
commite637d17757a10732fa5d573c18f20b3cd4d31245 (patch)
tree5b303f98bc8898f26d2445138904f2fb14403a2d /tools/perf/util/parse-events.y
parent865582c3f48e12b7ab9e260161868313e4a37f44 (diff)
downloadlinux-e637d17757a10732fa5d573c18f20b3cd4d31245.tar.xz
perf tools: Enable event_config terms to tracepoint events
This patch enables config terms for tracepoint perf events. Valid terms for tracepoint events are 'call-graph' and 'stack-size', so we can use different callgraph settings for each event and eliminate unnecessary overhead. Here is an example for using different call-graph config for each tracepoint. $ perf record -e syscalls:sys_enter_write/call-graph=fp/ -e syscalls:sys_exit_write/call-graph=no/ dd if=/dev/zero of=test bs=4k count=10 $ perf report --stdio # # Total Lost Samples: 0 # # Samples: 13 of event 'syscalls:sys_enter_write' # Event count (approx.): 13 # # Children Self Command Shared Object Symbol # ........ ........ ....... .................. ...................... # 76.92% 76.92% dd libpthread-2.20.so [.] __write_nocancel | ---__write_nocancel 23.08% 23.08% dd libc-2.20.so [.] write | ---write | |--33.33%-- 0x2031342820736574 | |--33.33%-- 0xa6e69207364726f | --33.33%-- 0x34202c7320393039 ... # Samples: 13 of event 'syscalls:sys_exit_write' # Event count (approx.): 13 # # Children Self Command Shared Object Symbol # ........ ........ ....... .................. ...................... # 76.92% 76.92% dd libpthread-2.20.so [.] __write_nocancel 23.08% 23.08% dd libc-2.20.so [.] write 7.69% 0.00% dd [unknown] [.] 0x0a6e69207364726f 7.69% 0.00% dd [unknown] [.] 0x2031342820736574 7.69% 0.00% dd [unknown] [.] 0x34202c7320393039 Signed-off-by: He Kuang <hekuang@huawei.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Kan Liang <kan.liang@intel.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Wang Nan <wangnan0@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/1443412336-120050-4-git-send-email-hekuang@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.y')
-rw-r--r--tools/perf/util/parse-events.y26
1 files changed, 22 insertions, 4 deletions
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 1c598c2f8dfc..ae6af269f9c9 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -380,12 +380,30 @@ tracepoint_name
struct list_head *list;
ALLOC_LIST(list);
+ if (error)
+ error->idx = @1.first_column;
+
if (parse_events_add_tracepoint(list, &data->idx, $1.sys, $1.event,
- error)) {
- if (error)
- error->idx = @1.first_column;
+ error, NULL))
return -1;
- }
+
+ $$ = list;
+}
+|
+tracepoint_name '/' event_config '/'
+{
+ struct parse_events_evlist *data = _data;
+ struct parse_events_error *error = data->error;
+ struct list_head *list;
+
+ ALLOC_LIST(list);
+ if (error)
+ error->idx = @1.first_column;
+
+ if (parse_events_add_tracepoint(list, &data->idx, $1.sys, $1.event,
+ error, $3))
+ return -1;
+
$$ = list;
}