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

Let users set the displayed time range #766

Open
chiphogg opened this issue Apr 16, 2024 · 2 comments
Open

Let users set the displayed time range #766

chiphogg opened this issue Apr 16, 2024 · 2 comments

Comments

@chiphogg
Copy link

I use perfetto to iterate on improving C++ compile times for individual files. It would be really satisfying to be able to see the "jump" once I finally break through and score a significant speedup. But perfetto automatically scales the data so that it consumes the full width of the UI. This means that when I switch to the new-and-improved time trace, it doesn't look shorter; it just looks "different".

I searched previous issues for "range", and found #737. I don't really understand javascript, but after some hacking, I was able to come up with this snippet, which I could input into the javascript console (F12), and set the range to 50 seconds:

window.postMessage({perfetto: {timeStart: 0n, timeEnd: 50000000000n,},}, "https://ui.perfetto.dev")

The problem is that perfetto appears to restrict the display so that the data never consumes less than the full width. In particular, if I open a time trace that took less than 50 seconds overall and apply that command, it simply scales to the full width. For manual zooming, with w and s, this makes a lot of sense and is really convenient: it makes it super easy to just zoom out and see all of the data, without "overzooming". But if the user is inputting precise values, I don't think that restriction should apply.

(It'd also be nice if that inputting of precise values could get some first class UI support, but if we could just remove the zoom limit for this use case, then I could live with the javascript console!)

@primiano
Copy link
Collaborator

Fair request. As long as we don't over-zoom when the use presses W/S or uses the scroll wheel, i'm supportive of this change.

@chiphogg feel free to drop a patch! Thanks

@chiphogg
Copy link
Author

I'd be happy to, but I have no idea how to develop in javascript, and I'm not familiar with the structure of the project. That said, if some other javascript-savvy person stumbles on this issue, please feel free to put up a patch in my place!

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