1

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

Rohan
  • 1,705
  • 7
  • 17
  • 38

1 Answers1

0

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

Vikram
  • 139
  • 11
  • This is just part of the problem. More info: https://developer.android.com/studio/profile/systrace/custom-events#native-code In Android Studio/DDMS, one has to enable a flag in the settings file to see them in systrace. I forgot which one – Rohan Sep 05 '19 at 18:50