Re: [lttng-dev] Capturing User-Level Function Calls/Returns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Frank,

Thanks for the point!

Regards.


On 2020-07-16 06:19, Frank Ch. Eigler wrote:

Hi -

If you can afford a more invasive tool, that requires a lot of
memory and stops your application for quite some time, you can look
at approaches like dyninst that decompile the binary, insert
instrumentation code and reassemble the code.

https://dyninst.org/

For the record, systemtap includes a backend that uses dyninst as a
pure userspace backend.

% cat foo.c
#include <stdio.h>

int foo() {
printf("foo\n");
return 1;
}

int main() {
foo();
}

% gcc -g foo.c

% stap --runtime=dyninst -e '
probe process.function("*").{call,return} { println(pp()) }
' -c a.out

foo
process("/home/fche/a.out").function("main@/home/fche/foo.c:8").call
process("/home/fche/a.out").function("foo@/home/fche/foo.c:3").call
process("/home/fche/a.out").function("foo@/home/fche/foo.c:3").return
process("/home/fche/a.out").function("main@/home/fche/foo.c:8").return

- FChE



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux