Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PProf fails to build dot graph if name contains " #30

Open
NHDaly opened this issue Oct 3, 2020 · 0 comments · Fixed by google/pprof#564
Open

PProf fails to build dot graph if name contains " #30

NHDaly opened this issue Oct 3, 2020 · 0 comments · Fixed by google/pprof#564

Comments

@NHDaly
Copy link
Member

NHDaly commented Oct 3, 2020

For example:

julia> function var"#fo\"o#"()
           peakflops()
       end
#fo"o# (generic function with 1 method)

julia> var"#fo\"o#"()
1.8314014985396976e11

julia> Profile.clear()

julia> @profile var"#fo\"o#"()
1.7486120937946786e11

julia> pprof(out="var", webport=2232)
[ Info: Writing output to var.pb.gz
"var.pb.gz"

julia> Main binary filename not available.
Serving web UI on http://localhost:2232
Error: <stdin>: syntax error in line 39 near 'N37'
Failed to execute dot. Is Graphviz installed?
exit status 1
Error: <stdin>: syntax error in line 39 near 'N37'
Failed to execute dot. Is Graphviz installed?
exit status 1

By dumping the dot file, you can see the mistake: pprof itself is not escaping the name correctly:

julia> PProf.pprof_jll.pprof() do _
           io = IOBuffer()
           run(pipeline(`pprof -dot var.pb.gz`, stdout=io))
           write("profile.dot", String(take!(io)))
       end
N35 [label="LinearAlgebra\npeakflops##kw\n0 of 47 (47.00%)" id="node35" fontsize=8 shape=box tooltip="LinearAlgebra.peakflops##kw (47)" color="#b22400" fillcolor="#eddad5"]
N36 [label="Main\n#fo"o#\n0 of 47 (47.00%)" id="node36" fontsize=8 shape=box tooltip="Main.#fo"o# (47)" color="#b22400" fillcolor="#eddad5"]
N37 [label="REPL\n#run_repl#41\n0 of 47 (47.00%)" id="node37" fontsize=8 shape=box tooltip="REPL.#run_repl#41 (47)" color="#b22400" fillcolor="#eddad5"]

I'm going to open a PR against pprof to fix this. But if it stalls, we may want to escape the names we provide to the proto, but it's annoying because then they print ugly (and incorrectly) in the flamegraph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant