Is there any dependency on GOPATH while running `./goanalyzer binary
trace-file` ?
Also my goanalyzer is built on mac and am trying to look at trace file
generated on ubuntu (shouldn't be a problem).

./goanalyzer ~/workspace/binary  ~/workspace/trace
2020/09/10 23:27:32 Parsing trace...
2020/09/10 23:27:32 Splitting trace...
2020/09/10 23:27:32 Opening browser. Trace viewer is listening on
http://127.0.0.1:55520

If I try to go to a particular go routing eg
http://127.0.0.1:55520/trace?goid=9084 I see nothing on the browser.

Clicking on any of the graphs for a goroutine says the following.

failed to execute go tool pprof: exit status 1
failed to execute dot. Is Graphviz installed? Error: exec: "dot":
executable file not found in $PATH


On Thu, Sep 10, 2020 at 4:49 PM robert engels <reng...@ix.netcom.com> wrote:

> 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>
> 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>
>> 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.
>> 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.
>
>
>

-- 
-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/CAMjfk%2Bh%2BxrRr9PqoZEAsjv-QVJOi8pzP4gk7VUFfnfXw-Je51Q%40mail.gmail.com.

Reply via email to