C/C++打函数调用栈
Android Q
Android.bp文件中引入
shared_libs: [
"libcutils",
"liblog",
"libutils",
],
普通log
#include <android/log.h>
#define LOGI(args...) __android_log_print(ANDROID_LOG_INFO, "YourTag", ##args)
调用栈
Android.mk: LOCAL_SHARED_LIBRARIES里包含libutilscallstack
Android.bp: shared_libs里包含libutilscallstack
#include <utils/CallStack.h>
CallStack::logStack("dj.tang");
11-28 16:40:20.478 28858 29024 D djtang : #00 pc 01272b2b /system/b2g/libxul.so (_ZN20GeckoInputDispatcher9notifyKeyEPKN7android13NotifyKeyArgsE+26)
11-28 16:40:20.478 28858 29024 D djtang : #01 pc 01262205 /system/b2g/libxul.so (_ZN7android19QueuedInputListener5flushEv+34)
11-28 16:40:20.478 28858 29024 D djtang : #02 pc 01265c51 /system/b2g/libxul.so (_ZN7android11InputReader8loopOnceEv+356)
11-28 16:40:20.478 28858 29024 D djtang : #03 pc 0126225b /system/b2g/libxul.so (_ZN7android17InputReaderThread10threadLoopEv+8)
11-28 16:40:20.478 28858 29024 D djtang : #04 pc 00010079 /system/lib/libutils.so (_ZN7android6Thread11_threadLoopEPv+112)
11-28 16:40:20.478 28858 29024 D djtang : #05 pc 000415cb /system/lib/libc.so (_ZL15__pthread_startPv+30)
11-28 16:40:20.478 28858 29024 D djtang : #06 pc 00019265 /system/lib/libc.so (__start_thread+6)