Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ravi Bangoria and committed by
Arnaldo Carvalho de Melo
d820456d 840b49ba

+18 -11
+18 -11
tools/perf/util/probe-event.c
··· 666 666 return ret; 667 667 } 668 668 669 - /* Post processing the probe events */ 670 - static int post_process_probe_trace_events(struct probe_trace_event *tevs, 671 - int ntevs, const char *module, 672 - bool uprobe) 669 + static int 670 + post_process_kernel_probe_trace_events(struct probe_trace_event *tevs, 671 + int ntevs) 673 672 { 674 673 struct ref_reloc_sym *reloc_sym; 675 674 char *tmp; 676 675 int i, skipped = 0; 677 - 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 676 685 677 reloc_sym = kernel_get_ref_reloc_sym(); 686 678 if (!reloc_sym) { ··· 703 711 reloc_sym->unrelocated_addr; 704 712 } 705 713 return skipped; 714 + } 715 + 716 + /* Post processing the probe events */ 717 + static int post_process_probe_trace_events(struct probe_trace_event *tevs, 718 + int ntevs, const char *module, 719 + bool uprobe) 720 + { 721 + if (uprobe) 722 + return add_exec_to_probe_trace_events(tevs, ntevs, module); 723 + 724 + if (module) 725 + /* Currently ref_reloc_sym based probe is not for drivers */ 726 + return add_module_to_probe_trace_events(tevs, ntevs, module); 727 + 728 + return post_process_kernel_probe_trace_events(tevs, ntevs); 706 729 } 707 730 708 731 /* Try to find perf_probe_event with debuginfo */