android P native code中如何加callstack

android native code中添加callstack

在Android.bp中的对应编译target中的shared_libs中添加libutilscallstack, 在header_libs中添加libutils_headers

(注意只要在对应的编译target里加这两个即可)

在cpp文件中:

#include <utils/CallStack.h>

android::CallStack callstack("the_callsack");

android callstack code在system/core/libutils/CallStack.cpp

猜你喜欢

转载自www.cnblogs.com/aspirs/p/12547855.html