0

When having open-source Go libraries their code local and running pprof, how could you actually ask pprof to inspect the source of those packages too?

I want to look into the Get call of the sessions library, which then goes into Gorilla's sessions.

This is, obviously, the output:

(pprof) list sessions
Total: 7.73s
No source information for github.com/gin-gonic/contrib/sessions.(*session).Get
No source information for github.com/gin-gonic/contrib/sessions.(*session).Session
No source information for github.com/gin-gonic/contrib/sessions.Sessions.func1
(pprof)
  • how are you invoking pprof? – JimB Jun 15 '16 at 21:39
  • It's bound on a https://github.com/gin-gonic/gin router with https://github.com/DeanThompson/ginpprof. It listens for 30s on `go tool pprof https://url/debug/profile`. –  Jun 16 '16 at 06:33
  • @User2910293 I'm not sure if we're on the same page, you need to create a go benchmark that uses the sessions library and then run `go test -bench=Session -cpuprofile=cpu.out` – John S Perayil Jun 16 '16 at 07:42
  • @JohnSPerayil: there are other ways to create a profile – JimB Jun 16 '16 at 13:38
  • @User2910293: I haven't seen this error from a remote session, but do you have the same tooling versions, environment, and packages locally? Does the `top` command show a breakdown of the call times, even without source info? (also, pprof is a sampling profiler, you you need to ensure that the system is under sufficient load while sampling) – JimB Jun 16 '16 at 13:43
  • @JimB Yes I know, I mentioned this method since OP wanted to look into the Get call of sessions specifically. – John S Perayil Jun 17 '16 at 18:03

0 Answers0