goanalyzer = go tool trace The options to goanalyzer are the same as ‘go tool trace’ - the usage message is misleading in this way.
By ‘map’ I mean expose the pprof port as you would any other port, and yes you use the net/http/pprof to start the internal webserver - you don’t need to create your own. > On Sep 10, 2020, at 6:38 PM, Siddhesh Divekar <siddhesh.dive...@gmail.com> > wrote: > > Hi Robert, > > Laying down the steps to make sure I understood it correctly. > > You can map the port > What did you mean by above ? > > but might be easier to capture to a file via code and use goanalyzer on the > file > In this case I will do the following. > a) Set up a webserver in my program for getting Go profiles (with import _ > "net/http/pprof") > b) map a port from outside k8s so that i can run curl > localhost:$PORT/debug/pprof/$PROFILE_TYPE to save a profile (say profile-file) > c) Use go tool pprof/goanalyzer to analyze given profile from the profile-file > > I would prefer to run this outside my process as the issue we expect to > happen is when my program is hung. > I am not sure if the http server would respond & generate profile files. > > From the help of goanalyzer it's not very clear how I would pass the > profile-file to it. > It's showing how to generate profile-file using go test/tool but not how to > pass them to goanalyzer. > > # ./goanalyzer -h > Usage of 'go tool trace': > Given a trace file produced by 'go test': > go test -trace=trace.out pkg > > Open a web browser displaying trace: > go tool trace [flags] [pkg.test] trace.out > > Generate a pprof-like profile from the trace: > go tool trace -pprof=TYPE [pkg.test] trace.out > > [pkg.test] argument is required for traces produced by Go 1.6 and below. > Go 1.7 does not require the binary argument. > > Supported profile types are: > - net: network blocking profile > - sync: synchronization blocking profile > - syscall: syscall blocking profile > - sched: scheduler latency profile > > Flags: > -http=addr: HTTP service address (e.g., ':6060') > -pprof=type: print a pprof-like profile instead > -d: print debug info such as parsed events > > > On Thu, Sep 10, 2020 at 3:22 PM Robert Engels <reng...@ix.netcom.com > <mailto:reng...@ix.netcom.com>> wrote: > You can map the port but might be easier to capture to a file via code and > use goanalyzer on the file. > >> On Sep 10, 2020, at 4:53 PM, Siddhesh Divekar <siddhesh.dive...@gmail.com >> <mailto:siddhesh.dive...@gmail.com>> wrote: >> >> >> Hi, >> >> Has anyone tried running goanalyzer on golang process running inside k8s pod. >> >> If so can you point me to the steps. >> >> -- >> -Siddhesh. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts+unsubscr...@googlegroups.com >> <mailto:golang-nuts+unsubscr...@googlegroups.com>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/CAMjfk%2BhUDqMRmE0mDp_gMTKWKT0Be8KgtBxuF2fYAGCs-dNoog%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/golang-nuts/CAMjfk%2BhUDqMRmE0mDp_gMTKWKT0Be8KgtBxuF2fYAGCs-dNoog%40mail.gmail.com?utm_medium=email&utm_source=footer>. > > > -- > -Siddhesh. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/C7C0ED08-7809-47DC-9B4F-3D91E827D7F4%40ix.netcom.com.