FAQ
I am profiling a go server using "go tool pprof" command. I want to
generate a machine-readable call graph using the dynamic profile of my
program. When I run "go tool pprof" with the -tree option, I see this
<https://www.dropbox.com/s/7nfb17q5wosflzx/Screenshot%202015-06-25%2014.32.29.png?dl=0>.
I want precisely this information in a machine readable form. Specifically,
I want to take a profile and generate a graph such that:

    - Nodes are functions
    - Directed edges between nodes represent that one function called another
    - The weight of edges represent the percent of calls from one function
    to another (exactly like the last column in the image above)

I have thought of a few potential options:

    - Parse the string output of "go tool pprof --tree"
    - Copy the code in the cmd/pprof library which generates a graph from a
    dynamic profile

However, I don't love either of these options because they can break in
future versions of go if the pprof reporting format changes. Are there any
alternatives I should consider? For example, could I use the -proto option
to get a protobuf file including the graph?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Russ Cox at Jun 26, 2015 at 4:16 am

    On Thu, Jun 25, 2015 at 5:42 PM, wrote:

    I am profiling a go server using "go tool pprof" command. I want to
    generate a machine-readable call graph using the dynamic profile of my
    program. When I run "go tool pprof" with the -tree option, I see this
    <https://www.dropbox.com/s/7nfb17q5wosflzx/Screenshot%202015-06-25%2014.32.29.png?dl=0>.
    I want precisely this information in a machine readable form. Specifically,
    I want to take a profile and generate a graph such that:

    - Nodes are functions
    - Directed edges between nodes represent that one function called
    another
    - The weight of edges represent the percent of calls from one function
    to another (exactly like the last column in the image above)

    I think I'm missing something. How does this differ from pprof's graph
    output?

    Russ

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Bens at Jun 26, 2015 at 7:44 am
    What do you mean "pprof's graph output"? Do you mean the output from the
    -tree option (the image I attached)? Is there some graph output I am
    missing?
    On Thursday, June 25, 2015 at 9:16:52 PM UTC-7, Russ Cox wrote:
    On Thu, Jun 25, 2015 at 5:42 PM, <be...@uber.com <javascript:>> wrote:

    I am profiling a go server using "go tool pprof" command. I want to
    generate a machine-readable call graph using the dynamic profile of my
    program. When I run "go tool pprof" with the -tree option, I see this
    <https://www.dropbox.com/s/7nfb17q5wosflzx/Screenshot%202015-06-25%2014.32.29.png?dl=0>.
    I want precisely this information in a machine readable form. Specifically,
    I want to take a profile and generate a graph such that:

    - Nodes are functions
    - Directed edges between nodes represent that one function called
    another
    - The weight of edges represent the percent of calls from one
    function to another (exactly like the last column in the image above)

    I think I'm missing something. How does this differ from pprof's graph
    output?

    Russ
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Tamás Gulácsi at Jun 26, 2015 at 8:00 am
    Yes. Read go tool pprof -help. See http://blog.golang.org/profiling-go-programs .

    Pprof has a dot (graphviz) output.

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJun 25, '15 at 10:34p
activeJun 26, '15 at 8:00a
posts4
users3
websitegolang.org

3 users in discussion

Bens: 2 posts Russ Cox: 1 post Tamás Gulácsi: 1 post

People

Translate

site design / logo © 2021 Grokbase