* Avoid opening browser when not in terminal
This also reverts e82ee9a, though only in spirit since the revert
did not apply cleanly.
This change may look cosmetic, but note that `plugin.UI` can be
passed in from the outside. This is important for embedding pprof
into an application for easy access to the web ui: with this change,
such an application can pass a non-Terminal `profile.UI` and avoids
the browser code.
* Allow passing in a custom HTTPServer
This allows embedding the pprof ui into an existing application.
See https://github.com/cockroachdb/cockroach/pull/24145 for an example.
* Add tests for source file searching.
* Fix slash handling in tests on Windows.
* Fix test cleanup, it was leaving stale files.
* Fix number of args in Fatalf call
internal/driver: suggest sample_index in case empty default samples (#336)
In the interactive mode, inform users of different sample types
if the profile includes zero samples for selected sample type
by default (or through user-provided sample_index flag value).
The example output may look like
$ pprof mem.prof
Type: inuse_space
Time: Mar 20, 2018 at 11:36am (EDT)
No samples were found with the default sample value type.
Try "sample_index" command to analyze different sample values.
Entering interactive mode (type "help" for commands, "o" for options)
(pprof)
Update golang/go#24443
Update perf_to_profile cli arguments to use flags. (#277) (#332)
Update perf_to_profile cli arguments to use flags. (#277)
Fixes #277
As perf_to_profile uses flags to parse its arguments, modify the call to perf_to_profile to use flags. Also pass the '-f' flag to overwrite the existing output profile file.
Redirect perf_to_profile's stdout/stderr to pprof's stdout/stderr.
Set base address on OSX.
This fixes issue #311. The mapped address of libraries was never considered, nor was the load address of the segments. It also fixes a couple of issues in binutils.go, such as when the tail of the data wasn't handled right when grouping symbols at the same address.
Pass text segment info to GetBase to handle Linux kernel ASLR case. (#299)
When pprof symbolizes kernel addresses in vmlinux binary for a profile
converted using https://github.com/google/perf_data_converter, the
addresses need to be adjusted if kernel ASLR is in effect. So far the
call to GetBase did not pass text segment info to GetBase which
shortcircuited the code to merely return zero adjustment. This change
fixes the call to GetBase to address that.
The added test case is a simulation of what happens with vmlinux, but it
should be pretty close. Including a vmlinux file into the test data does
not appear practical due to the binary size. I verified that the test
failed before the fix and passes after.
Note that the fixed issue is specific to the kernel ASLR as user-mode
ASRL-enabled binaries (i.e. built with -pie / -fpie) have ET_DYN type
which takes a different code path in GetBase which did not have issues
before this fix in practice.
internal/driver: fix new unkeyed composite lit vet warnings (#298)
The current version of go vet does not flag these as noted in
golang/go#23539. A fix is in the works, and will likely be included in
Go 1.11. Make the updated vet tool happy, so that the vendored copy of
pprof in the Go tree can be updated and make the vet trybot happy.
Fixes #297.
* Support parsing of is_folded bit
* Include folded bit lin (*Location).string() and in profile mergining
* address comments
* Set IsFolded to false during symbolization when Line is reset
* simplify tests
internal/driver: ignore temp dir error on Android (#295)
On an instance of the Android emulator running x86_64, $HOME points
to / which is not writable. Add Android to the list of GOOS where
the temp dir error is skipped.
Fixes the android/amd64 and android/386 builders on build.golang.org.
Keep refine menu enabled for views other than graph. (#286)
Pull request #263 disabled the refine menu for any views other than
Graph, but that's not expected - it's perfectly fine to use it for Flame
and Top, so just keep it enabled.
Fixes #285.
Update svgpan, add license, separate pprof-specific code. (#284)
The third_party svg directory has been a mix of pprof-specific code and
svgpan itself. This change moves the pprof-specific code out and adds a
license file. It also updates svgpan to 1.2.2 from
https://github.com/aleofreddi/svgpan while we are here. It also renames
the directory to svgpan to have all directories under third_party be
named precisely over the third party package they hold.
Update the web user interface aesthetically (#263)
Update the web user interface aesthetically.
The Refine menu is greyed-out for pages besides the Graph.
The description box now opens upon clicking the filename in the top-right.
* Handle "listen hungup" error on Plan 9 in TestHttpsInsecure
Plan 9 returns the "listen hungup" error when closing a closed listener.
See https://github.com/0intro/plan9/blob/4225c3e/sys/src/9/ip/devip.c#L476
Fixes #253.
* Handle empty profile on Plan 9 in TestHttpsInsecure
CPU profiling isn't implemented on Plan 9.
See golang.org/issues/22564.
Fixes #253.