简体   繁体   English

在logcat中看不到ATrace日志

[英]Can't see ATrace logs in logcat

I used the tracing mechanism for C++ described here by google. 我使用了Google 在此描述的C ++跟踪机制。 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. 我正在检查ATrace_isEnabled,在我真正了解ATrace_isEnabled的同时,我无法在logcat中看到任何日志。

I also went through with this answer, but to get enabled, I have to run systrace.py --app="my binary name". 我也回答了这个问题,但是要启用它,我必须运行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 我在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. 标志的设置无济于事,因为在源代码中,逻辑是如此,以至于逻辑再次变为0 You need to specify appname wise like 您需要明智地指定appname

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"); 为了在logcat中获取日志,请使用以下__android_log_print(ANDROID_LOG_INFO, LOG_TAG, "ATrace_isEnabled = %s", ATrace_isEnabled1()?"true":"false"); . Define LOG_TAG for this. 为此定义LOG_TAG。 for more help, see this ATrace_isEnabled() return false 有关更多帮助,请参见此ATrace_isEnabled()返回false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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