diff options
author | Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> | 2016-08-09 02:23:24 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-08-09 11:09:59 -0400 |
commit | d820456dc70b231d62171ba46b43db0045e9bd57 (patch) | |
tree | a9de4809c4932c1ec6a2621c6118c20bf67faf74 | |
parent | 840b49ba554b40fa8301ad2716abd2fe3d9e382a (diff) |
perf probe: Add function to post process kernel trace events
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>
-rw-r--r-- | tools/perf/util/probe-event.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 1201f73ca723..234fbfb5c2ed 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
@@ -666,22 +666,14 @@ static int add_module_to_probe_trace_events(struct probe_trace_event *tevs, | |||
666 | return ret; | 666 | return ret; |
667 | } | 667 | } |
668 | 668 | ||
669 | /* Post processing the probe events */ | 669 | static int |
670 | static int post_process_probe_trace_events(struct probe_trace_event *tevs, | 670 | post_process_kernel_probe_trace_events(struct probe_trace_event *tevs, |
671 | int ntevs, const char *module, | 671 | int ntevs) |
672 | bool uprobe) | ||
673 | { | 672 | { |
674 | struct ref_reloc_sym *reloc_sym; | 673 | struct ref_reloc_sym *reloc_sym; |
675 | char *tmp; | 674 | char *tmp; |
676 | int i, skipped = 0; | 675 | int i, skipped = 0; |
677 | 676 | ||
678 | if (uprobe) | ||
679 | return add_exec_to_probe_trace_events(tevs, ntevs, module); | ||
680 | |||
681 | /* Note that currently ref_reloc_sym based probe is not for drivers */ | ||
682 | if (module) | ||
683 | return add_module_to_probe_trace_events(tevs, ntevs, module); | ||
684 | |||
685 | reloc_sym = kernel_get_ref_reloc_sym(); | 677 | reloc_sym = kernel_get_ref_reloc_sym(); |
686 | if (!reloc_sym) { | 678 | if (!reloc_sym) { |
687 | pr_warning("Relocated base symbol is not found!\n"); | 679 | pr_warning("Relocated base symbol is not found!\n"); |
@@ -713,6 +705,21 @@ static int post_process_probe_trace_events(struct probe_trace_event *tevs, | |||
713 | return skipped; | 705 | return skipped; |
714 | } | 706 | } |
715 | 707 | ||
708 | /* Post processing the probe events */ | ||
709 | static int post_process_probe_trace_events(struct probe_trace_event *tevs, | ||
710 | int ntevs, const char *module, | ||
711 | bool uprobe) | ||
712 | { | ||
713 | if (uprobe) | ||
714 | return add_exec_to_probe_trace_events(tevs, ntevs, module); | ||
715 | |||
716 | if (module) | ||
717 | /* Currently ref_reloc_sym based probe is not for drivers */ | ||
718 | return add_module_to_probe_trace_events(tevs, ntevs, module); | ||
719 | |||
720 | return post_process_kernel_probe_trace_events(tevs, ntevs); | ||
721 | } | ||
722 | |||
716 | /* Try to find perf_probe_event with debuginfo */ | 723 | /* Try to find perf_probe_event with debuginfo */ |
717 | static int try_to_find_probe_trace_events(struct perf_probe_event *pev, | 724 | static int try_to_find_probe_trace_events(struct perf_probe_event *pev, |
718 | struct probe_trace_event **tevs) | 725 | struct probe_trace_event **tevs) |