Closed nitish24p closed 1 year ago
HI @nitish24p, thanks for raising this issue, and apologies for the delay π
Nice debugging! Nice that you were able to find the proper file path!
One thought: the app doesn't need to be profileable. That shouldn't matter but is it still /sys/kernel/tracing/trace_pipe
if the app is not profileable?
Might be depending on the version of ftrace according to this. If we need to handle multiple paths depending on the device, we'll handle all of them. In case you'd like to contribute and test it out locally, there's a guide here on how to build/test the C++ executable, but let me know if you have any questions!
In any case, I'll run a script at some point on our AWS device farm to check those paths work for all devices
Also just adding Unable to open file
in case of error is kind of horrendous on our side, so we'll need better error handling π
Hey @Almouro , Sure can help out if need be. Presently for my case, i made a fork and pushed a new tag with the path updated to the right one and built the binary files again and its working as expected.
Hi @nitish24p, at last, this should be fixed, I was able to reproduce on other devices. Can you confirm on your end? π
Do i need to update the version to latest?
Yep, you can upgrade the CLI by running curl https://get.flashlight.dev/ | bash
Hi @nitish24p , doing a bit of cleanup on Github issues, so I'm closing this one for now for lack of activity βΊοΈ
I think this is fixed now, but do feel free to reopen if the problem is still there! π
WHAT
I used the custom script to profile an android app. The app is in release build with the profileable tag enabled. On debugging and going a little deep into the source code i realised that the atrace was not getting collected. On debugging a little more i see the error log
The
Unable to open file
comes from line number https://github.com/bamlab/flashlight/blob/94c07a10f7811e83f8e7dcc01537e310e9957b87/packages/android-performance-profiler/cpp-profiler/src/atrace.cpp#L56On checking the path of the systrace file the source code mentions
However on my device i see the trace file being created at the path
/sys/kernel/tracing/trace_pipe
. To verify this on one terminal i ran the commandadb shell atrace -c view -t 999
and in another terminal did a simplecat /sys/kernel/tracing/trace_pipe
. And i was able to get the atrace..What am i to do here? is it possible the trace file locations vary as per devices? Also how do i fix the current case?
Device Info
Custom Script
Just followed the documentation..