Skip to content

Commit

Permalink
perf-plot: Add rust demangle
Browse files Browse the repository at this point in the history
  • Loading branch information
cdown committed May 13, 2024
1 parent 9cde14f commit edf9f45
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/perf-plot
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

: "${SELF:=0}"
: "${ALL_NODES:=0}"
: "${RUST:=0}"

svg_file=$(mktemp --suffix .svg)
perf_file=$(mktemp)
Expand All @@ -17,7 +18,12 @@ extra_args=()
(( ALL_NODES )) && extra_args+=( -n 0.05 -e 0.01 )


perf script -i "$perf_file" | gprof2dot "${extra_args[@]}" --format=perf | dot -Tsvg > "$svg_file"
filter_cmd=cat
if (( RUST )); then
filter_cmd=rustfilt
fi

perf script -i "$perf_file" | "$filter_cmd" | gprof2dot "${extra_args[@]}" --format=perf | dot -Tsvg > "$svg_file"

if (( UID )); then
exec google-chrome-stable "$svg_file"
Expand Down

0 comments on commit edf9f45

Please sign in to comment.