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

Perfetto json formatting doesn't display readable millisecond timings. #879

Closed
alecazam opened this issue Sep 7, 2024 · 2 comments
Closed

Comments

@alecazam
Copy link

alecazam commented Sep 7, 2024

Here's a file where I write mllisecond timings to a file. Yes. the json is supposed to be in microseconds. But Perfetto has the "raw" timestamp format which should show 52.497, but instead shows and adjusts the timeline to scale 52497. This ignores the decimal point. The graph then isn't marked to the correct millisecond timings.

So these are being converted to nanos and displayed as such, but that wasn't the goal of the original output. So raw really mean nanos, not the raw values in microseconds. But then there isn't a microsecond scale which would also fix this.

Trying to use the seconds formatter, these display as [0.0052497 s] if I write them as the expected microsecond integers. Which also isn't a great scale either.

I've brought this up in past issues, that the time formatting is missing a milliseconds (and microseconds but I never work in those) format which is how I time most rendering. We deal with 30Hz to 240Hz displays.

{"traceEvents":[
{"name":"process_name","ph":"M","pid":0,"args":{"name":"kram"}},
{"name":"thread_name","ph":"M","tid":0,"args":{"name":"Main"}},
{"name":"ZipExtractRaw","ph":"X","tid":0,"ts":0.022,"dur":0.239},
{"name":"ZipExtractNormal","ph":"X","tid":0,"ts":0.285,"dur":28.678},
{"name":"KTXOpen","ph":"X","tid":0,"ts":28.971,"dur":12.621},
{"name":"KTXOpenNormal","ph":"X","tid":0,"ts":41.597,"dur":4.950},
{"name":"KTXLoad","ph":"X","tid":0,"ts":46.549,"dur":0.650},
{"name":"loadFileFromArchive","ph":"X","tid":0,"ts":0.021,"dur":52.497},
]}
image
@LalitMaganti
Copy link
Collaborator

https://r.android.com/c/3259031 changes "Raw" -> "Trace nanoseconds" which is a more accurate reflection of what the option is doing.

https://r.android.com/c/3256641 adds support for milliseconds and microseconds formatting for timestamps and durations.

@alecazam
Copy link
Author

alecazam commented Sep 7, 2024

Just make sure the hover tip reflects the correct unit if you didn't do so already. That's a critical utility for me, and I'm really pleased that was added.

primiano pushed a commit that referenced this issue Sep 9, 2024
This CL changes the "raw" and "rawlocale" timestamps to instead
reference "trace nanoseconds" instead. This makes it much clearer to
users who might be generating JSON traces where the "raw" timestamps in
the trace might be in millis or micros.

Bug: #879
Change-Id: Ib904d1fa95d87eb6f747bb8badbc9947daf88d10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants