简体   繁体   中英

Can't see ATrace logs in logcat

I used the tracing mechanism for C++ described here by google. I'm checking for ATrace_isEnabled and while I'm getting true for ATrace_isEnabled, I'm unable to see any logs in the logcat.

I also went through with this answer, but to get enabled, I have to run systrace.py --app="my binary name". The setting of flags do not help

Is there something I'm missing?

I'm on Android 6.0.1

The setting of flags do not help, because in there source code, logic is such that it gets changed to 0 again. You need to specify appname wise like

adb shell "setprop debug.atrace.app_number 1" adb shell "setprop debug.atrace.app_0 appname"

and for getting logs in logcat, use this __android_log_print(ANDROID_LOG_INFO, LOG_TAG, "ATrace_isEnabled = %s", ATrace_isEnabled1()?"true":"false"); . Define LOG_TAG for this. for more help, see this ATrace_isEnabled() return false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM