diff options
author | Srikar Dronamraju <srikar@linux.vnet.ibm.com> | 2012-02-02 09:20:40 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-02-02 14:39:15 -0500 |
commit | 4eced2347c447c9409877368fc52478c356b4767 (patch) | |
tree | 842dffe49160456e46b59259cf1e9dce940bbdeb /tools | |
parent | 946d863cc0d2262080c8101c8e6299974e449fe3 (diff) |
perf probe: Rename target_module to target
This is a precursor patch that modifies names that refer to
kernel/module to also refer to user space names.
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Anton Arapov <anton@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux-mm <linux-mm@kvack.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20120202142040.5967.64156.sendpatchset@srdronam.in.ibm.com
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-probe.c | 12 | ||||
-rw-r--r-- | tools/perf/util/probe-event.c | 26 |
2 files changed, 19 insertions, 19 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index fb8566181f27..4935c09dd5b5 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c | |||
@@ -58,7 +58,7 @@ static struct { | |||
58 | struct perf_probe_event events[MAX_PROBES]; | 58 | struct perf_probe_event events[MAX_PROBES]; |
59 | struct strlist *dellist; | 59 | struct strlist *dellist; |
60 | struct line_range line_range; | 60 | struct line_range line_range; |
61 | const char *target_module; | 61 | const char *target; |
62 | int max_probe_points; | 62 | int max_probe_points; |
63 | struct strfilter *filter; | 63 | struct strfilter *filter; |
64 | } params; | 64 | } params; |
@@ -246,7 +246,7 @@ static const struct option options[] = { | |||
246 | "file", "vmlinux pathname"), | 246 | "file", "vmlinux pathname"), |
247 | OPT_STRING('s', "source", &symbol_conf.source_prefix, | 247 | OPT_STRING('s', "source", &symbol_conf.source_prefix, |
248 | "directory", "path to kernel source"), | 248 | "directory", "path to kernel source"), |
249 | OPT_STRING('m', "module", ¶ms.target_module, | 249 | OPT_STRING('m', "module", ¶ms.target, |
250 | "modname|path", | 250 | "modname|path", |
251 | "target module name (for online) or path (for offline)"), | 251 | "target module name (for online) or path (for offline)"), |
252 | #endif | 252 | #endif |
@@ -333,7 +333,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) | |||
333 | if (!params.filter) | 333 | if (!params.filter) |
334 | params.filter = strfilter__new(DEFAULT_FUNC_FILTER, | 334 | params.filter = strfilter__new(DEFAULT_FUNC_FILTER, |
335 | NULL); | 335 | NULL); |
336 | ret = show_available_funcs(params.target_module, | 336 | ret = show_available_funcs(params.target, |
337 | params.filter); | 337 | params.filter); |
338 | strfilter__delete(params.filter); | 338 | strfilter__delete(params.filter); |
339 | if (ret < 0) | 339 | if (ret < 0) |
@@ -354,7 +354,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) | |||
354 | usage_with_options(probe_usage, options); | 354 | usage_with_options(probe_usage, options); |
355 | } | 355 | } |
356 | 356 | ||
357 | ret = show_line_range(¶ms.line_range, params.target_module); | 357 | ret = show_line_range(¶ms.line_range, params.target); |
358 | if (ret < 0) | 358 | if (ret < 0) |
359 | pr_err(" Error: Failed to show lines. (%d)\n", ret); | 359 | pr_err(" Error: Failed to show lines. (%d)\n", ret); |
360 | return ret; | 360 | return ret; |
@@ -371,7 +371,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) | |||
371 | 371 | ||
372 | ret = show_available_vars(params.events, params.nevents, | 372 | ret = show_available_vars(params.events, params.nevents, |
373 | params.max_probe_points, | 373 | params.max_probe_points, |
374 | params.target_module, | 374 | params.target, |
375 | params.filter, | 375 | params.filter, |
376 | params.show_ext_vars); | 376 | params.show_ext_vars); |
377 | strfilter__delete(params.filter); | 377 | strfilter__delete(params.filter); |
@@ -393,7 +393,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) | |||
393 | if (params.nevents) { | 393 | if (params.nevents) { |
394 | ret = add_perf_probe_events(params.events, params.nevents, | 394 | ret = add_perf_probe_events(params.events, params.nevents, |
395 | params.max_probe_points, | 395 | params.max_probe_points, |
396 | params.target_module, | 396 | params.target, |
397 | params.force_add); | 397 | params.force_add); |
398 | if (ret < 0) { | 398 | if (ret < 0) { |
399 | pr_err(" Error: Failed to add events. (%d)\n", ret); | 399 | pr_err(" Error: Failed to add events. (%d)\n", ret); |
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index b9bbdd236357..c1a513e56764 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
@@ -273,10 +273,10 @@ static int add_module_to_probe_trace_events(struct probe_trace_event *tevs, | |||
273 | /* Try to find perf_probe_event with debuginfo */ | 273 | /* Try to find perf_probe_event with debuginfo */ |
274 | static int try_to_find_probe_trace_events(struct perf_probe_event *pev, | 274 | static int try_to_find_probe_trace_events(struct perf_probe_event *pev, |
275 | struct probe_trace_event **tevs, | 275 | struct probe_trace_event **tevs, |
276 | int max_tevs, const char *module) | 276 | int max_tevs, const char *target) |
277 | { | 277 | { |
278 | bool need_dwarf = perf_probe_event_need_dwarf(pev); | 278 | bool need_dwarf = perf_probe_event_need_dwarf(pev); |
279 | struct debuginfo *dinfo = open_debuginfo(module); | 279 | struct debuginfo *dinfo = open_debuginfo(target); |
280 | int ntevs, ret = 0; | 280 | int ntevs, ret = 0; |
281 | 281 | ||
282 | if (!dinfo) { | 282 | if (!dinfo) { |
@@ -295,9 +295,9 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev, | |||
295 | 295 | ||
296 | if (ntevs > 0) { /* Succeeded to find trace events */ | 296 | if (ntevs > 0) { /* Succeeded to find trace events */ |
297 | pr_debug("find %d probe_trace_events.\n", ntevs); | 297 | pr_debug("find %d probe_trace_events.\n", ntevs); |
298 | if (module) | 298 | if (target) |
299 | ret = add_module_to_probe_trace_events(*tevs, ntevs, | 299 | ret = add_module_to_probe_trace_events(*tevs, ntevs, |
300 | module); | 300 | target); |
301 | return ret < 0 ? ret : ntevs; | 301 | return ret < 0 ? ret : ntevs; |
302 | } | 302 | } |
303 | 303 | ||
@@ -1796,14 +1796,14 @@ static int __add_probe_trace_events(struct perf_probe_event *pev, | |||
1796 | 1796 | ||
1797 | static int convert_to_probe_trace_events(struct perf_probe_event *pev, | 1797 | static int convert_to_probe_trace_events(struct perf_probe_event *pev, |
1798 | struct probe_trace_event **tevs, | 1798 | struct probe_trace_event **tevs, |
1799 | int max_tevs, const char *module) | 1799 | int max_tevs, const char *target) |
1800 | { | 1800 | { |
1801 | struct symbol *sym; | 1801 | struct symbol *sym; |
1802 | int ret = 0, i; | 1802 | int ret = 0, i; |
1803 | struct probe_trace_event *tev; | 1803 | struct probe_trace_event *tev; |
1804 | 1804 | ||
1805 | /* Convert perf_probe_event with debuginfo */ | 1805 | /* Convert perf_probe_event with debuginfo */ |
1806 | ret = try_to_find_probe_trace_events(pev, tevs, max_tevs, module); | 1806 | ret = try_to_find_probe_trace_events(pev, tevs, max_tevs, target); |
1807 | if (ret != 0) | 1807 | if (ret != 0) |
1808 | return ret; /* Found in debuginfo or got an error */ | 1808 | return ret; /* Found in debuginfo or got an error */ |
1809 | 1809 | ||
@@ -1819,8 +1819,8 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev, | |||
1819 | goto error; | 1819 | goto error; |
1820 | } | 1820 | } |
1821 | 1821 | ||
1822 | if (module) { | 1822 | if (target) { |
1823 | tev->point.module = strdup(module); | 1823 | tev->point.module = strdup(target); |
1824 | if (tev->point.module == NULL) { | 1824 | if (tev->point.module == NULL) { |
1825 | ret = -ENOMEM; | 1825 | ret = -ENOMEM; |
1826 | goto error; | 1826 | goto error; |
@@ -1884,7 +1884,7 @@ struct __event_package { | |||
1884 | }; | 1884 | }; |
1885 | 1885 | ||
1886 | int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, | 1886 | int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, |
1887 | int max_tevs, const char *module, bool force_add) | 1887 | int max_tevs, const char *target, bool force_add) |
1888 | { | 1888 | { |
1889 | int i, j, ret; | 1889 | int i, j, ret; |
1890 | struct __event_package *pkgs; | 1890 | struct __event_package *pkgs; |
@@ -1907,7 +1907,7 @@ int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, | |||
1907 | ret = convert_to_probe_trace_events(pkgs[i].pev, | 1907 | ret = convert_to_probe_trace_events(pkgs[i].pev, |
1908 | &pkgs[i].tevs, | 1908 | &pkgs[i].tevs, |
1909 | max_tevs, | 1909 | max_tevs, |
1910 | module); | 1910 | target); |
1911 | if (ret < 0) | 1911 | if (ret < 0) |
1912 | goto end; | 1912 | goto end; |
1913 | pkgs[i].ntevs = ret; | 1913 | pkgs[i].ntevs = ret; |
@@ -2063,7 +2063,7 @@ static int filter_available_functions(struct map *map __unused, | |||
2063 | return 1; | 2063 | return 1; |
2064 | } | 2064 | } |
2065 | 2065 | ||
2066 | int show_available_funcs(const char *module, struct strfilter *_filter) | 2066 | int show_available_funcs(const char *target, struct strfilter *_filter) |
2067 | { | 2067 | { |
2068 | struct map *map; | 2068 | struct map *map; |
2069 | int ret; | 2069 | int ret; |
@@ -2074,9 +2074,9 @@ int show_available_funcs(const char *module, struct strfilter *_filter) | |||
2074 | if (ret < 0) | 2074 | if (ret < 0) |
2075 | return ret; | 2075 | return ret; |
2076 | 2076 | ||
2077 | map = kernel_get_module_map(module); | 2077 | map = kernel_get_module_map(target); |
2078 | if (!map) { | 2078 | if (!map) { |
2079 | pr_err("Failed to find %s map.\n", (module) ? : "kernel"); | 2079 | pr_err("Failed to find %s map.\n", (target) ? : "kernel"); |
2080 | return -EINVAL; | 2080 | return -EINVAL; |
2081 | } | 2081 | } |
2082 | available_func_filter = _filter; | 2082 | available_func_filter = _filter; |