Skip to content
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

[v49] Track event not appearing in UI/Python API #982

Open
Sherry6352 opened this issue Jan 9, 2025 · 4 comments
Open

[v49] Track event not appearing in UI/Python API #982

Sherry6352 opened this issue Jan 9, 2025 · 4 comments
Labels

Comments

@Sherry6352
Copy link

Sherry6352 commented Jan 9, 2025

When open the file in the ui.perfetto.dev, I can query all the item successfully.
Image
However, when I open it through my python code
`
from perfetto.trace_processor import TraceProcessor

tp = TraceProcessor(trace=trace_file)

qr_it = tp.query('SELECT * FROM slice')
`
I get no item.

Does anyone encounter the same issue?
How can I get valid data through python query function?

@LalitMaganti
Copy link
Collaborator

What happens if you switch the version of the UI to a newer version? So suppose you change to canary? Does it also show no data then?

@Sherry6352
Copy link
Author

Sherry6352 commented Jan 9, 2025

What happens if you switch the version of the UI to a newer version? So suppose you change to canary? Does it also show no data then?

@LalitMaganti
When I use stable version, It shows timeline data and I can query data as I showed in the question.
When I switch to canary, it displays a unexpected results
Image
and query leads to no data.

@LalitMaganti
Copy link
Collaborator

I'm reasonably sure you are being hit by the changes in https://r.android.com/3421887. It seems to me like you have a track_event trace that you are either writing with the Perfetto SDK or synthesising manually.

In the past we were a lot more relaxed about how we parsed track events and we allowed traces which were technically invalid to still parse and appear. To be clear, these traces always did not meet the specification in the protos, they just happened to work.

Now we're more strict in validating the trace to make sure that everything is consistent. And if it's not we reject the event instead of silently parsing it incorrectly.

Likely the cause of this is incorrect parent/child track relationships: you can confirm this by loading your trace with trace processor from the command line (https://perfetto.dev/docs/quickstart/trace-analysis#trace-processor): it will almost certainly print out a bunch of error messages of the form "Missing uuid in hierarchy for track ". You should make sure that when you are emitting track descriptors that the parent descriptors for the track exist in the trace.

If you are using the Perfetto SDK, this issue was fixed in r.android.com/3367627: you should ensure your SDK version is upreved to something past this point.

I am interested to understand whether this is a common problem people are facing so I will leave this bug open. If other people report the same, we might relax the check: though it's an open question how we should interpret the trace in that case, I'm not convinced the previously implemented way is the correct one.

@Sherry6352
Copy link
Author

@LalitMaganti
Thank you for your detailed explanation. We will check our trace generation code, and update here if we discover anything.

@LalitMaganti LalitMaganti changed the title Fail to query all items in the slice table [v49] Track event not appearing in UI/Python API Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants