diff options
author | Bert Maher <bertrand@fb.com> | 2014-10-24 21:09:42 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2014-12-15 01:12:20 (GMT) |
commit | b4acf7300a4ca3423ca36fe227e9bc2e23f25b9f (patch) | |
tree | 2bed41fc29a8e9420d7eaad5a6433c64d444544f /bin/pprof | |
parent | 2c5cb613dfbdf58f88152321b63e60c58cd23972 (diff) | |
download | jemalloc-b4acf7300a4ca3423ca36fe227e9bc2e23f25b9f.zip jemalloc-b4acf7300a4ca3423ca36fe227e9bc2e23f25b9f.tar.gz jemalloc-b4acf7300a4ca3423ca36fe227e9bc2e23f25b9f.tar.bz2 |
[pprof] Produce global profile unless thread-local profile requested
Currently pprof will print output for all threads if a single thread is not
specified, but this doesn't play well with many output formats (e.g., any of
the dot-based formats). Instead, default to printing just the overall profile
when no specific thread is requested.
This resolves #157.
Diffstat (limited to 'bin/pprof')
-rwxr-xr-x | bin/pprof | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -404,7 +404,7 @@ sub Init() { "edgefraction=f" => \$main::opt_edgefraction, "maxdegree=i" => \$main::opt_maxdegree, "focus=s" => \$main::opt_focus, - "thread=i" => \$main::opt_thread, + "thread=s" => \$main::opt_thread, "ignore=s" => \$main::opt_ignore, "scale=i" => \$main::opt_scale, "heapcheck" => \$main::opt_heapcheck, @@ -707,7 +707,8 @@ sub Main() { } if (defined($data->{threads})) { foreach my $thread (sort { $a <=> $b } keys(%{$data->{threads}})) { - if (!defined($main::opt_thread) || $main::opt_thread == $thread) { + if (defined($main::opt_thread) && + ($main::opt_thread eq '*' || $main::opt_thread == $thread)) { my $thread_profile = $data->{threads}{$thread}; FilterAndPrint($thread_profile, $symbols, $libs, $thread); } |