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

"No source information" in pprof format #21

Closed
bboreham opened this issue Jun 10, 2022 · 6 comments · Fixed by #22
Closed

"No source information" in pprof format #21

bboreham opened this issue Jun 10, 2022 · 6 comments · Fixed by #22

Comments

@bboreham
Copy link

I added github.com/felixge/fgprof to one of the Prometheus unit tests, which gives me good charts but no source line info:

$ go tool pprof -list processWALSamples ./tsdb.test cpu2
Total: 59.55s
No source information for github.com/prometheus/prometheus/tsdb.(*walSubsetProcessor).processWALSamples

I can work on a repro if it's interesting; didn't know whether I should expect it to work.

I'm running go version go1.17.8 linux/amd64.

@felixge
Copy link
Owner

felixge commented Jul 24, 2022

Hey, sorry for the very late reply!

I just took a look, and this is currently broken because I initially was just targeting brendan gregg's folded text format (which doesn't contain file/line info) and then didn't rework the code to propagate this information when I added pprof support.

So in theory it should be a relatively easy fix! I don't know if I'll get a around to it soon, but I'd be happy to merge a patch for this quickly!

@bboreham
Copy link
Author

I don't know whether I'll get around to it either, but could you suggest a file or function which is a good place to start looking how to add it?

@bwplotka
Copy link

Let's perhaps change the title of this issue to Missing file and line information in pprof format. (:

@bboreham bboreham changed the title "No source information" from resulting profile "No source information" in pprof format Jul 31, 2022
@zingneo
Copy link

zingneo commented Aug 8, 2022

I needed this to work so I hacked it in the simplest way.

It works but it is inefficient and ugly, as Felix mentions in a TODO comment the interface between the functions need to be improved.

I didn't bother to make a PR as it is clearly not the right way of solving this, but it does work (at least for my use case, have not tried this extensively).
If anyone needs this short term or want to fix this properly: zingneo@0bffb36

@felixge
Copy link
Owner

felixge commented Aug 31, 2022

Alright, I've just implemented this in #22 . I've tested it, but it would also be great if somebody else could try it out and let me know if it works :).

@zingneo that's a nice hack! Doing it "properly" required quite some code changes. My initial abstraction was not very good 🙈 .

@zingneo
Copy link

zingneo commented Sep 4, 2022

Tried out the new version and the file and line number info seems to be working as it should for my use case.

Thanks!

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

Successfully merging a pull request may close this issue.

4 participants