aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-finder.h
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>2010-10-21 06:13:23 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-10-21 13:59:06 -0400
commitcf6eb489e5c04c8f8d5fd7bf90b8346c987688bc (patch)
tree3da471c3ae3f99cdcbec26cc95412a4b44506f3c /tools/perf/util/probe-finder.h
parent632941c4f8fbd5b90dcb1672cd0422dfd7332bc9 (diff)
perf probe: Show accessible local variables
Add -V (--vars) option for listing accessible local variables at given probe point. This will help finding which local variables are available for event arguments. e.g.) # perf probe -V call_timer_fn:23 Available variables at call_timer_fn:23 @<run_timer_softirq+345> function_type* fn int preempt_count long unsigned int data struct list_head work_list struct list_head* head struct timer_list* timer struct tvec_base* base Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <20101021101323.3542.40282.stgit@ltc236.sdl.hitachi.co.jp> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/probe-finder.h')
-rw-r--r--tools/perf/util/probe-finder.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index 4507d519f183..baffd25f39c9 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -25,17 +25,22 @@ extern int find_probe_trace_events(int fd, struct perf_probe_event *pev,
25extern int find_perf_probe_point(int fd, unsigned long addr, 25extern int find_perf_probe_point(int fd, unsigned long addr,
26 struct perf_probe_point *ppt); 26 struct perf_probe_point *ppt);
27 27
28/* Find a line range */
28extern int find_line_range(int fd, struct line_range *lr); 29extern int find_line_range(int fd, struct line_range *lr);
29 30
31/* Find available variables */
32extern int find_available_vars_at(int fd, struct perf_probe_event *pev,
33 struct variable_list **vls, int max_points);
34
30#include <dwarf.h> 35#include <dwarf.h>
31#include <libdw.h> 36#include <libdw.h>
32#include <version.h> 37#include <version.h>
33 38
34struct probe_finder { 39struct probe_finder {
35 struct perf_probe_event *pev; /* Target probe event */ 40 struct perf_probe_event *pev; /* Target probe event */
36 struct probe_trace_event *tevs; /* Result trace events */ 41
37 int ntevs; /* Number of trace events */ 42 /* Callback when a probe point is found */
38 int max_tevs; /* Max number of trace events */ 43 int (*callback)(Dwarf_Die *sp_die, struct probe_finder *pf);
39 44
40 /* For function searching */ 45 /* For function searching */
41 int lno; /* Line number */ 46 int lno; /* Line number */
@@ -53,6 +58,20 @@ struct probe_finder {
53 struct probe_trace_arg *tvar; /* Current result variable */ 58 struct probe_trace_arg *tvar; /* Current result variable */
54}; 59};
55 60
61struct trace_event_finder {
62 struct probe_finder pf;
63 struct probe_trace_event *tevs; /* Found trace events */
64 int ntevs; /* Number of trace events */
65 int max_tevs; /* Max number of trace events */
66};
67
68struct available_var_finder {
69 struct probe_finder pf;
70 struct variable_list *vls; /* Found variable lists */
71 int nvls; /* Number of variable lists */
72 int max_vls; /* Max no. of variable lists */
73};
74
56struct line_finder { 75struct line_finder {
57 struct line_range *lr; /* Target line range */ 76 struct line_range *lr; /* Target line range */
58 77