trying to add perf probe at function%return not working

I'm trying to use perf to add 2 probe points, one each at the beginning and end of a function.

I get the name of the symbol (mangled, to work with perf) using this:

perf probe --funcs -x ./libVfeAecAndComms.so --no-demangle --filter='*'

which gives me 3 lines of output that are relevant for the function I'm after:

_ZN10AecElement15ProcessSubFrameERK15VoiceAudioFrameIfERS1_m
_ZN10AecElement15ProcessSubFrameERK15VoiceAudioFrameIfERS1_m
_ZN10AecElement15ProcessSubFrameERK15VoiceAudioFrameIfERS1_m@plt

The actual function is just AecElement::ProcessSubFrame() which returns void.

I can add a probe for the function entry using this:

perf probe -x ./libVfeAecAndComms.so --add psf_enter='_ZN10AecElement15ProcessSubFrameERK15VoiceAudioFrameIfERS1_m'

This seems to work with this message:

Added new event:
  probe_libVfeAecAndComms:psb_enter (on _ZN10AecElement15ProcessSubFrameERK15VoiceAudioFrameIfERS1_m in /opt/Bose/bin/VfeElementLibs/AecElement/libVfeAecAndComms.so)

I'm trying to add another probe point for the return from that function using the ' %return' trick outlined in the documentation for perf-probe [1] as follows:

perf probe -x ./libVfeAecAndComms.so --add psf_ret='_ZN10AecElement15ProcessSubFrameERK15VoiceAudioFrameIfERS1_m%return'

but it gives me an error:

Failed to find symbol _ZN10AecElement15ProcessSubFrameERK15VoiceAudioFrameIfERS1_m in /opt/Bose/bin/VfeElementLibs/AecElement/libVfeAecAndComms.so
  Error: Failed to add events.

One other note: running objdump --t ./libVfeAecAndComms.so only lists the one symbol name, _ZN10AecElement15ProcessSubFrameERK15VoiceAudioFrameIfERS1_m

I'm not sure why the %return added to the mangled symbol name isn't recognized. I've seen a couple of blogs showing this exact approach and the man page seems to say it should work.

Is there another way to do this?

[1] https://linux.die.net/man/1/perf-probe



Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)