https://github.com/torvalds/linux
Revision 4d7bf939df08218e682f7a42952eee3bad4dceb7 authored by Qing Zhang on 06 August 2022, 08:10:05 UTC, committed by Huacai Chen on 12 August 2022, 05:10:11 UTC
To get the best stacktrace output, you can compile your userspace
programs with frame pointers (at least glibc + the app you are tracing).

1, export "CC = gcc -fno-omit-frame-pointer";
2, compile your programs with "CC";
3, use uprobe to get stacktrace output.

...
     echo 'p:malloc /usr/lib64/libc.so.6:0x0a4704 size=%r4:u64' > uprobe_events
     echo 'p:free /usr/lib64/libc.so.6:0x0a4d50 ptr=%r4:x64' >> uprobe_events
     echo 'comm == "demo"' > ./events/uprobes/malloc/filter
     echo 'comm == "demo"' > ./events/uprobes/free/filter
     echo 1 > ./options/userstacktrace
     echo 1 > ./options/sym-userobj
...

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 93a4fa6
History
Tip revision: 4d7bf939df08218e682f7a42952eee3bad4dceb7 authored by Qing Zhang on 06 August 2022, 08:10:05 UTC
LoongArch: Add USER_STACKTRACE support
Tip revision: 4d7bf93

back to top