Closed bboreham closed 1 year ago
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!
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?
Let's perhaps change the title of this issue to Missing file and line information in
pprofformat
. (:
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: https://github.com/zingneo/fgprof/commit/0bffb36c8f2941ce73812e3c7440aaf2ad5580c2
Alright, I've just implemented this in https://github.com/felixge/fgprof/pull/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 🙈 .
Tried out the new version and the file and line number info seems to be working as it should for my use case.
Thanks!
I added
github.com/felixge/fgprof
to one of the Prometheus unit tests, which gives me good charts but no source line info: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
.