Since stap 1.4, it should work to probe mangled names, at least if the debuginfo has described them. I built a test program with your example, and "_ZN1A5doFooEv" and "_ZN1A5doFooEi" worked for the void and int case, respectively. It depends on the compiler to write the correct MIPS_linkage_name though. It can sometimes work from the symbol table too, but that doesn't necessarily cover all the optimized versions of a function that the compiler may have produced.
To see all the discovered mangled names, try stap -l 'process("foobar").function("_Z*")'
. The _Z is necessary in the wildcard to trigger processing of mangled names.
If stap is finding probe points, but they don't seem to fire as you expect, then it may be that the compiler is emitting multiple versions of your function, both inline and not. Try stap -l 'process("foobar").function("_Z*").*'
to see those variations of .call, .inline, and .return that stap finds. Remember that .return probes don't work on inlines, so they only correspond to .call instances.
Note that the @file:line syntax also works to find functions containing a line, so you can use that to anchor your function.return form too, not just .statement probes. You don't need to worry about all the return points in this case -- just pick any line in the function you care about, and it will trap all the return instructions. (This is assuming you're not dealing with inlines.)