Skip to contentSkip to conversation

perf probe: add kernel source path option

PATCH Superseded Chase Douglas 1 participant 1 message Jun 7, 2010 perf events

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 perf probe: add kernel source path option

The probe plugin requires access to the source code for some operations. The source code must be in the exact same location as specified by the DWARF tags, but sometimes the location is an absolute path that cannot be replicated by a normal user. This change adds the -s|--source option to allow the user to specify the root of the kernel source tree.

---
 tools/perf/Documentation/perf-probe.txt |    4 ++
 tools/perf/builtin-probe.c              |    2 +
 tools/perf/util/probe-finder.c          |   58 +++++++++++++++++++++++++++++--
 tools/perf/util/symbol.h                |    1 +
 4 files changed, 62 insertions(+), 3 deletions(-)
tools/perf/Documentation/perf-probe.txt +4 -0
index 94a258c..ea531d9 100644
@@ -31,6 +31,10 @@ OPTIONS
 --vmlinux=PATH::
 	Specify vmlinux path which has debuginfo (Dwarf binary).
 
+-s::
+--source=PATH::
+	Specify path to kernel source.
+
 -v::
 --verbose::
         Be more verbose (show parsed arguments, etc).
tools/perf/builtin-probe.c +2 -0
index e4a4da3..5455186 100644
@@ -182,6 +182,8 @@ static const struct option options[] = {
 		     "Show source code lines.", opt_show_lines),
 	OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
 		   "file", "vmlinux pathname"),
+	OPT_STRING('s', "source", &symbol_conf.source_prefix,
+		   "directory", "path to kernel source"),
 #endif
 	OPT__DRY_RUN(&probe_event_dry_run),
 	OPT_INTEGER('\0', "max-probes", &params.max_probe_points,
tools/perf/util/probe-finder.c +55 -3

78 lines not on this page · raw message

tools/perf/util/symbol.h +1 -0
index 10b7ff8..80e569b 100644
@@ -71,6 +71,7 @@ struct symbol_conf {
 			full_paths,
 			show_cpu_utilization;
 	const char	*vmlinux_name,
+			*source_prefix,
 			*field_sep;
 	const char	*default_guest_vmlinux_name,
 			*default_guest_kallsyms,
Signature · 1 line
1.7.0.4