diff options
author | Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> | 2010-10-21 06:13:41 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-10-21 14:11:44 -0400 |
commit | 469b9b88488e89114bb3e9ac5ee7906b7b96123f (patch) | |
tree | 9f002195a8b1167eddbe560ac834e6ba2dedb19f /tools/perf/util/probe-event.h | |
parent | fb8c5a56c7ddbc2b0d2ee7a8da60fe1355f75141 (diff) |
perf probe: Add basic module support
Add basic module probe support on perf probe. This introduces "--module
<MODNAME>" option to perf probe for putting probes and showing lines and
variables in the given module.
Currently, this supports only probing on running modules. Supporting off-line
module probing is the next step.
e.g.)
[show lines]
# ./perf probe --module drm -L drm_vblank_info
<drm_vblank_info:0>
0 int drm_vblank_info(struct seq_file *m, void *data)
1 {
struct drm_info_node *node = (struct drm_info_node *) m->private
3 struct drm_device *dev = node->minor->dev;
...
[show vars]
# ./perf probe --module drm -V drm_vblank_info:3
Available variables at drm_vblank_info:3
@<drm_vblank_info+20>
(unknown_type) data
struct drm_info_node* node
struct seq_file* m
[put a probe]
# ./perf probe --module drm drm_vblank_info:3 node m
Add new event:
probe:drm_vblank_info (on drm_vblank_info:3 with node m)
You can now use it on all perf tools, such as:
perf record -e probe:drm_vblank_info -aR sleep 1
[list probes]
# ./perf probe -l
probe:drm_vblank_info (on drm_vblank_info:3@drivers/gpu/drm/drm_info.c with ...
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: <20101021101341.3542.71638.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-event.h')
-rw-r--r-- | tools/perf/util/probe-event.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h index c74b1fd2c1fa..5accbedfea37 100644 --- a/tools/perf/util/probe-event.h +++ b/tools/perf/util/probe-event.h | |||
@@ -115,14 +115,18 @@ extern void clear_perf_probe_event(struct perf_probe_event *pev); | |||
115 | /* Command string to line-range */ | 115 | /* Command string to line-range */ |
116 | extern int parse_line_range_desc(const char *cmd, struct line_range *lr); | 116 | extern int parse_line_range_desc(const char *cmd, struct line_range *lr); |
117 | 117 | ||
118 | /* Internal use: Return kernel/module path */ | ||
119 | extern const char *kernel_get_module_path(const char *module); | ||
118 | 120 | ||
119 | extern int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, | 121 | extern int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, |
120 | int max_probe_points, bool force_add); | 122 | int max_probe_points, const char *module, |
123 | bool force_add); | ||
121 | extern int del_perf_probe_events(struct strlist *dellist); | 124 | extern int del_perf_probe_events(struct strlist *dellist); |
122 | extern int show_perf_probe_events(void); | 125 | extern int show_perf_probe_events(void); |
123 | extern int show_line_range(struct line_range *lr); | 126 | extern int show_line_range(struct line_range *lr, const char *module); |
124 | extern int show_available_vars(struct perf_probe_event *pevs, int npevs, | 127 | extern int show_available_vars(struct perf_probe_event *pevs, int npevs, |
125 | int max_probe_points, bool externs); | 128 | int max_probe_points, const char *module, |
129 | bool externs); | ||
126 | 130 | ||
127 | 131 | ||
128 | /* Maximum index number of event-name postfix */ | 132 | /* Maximum index number of event-name postfix */ |