Skip to contentSkip to conversation

perf probe: add kernel source path option

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

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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          |   56 +++++++++++++++++++++++++++++-
 tools/perf/util/symbol.h                |    1 +
 4 files changed, 61 insertions(+), 2 deletions(-)
tools/perf/Documentation/perf-probe.txt +4 -0
index 34202b1..d387d8b 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 152d6c9..ae7ba65 100644
@@ -167,6 +167,8 @@ static const struct option options[] = {
 #ifndef NO_DWARF_SUPPORT
 	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_BOOLEAN('l', "list", &session.list_events,
 		    "list up current probe events"),
tools/perf/util/probe-finder.c +54 -2

74 lines not on this page · raw message

tools/perf/util/symbol.h +1 -0
index f30a374..fdec2eb 100644
@@ -65,6 +65,7 @@ struct symbol_conf {
 			exclude_other,
 			full_paths;
 	const char	*vmlinux_name,
+			*source_prefix,
 			*field_sep;
 	char            *dso_list_str,
 			*comm_list_str,
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 6 lines · Chase Douglas

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.

Quoted 7 lines
---
 tools/perf/Documentation/perf-probe.txt |    4 ++
 tools/perf/builtin-probe.c              |    2 +
 tools/perf/util/probe-finder.c          |   56 +++++++++++++++++++++++++++++-
 tools/perf/util/symbol.h                |    1 +
 4 files changed, 61 insertions(+), 2 deletions(-)

Please disregard this patch. It is based on the 2.6.34 kernel and I forgot to rebase it on the latest perf code. I have a newer patch I will be sending out shortly.

Thanks,

-- Chase