C++层打堆栈

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)

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值