Commit 4eced234 authored by Srikar Dronamraju's avatar Srikar Dronamraju Committed by Arnaldo Carvalho de Melo

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.comSigned-off-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 946d863c
...@@ -58,7 +58,7 @@ static struct { ...@@ -58,7 +58,7 @@ static struct {
struct perf_probe_event events[MAX_PROBES]; struct perf_probe_event events[MAX_PROBES];
struct strlist *dellist; struct strlist *dellist;
struct line_range line_range; struct line_range line_range;
const char *target_module; const char *target;
int max_probe_points; int max_probe_points;
struct strfilter *filter; struct strfilter *filter;
} params; } params;
...@@ -246,7 +246,7 @@ static const struct option options[] = { ...@@ -246,7 +246,7 @@ static const struct option options[] = {
"file", "vmlinux pathname"), "file", "vmlinux pathname"),
OPT_STRING('s', "source", &symbol_conf.source_prefix, OPT_STRING('s', "source", &symbol_conf.source_prefix,
"directory", "path to kernel source"), "directory", "path to kernel source"),
OPT_STRING('m', "module", &params.target_module, OPT_STRING('m', "module", &params.target,
"modname|path", "modname|path",
"target module name (for online) or path (for offline)"), "target module name (for online) or path (for offline)"),
#endif #endif
...@@ -333,7 +333,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) ...@@ -333,7 +333,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
if (!params.filter) if (!params.filter)
params.filter = strfilter__new(DEFAULT_FUNC_FILTER, params.filter = strfilter__new(DEFAULT_FUNC_FILTER,
NULL); NULL);
ret = show_available_funcs(params.target_module, ret = show_available_funcs(params.target,
params.filter); params.filter);
strfilter__delete(params.filter); strfilter__delete(params.filter);
if (ret < 0) if (ret < 0)
...@@ -354,7 +354,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) ...@@ -354,7 +354,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
usage_with_options(probe_usage, options); usage_with_options(probe_usage, options);
} }
ret = show_line_range(&params.line_range, params.target_module); ret = show_line_range(&params.line_range, params.target);
if (ret < 0) if (ret < 0)
pr_err(" Error: Failed to show lines. (%d)\n", ret); pr_err(" Error: Failed to show lines. (%d)\n", ret);
return ret; return ret;
...@@ -371,7 +371,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) ...@@ -371,7 +371,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
ret = show_available_vars(params.events, params.nevents, ret = show_available_vars(params.events, params.nevents,
params.max_probe_points, params.max_probe_points,
params.target_module, params.target,
params.filter, params.filter,
params.show_ext_vars); params.show_ext_vars);
strfilter__delete(params.filter); strfilter__delete(params.filter);
...@@ -393,7 +393,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) ...@@ -393,7 +393,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
if (params.nevents) { if (params.nevents) {
ret = add_perf_probe_events(params.events, params.nevents, ret = add_perf_probe_events(params.events, params.nevents,
params.max_probe_points, params.max_probe_points,
params.target_module, params.target,
params.force_add); params.force_add);
if (ret < 0) { if (ret < 0) {
pr_err(" Error: Failed to add events. (%d)\n", ret); pr_err(" Error: Failed to add events. (%d)\n", ret);
......
...@@ -273,10 +273,10 @@ static int add_module_to_probe_trace_events(struct probe_trace_event *tevs, ...@@ -273,10 +273,10 @@ static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
/* Try to find perf_probe_event with debuginfo */ /* Try to find perf_probe_event with debuginfo */
static int try_to_find_probe_trace_events(struct perf_probe_event *pev, static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
struct probe_trace_event **tevs, struct probe_trace_event **tevs,
int max_tevs, const char *module) int max_tevs, const char *target)
{ {
bool need_dwarf = perf_probe_event_need_dwarf(pev); bool need_dwarf = perf_probe_event_need_dwarf(pev);
struct debuginfo *dinfo = open_debuginfo(module); struct debuginfo *dinfo = open_debuginfo(target);
int ntevs, ret = 0; int ntevs, ret = 0;
if (!dinfo) { if (!dinfo) {
...@@ -295,9 +295,9 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev, ...@@ -295,9 +295,9 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
if (ntevs > 0) { /* Succeeded to find trace events */ if (ntevs > 0) { /* Succeeded to find trace events */
pr_debug("find %d probe_trace_events.\n", ntevs); pr_debug("find %d probe_trace_events.\n", ntevs);
if (module) if (target)
ret = add_module_to_probe_trace_events(*tevs, ntevs, ret = add_module_to_probe_trace_events(*tevs, ntevs,
module); target);
return ret < 0 ? ret : ntevs; return ret < 0 ? ret : ntevs;
} }
...@@ -1796,14 +1796,14 @@ static int __add_probe_trace_events(struct perf_probe_event *pev, ...@@ -1796,14 +1796,14 @@ static int __add_probe_trace_events(struct perf_probe_event *pev,
static int convert_to_probe_trace_events(struct perf_probe_event *pev, static int convert_to_probe_trace_events(struct perf_probe_event *pev,
struct probe_trace_event **tevs, struct probe_trace_event **tevs,
int max_tevs, const char *module) int max_tevs, const char *target)
{ {
struct symbol *sym; struct symbol *sym;
int ret = 0, i; int ret = 0, i;
struct probe_trace_event *tev; struct probe_trace_event *tev;
/* Convert perf_probe_event with debuginfo */ /* Convert perf_probe_event with debuginfo */
ret = try_to_find_probe_trace_events(pev, tevs, max_tevs, module); ret = try_to_find_probe_trace_events(pev, tevs, max_tevs, target);
if (ret != 0) if (ret != 0)
return ret; /* Found in debuginfo or got an error */ return ret; /* Found in debuginfo or got an error */
...@@ -1819,8 +1819,8 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev, ...@@ -1819,8 +1819,8 @@ static int convert_to_probe_trace_events(struct perf_probe_event *pev,
goto error; goto error;
} }
if (module) { if (target) {
tev->point.module = strdup(module); tev->point.module = strdup(target);
if (tev->point.module == NULL) { if (tev->point.module == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto error; goto error;
...@@ -1884,7 +1884,7 @@ struct __event_package { ...@@ -1884,7 +1884,7 @@ struct __event_package {
}; };
int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, int add_perf_probe_events(struct perf_probe_event *pevs, int npevs,
int max_tevs, const char *module, bool force_add) int max_tevs, const char *target, bool force_add)
{ {
int i, j, ret; int i, j, ret;
struct __event_package *pkgs; struct __event_package *pkgs;
...@@ -1907,7 +1907,7 @@ int add_perf_probe_events(struct perf_probe_event *pevs, int npevs, ...@@ -1907,7 +1907,7 @@ int add_perf_probe_events(struct perf_probe_event *pevs, int npevs,
ret = convert_to_probe_trace_events(pkgs[i].pev, ret = convert_to_probe_trace_events(pkgs[i].pev,
&pkgs[i].tevs, &pkgs[i].tevs,
max_tevs, max_tevs,
module); target);
if (ret < 0) if (ret < 0)
goto end; goto end;
pkgs[i].ntevs = ret; pkgs[i].ntevs = ret;
...@@ -2063,7 +2063,7 @@ static int filter_available_functions(struct map *map __unused, ...@@ -2063,7 +2063,7 @@ static int filter_available_functions(struct map *map __unused,
return 1; return 1;
} }
int show_available_funcs(const char *module, struct strfilter *_filter) int show_available_funcs(const char *target, struct strfilter *_filter)
{ {
struct map *map; struct map *map;
int ret; int ret;
...@@ -2074,9 +2074,9 @@ int show_available_funcs(const char *module, struct strfilter *_filter) ...@@ -2074,9 +2074,9 @@ int show_available_funcs(const char *module, struct strfilter *_filter)
if (ret < 0) if (ret < 0)
return ret; return ret;
map = kernel_get_module_map(module); map = kernel_get_module_map(target);
if (!map) { if (!map) {
pr_err("Failed to find %s map.\n", (module) ? : "kernel"); pr_err("Failed to find %s map.\n", (target) ? : "kernel");
return -EINVAL; return -EINVAL;
} }
available_func_filter = _filter; available_func_filter = _filter;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment