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

web: flamegraph: show filename in tooltip #655

Open
mhansen opened this issue Oct 1, 2021 · 11 comments
Open

web: flamegraph: show filename in tooltip #655

mhansen opened this issue Oct 1, 2021 · 11 comments
Labels
Priority: p3 Buganizer priority - P3 type: feat Buganizer type - Feature Request

Comments

@mhansen
Copy link
Contributor

mhansen commented Oct 1, 2021

Forked off from #649 (comment)

What version of pprof are you using?

7fe48b4

What did you do?

Open the flamegraph view in the web browser:

image

What did you expect to see?

Filename in the tooltip -- in this case I used -roottag thread to add synthetic stack frames to the root of the trace, with the Filename = "thread", so help label the node.

What did you see instead?

No filename.

Fixing this might require moving to a DOM-element for the tooltip, I'm not sure if browsers natively support multiline tooltips?

@mhansen
Copy link
Contributor Author

mhansen commented Oct 9, 2021

Looks like there's options for an HTML-based tooltip in the latest d3-flamegraph: https://github.com/spiermar/d3-flame-graph#tooltip

@mhansen
Copy link
Contributor Author

mhansen commented Oct 9, 2021

The filename isn't passed as JSON to the FlameGraph yet, we'll want to add it to the {{.FlameGraph}} template variable to access it in the client.

@mhansen
Copy link
Contributor Author

mhansen commented Oct 9, 2021

Can't just pass node.Info.File to {{.FlameGraph}} as .File doesn't seem to be filled in yet, it seems empty in my test profiles.

@aalexand
Copy link
Collaborator

@mhansen RE empty filenames: can you try passing -filefunctions flag to pprof?

@mhansen
Copy link
Contributor Author

mhansen commented Oct 15, 2021

Thanks Alexey, -filefunctions works pretty well! Works on the synthetic tag filenames too.

image

@mhansen
Copy link
Contributor Author

mhansen commented Oct 15, 2021

I'm still wondering if we could put the filename in the tooltip by default, but I could go either way on it (this at least solves my immediate problem of how to demo tagroot in a blog post).

@aalexand
Copy link
Collaborator

I think we went back and forth on having -functions vs. -filefunctions as the default granularity in the past, so I'm not too enthusiastic about flipping the default. I could be convinced, but this might break some users.

@aalexand
Copy link
Collaborator

#106 is when we changed this.

We could force a different default in the flame graph generation perhaps, though we'll need to make sure this only changes the defaults and choosing a different granularity on the command line is still possible (e.g. -addresses etc).

@aalexand
Copy link
Collaborator

@mhansen For the blog post, you could simply have the instructions there as "Run pprof with -filefunctions flag"?

@mhansen
Copy link
Contributor Author

mhansen commented Oct 15, 2021 via email

@mhansen
Copy link
Contributor Author

mhansen commented Oct 15, 2021

The picture in my mind is something like what Firefox Profiler does: a baby step towards a richer tooltip that shows the filename (and doesn't mean the flamegraph has to also show the filename). Could start with the filename then grow that tooltip into more information like self & total time.

image

@Louis-Ye Louis-Ye added type: feat Buganizer type - Feature Request Priority: p3 Buganizer priority - P3 labels Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: p3 Buganizer priority - P3 type: feat Buganizer type - Feature Request
Projects
None yet
Development

No branches or pull requests

3 participants