-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: deobfuscating track names #778
Comments
The proposal seems intuitively reasonable but there are a lot of subtle points to take into account:
Note also that that you should prepend the translation packet not append it: appending will work until you collect long (write_into_file) traces at which point it will subtly break in the current implementation :) |
cc-ing @aMayzner to keep her in the loop on this too. |
Thanks for pointing out the various track types. for context, i was hoping to cover at least the following cases:
I think those will all show up as process_tracks, i think translating those should be sufficient. AFIK it is not possible for ATrace to emit global tracks, but i'm unclear if that is possible to do via the Tracing SDK or not.
Mentioned above, but i think the same logic makes sense to apply for other data sources like atrace as well.
I think this still might be good behavior to have and would help many, bot not all cases. There are several cases this won't work fully, where the track is given a name explicitly that is obfuscated either through TrackDescriptor name or via ATRACE_AYNC_FOR_TRACK APIs. I can see both explicit and implicit track renaming able to coexist though without causing issues.
Thanks! good to know. I'll keep that in mind :) |
Yup you're correct, those are all process tracks
AFAIK (unless I'm misremembering) yes it's possible.
Ack makes sense. Given you only care about process scoped tracks for now, I'd restrict any changes to just process scoped tracks. I'd suggest doing the following:
Are you planning on sending a patch to support this? :) |
Sounds good, and sure, I can spend some time working on a patch for this. |
submitted https://android-review.googlesource.com/c/platform/external/perfetto/+/3079666 to address this |
Add a new message to the translation table proto that translates process track names which can help deobfuscate strings that appear in process track names. Time to load example example_android_trace_15s trace on M1Pro Mac: before: 1.27-1.31 seconds after: 1.25 -1.33 seconds bug: #778 Change-Id: I1e12b47ecc213056b2367641dd4096750abbb91d
Context
For various reasons, apps may choose to obfuscate the names of trace events, and thus need to be deobfuscated to be readable by a human.
Currently perfetto allows for deobfuscating slice names in traces by appending a packet with SliceNameTranslationTable: https://perfetto.dev/docs/reference/trace-packet-proto#TranslationTable
This allows deobfuscating slice names. However, some tracks, particularly async tracks, inherit their default track name from the slice names. This causes obfuscated names to appear in tracks with no way to remove them.
Proposal
I propose we extend the TranslationTable proto linked above to have a new field that allows for deobfuscation of track names as well. I think we should also limit this to deobfuscating the names of async tracks only to avoid potential false positive matches against thread names.
The text was updated successfully, but these errors were encountered: