Skip to contentSkip to conversation

perf probe: add '--demangle'/'--no-demangle'

PATCH New Azat Khuzhin 2 participants 2 messages Oct 28, 2013 – Nov 15, 2013 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf probe: add '--demangle'/'--no-demangle'

You can't pass demangled name into "perf probe", because of special chars:
./perf probe -f -x /tmp/a.out 'foo(int)'
Semantic error :There is non-digit char in line number.

And you can't even pass without demangling (because it search symbol in DSO with demangle=true):
./perf probe -f -x /tmp/a.out _Z3fooi
no symbols found in /tmp/a.out, maybe install a debug package?

However:
nm /tmp/a.out | grep foo
000000000040056d T _Z3fooi

After this patch, using the next command:
./perf probe -f --no-demangle -x /tmp/a.out _Z3fooi

probe will be successfully added.

---
 tools/perf/builtin-probe.c | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/builtin-probe.c +2 -0
index e8a66f9..7620f2e 100644
@@ -325,6 +325,8 @@ int cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		     opt_set_filter),
 	OPT_CALLBACK('x', "exec", NULL, "executable|path",
 			"target executable name or path", opt_set_target),
+	OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
+		    "Disable symbol demangling"),
 	OPT_END()
 	};
 	int ret;
Signature · 1 line
1.8.4.rc3
#1 lore raw

[tip:perf/urgent] perf probe: Add '--demangle'/'--no-demangle'

perf probe: Add '--demangle'/'--no-demangle'
Commit-ID:  35e17b2450e09968f9702d4048c228199af171bc
Gitweb:     http://git.kernel.org/tip/35e17b2450e09968f9702d4048c228199af171bc
Author:     Azat Khuzhin <[email protected]>
AuthorDate: Mon, 28 Oct 2013 12:04:24 +0400
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 14 Nov 2013 16:06:28 -0300

perf probe: Add '--demangle'/'--no-demangle'

You can't pass demangled name into "perf probe", because of special chars:
./perf probe -f -x /tmp/a.out 'foo(int)'
Semantic error :There is non-digit char in line number.

And you can't even pass without demangling (because it search symbol in DSO with demangle=true):
./perf probe -f -x /tmp/a.out _Z3fooi
no symbols found in /tmp/a.out, maybe install a debug package?

However:
nm /tmp/a.out | grep foo
000000000040056d T _Z3fooi

After this patch, using the next command:
./perf probe -f --no-demangle -x /tmp/a.out _Z3fooi

probe will be successfully added.

---
 tools/perf/builtin-probe.c | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/builtin-probe.c +2 -0
index 89acc17..6ea9e85 100644
@@ -325,6 +325,8 @@ int cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 		     opt_set_filter),
 	OPT_CALLBACK('x', "exec", NULL, "executable|path",
 			"target executable name or path", opt_set_target),
+	OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
+		    "Disable symbol demangling"),
 	OPT_END()
 	};
 	int ret;