Commit 35a23ff
perf probe: Cut off the gcc optimization postfixes from function name
Cut off the postfixes which gcc added for optimized routines from the
event name automatically generated from symbol name, since *probe-events
doesn't accept it. Those symbols will be used if we don't use debuginfo
to find target functions.
E.g. without this fix;
-----
# perf probe -va alloc_buf.isra.23
probe-definition(0): alloc_buf.isra.23
symbol:alloc_buf.isra.23 file:(null) line:0 offset:0 return:0 lazy:(null)
[...]
Opening /sys/kernel/debug/tracing/kprobe_events write=1
Added new event:
Writing event: p:probe/alloc_buf.isra.23 _text+4869328
Failed to write event: Invalid argument
Error: Failed to add events. Reason: Invalid argument (Code: -22)
-----
With this fix;
-----
perf probe -va alloc_buf.isra.23
probe-definition(0): alloc_buf.isra.23
symbol:alloc_buf.isra.23 file:(null) line:0 offset:0 return:0 lazy:(null)
[...]
Opening /sys/kernel/debug/tracing/kprobe_events write=1
Added new event:
Writing event: p:probe/alloc_buf _text+4869328
probe:alloc_buf (on alloc_buf.isra.23)
You can now use it in all perf tools, such as:
perf record -e probe:alloc_buf -aR sleep 1
-----
Signed-off-by: Masami Hiramatsu <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Naohiro Aota <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>1 parent 61d67d5 commit 35a23ff
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2316 | 2316 | | |
2317 | 2317 | | |
2318 | 2318 | | |
| 2319 | + | |
2319 | 2320 | | |
2320 | 2321 | | |
2321 | 2322 | | |
| |||
2326 | 2327 | | |
2327 | 2328 | | |
2328 | 2329 | | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
2329 | 2334 | | |
2330 | 2335 | | |
2331 | 2336 | | |
| |||
0 commit comments