Skip to content

Commit

Permalink
perf probe: Add function to post process kernel trace events
Browse files Browse the repository at this point in the history
Instead of inline code, introduce function to post process kernel
probe trace events.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1470723805-5081-1-git-send-email-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Ravi Bangoria authored and Arnaldo Carvalho de Melo committed Aug 9, 2016
1 parent 840b49b commit d820456
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions tools/perf/util/probe-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,22 +666,14 @@ static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
return ret;
}

/* Post processing the probe events */
static int post_process_probe_trace_events(struct probe_trace_event *tevs,
int ntevs, const char *module,
bool uprobe)
static int
post_process_kernel_probe_trace_events(struct probe_trace_event *tevs,
int ntevs)
{
struct ref_reloc_sym *reloc_sym;
char *tmp;
int i, skipped = 0;

if (uprobe)
return add_exec_to_probe_trace_events(tevs, ntevs, module);

/* Note that currently ref_reloc_sym based probe is not for drivers */
if (module)
return add_module_to_probe_trace_events(tevs, ntevs, module);

reloc_sym = kernel_get_ref_reloc_sym();
if (!reloc_sym) {
pr_warning("Relocated base symbol is not found!\n");
Expand Down Expand Up @@ -713,6 +705,21 @@ static int post_process_probe_trace_events(struct probe_trace_event *tevs,
return skipped;
}

/* Post processing the probe events */
static int post_process_probe_trace_events(struct probe_trace_event *tevs,
int ntevs, const char *module,
bool uprobe)
{
if (uprobe)
return add_exec_to_probe_trace_events(tevs, ntevs, module);

if (module)
/* Currently ref_reloc_sym based probe is not for drivers */
return add_module_to_probe_trace_events(tevs, ntevs, module);

return post_process_kernel_probe_trace_events(tevs, ntevs);
}

/* Try to find perf_probe_event with debuginfo */
static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
struct probe_trace_event **tevs)
Expand Down

0 comments on commit d820456

Please sign in to comment.