• Qing Zhang's avatar
    LoongArch: Add USER_STACKTRACE support · 4d7bf939
    Qing Zhang authored
    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: default avatarQing Zhang <zhangqing@loongson.cn>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    4d7bf939
stacktrace.h 2.46 KB