diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2010-04-21 15:56:40 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-26 14:35:20 -0400 |
commit | ef4a356574426877d569f8b6579325537eb7909b (patch) | |
tree | 0416c4ab1740a5ff6a07c01eee3e371128881110 /tools/perf/util/probe-event.c | |
parent | 5d1ee0413c8e2e0aa48510b1edfb3c4d2d43455b (diff) |
perf probe: Add --max-probes option
Add --max-probes option to change the maximum limit of
findable probe points per event, since inlined function can be
expanded into thousands of probe points. Default value is 128.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Suggested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
LKML-Reference: <20100421195640.24664.62984.stgit@localhost6.localdomain6>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/probe-event.c')
-rw-r--r-- | tools/perf/util/probe-event.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 5d3baec216e3..9ded38ced234 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
@@ -150,7 +150,8 @@ static int convert_to_perf_probe_point(struct kprobe_trace_point *tp, | |||
150 | 150 | ||
151 | /* Try to find perf_probe_event with debuginfo */ | 151 | /* Try to find perf_probe_event with debuginfo */ |
152 | static int try_to_find_kprobe_trace_events(struct perf_probe_event *pev, | 152 | static int try_to_find_kprobe_trace_events(struct perf_probe_event *pev, |
153 | struct kprobe_trace_event **tevs) | 153 | struct kprobe_trace_event **tevs, |
154 | int max_tevs) | ||
154 | { | 155 | { |
155 | bool need_dwarf = perf_probe_event_need_dwarf(pev); | 156 | bool need_dwarf = perf_probe_event_need_dwarf(pev); |
156 | int fd, ntevs; | 157 | int fd, ntevs; |
@@ -166,7 +167,7 @@ static int try_to_find_kprobe_trace_events(struct perf_probe_event *pev, | |||
166 | } | 167 | } |
167 | 168 | ||
168 | /* Searching trace events corresponding to probe event */ | 169 | /* Searching trace events corresponding to probe event */ |
169 | ntevs = find_kprobe_trace_events(fd, pev, tevs); | 170 | ntevs = find_kprobe_trace_events(fd, pev, tevs, max_tevs); |
170 | close(fd); | 171 | close(fd); |
171 | 172 | ||
172 | if (ntevs > 0) { /* Succeeded to find trace events */ | 173 | if (ntevs > 0) { /* Succeeded to find trace events */ |
@@ -318,7 +319,8 @@ static int convert_to_perf_probe_point(struct kprobe_trace_point *tp, | |||
318 | } | 319 | } |
319 | 320 | ||
320 | static int try_to_find_kprobe_trace_events(struct perf_probe_event *pev, | 321 | static int try_to_find_kprobe_trace_events(struct perf_probe_event *pev, |
321 | struct kprobe_trace_event **tevs __unused) | 322 | struct kprobe_trace_event **tevs __unused, |
323 | int max_tevs __unused) | ||
322 | { | 324 | { |
323 | if (perf_probe_event_need_dwarf(pev)) { | 325 | if (perf_probe_event_need_dwarf(pev)) { |
324 | pr_warning("Debuginfo-analysis is not supported.\n"); | 326 | pr_warning("Debuginfo-analysis is not supported.\n"); |
@@ -1408,14 +1410,15 @@ static int __add_kprobe_trace_events(struct perf_probe_event *pev, | |||
1408 | } | 1410 | } |
1409 | 1411 | ||
1410 | static int convert_to_kprobe_trace_events(struct perf_probe_event *pev, | 1412 | static int convert_to_kprobe_trace_events(struct perf_probe_event *pev, |
1411 | struct kprobe_trace_event **tevs) | 1413 | struct kprobe_trace_event **tevs, |
1414 | int max_tevs) | ||
1412 | { | 1415 | { |
1413 | struct symbol *sym; | 1416 | struct symbol *sym; |
1414 | int ret = 0, i; | 1417 | int ret = 0, i; |
1415 | struct kprobe_trace_event *tev; | 1418 | struct kprobe_trace_event *tev; |
1416 | 1419 | ||
1417 | /* Convert perf_probe_event with debuginfo */ | 1420 | /* Convert perf_probe_event with debuginfo */ |
1418 | ret = try_to_find_kprobe_trace_events(pev, tevs); | 1421 | ret = try_to_find_kprobe_trace_events(pev, tevs, max_tevs); |
1419 | if (ret != 0) | 1422 | if (ret != 0) |
1420 | return ret; | 1423 | return ret; |
1421 | 1424 | ||
@@ -1487,7 +1490,7 @@ struct __event_package { | |||
1487 | }; | 1490 | }; |
1488 | 1491 | ||
1489 | int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, | 1492 | int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, |
1490 | bool force_add) | 1493 | bool force_add, int max_tevs) |
1491 | { | 1494 | { |
1492 | int i, j, ret; | 1495 | int i, j, ret; |
1493 | struct __event_package *pkgs; | 1496 | struct __event_package *pkgs; |
@@ -1506,7 +1509,7 @@ int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, | |||
1506 | pkgs[i].pev = &pevs[i]; | 1509 | pkgs[i].pev = &pevs[i]; |
1507 | /* Convert with or without debuginfo */ | 1510 | /* Convert with or without debuginfo */ |
1508 | ret = convert_to_kprobe_trace_events(pkgs[i].pev, | 1511 | ret = convert_to_kprobe_trace_events(pkgs[i].pev, |
1509 | &pkgs[i].tevs); | 1512 | &pkgs[i].tevs, max_tevs); |
1510 | if (ret < 0) | 1513 | if (ret < 0) |
1511 | goto end; | 1514 | goto end; |
1512 | pkgs[i].ntevs = ret; | 1515 | pkgs[i].ntevs = ret; |