settings: Only call MkdirAll on save
Previously settingsFileName() created the ~/.config/pprof directory
if it did not exist. However, this is not possible for user nobody,
since its home directory is set to "/nonexistent". Instead, only
create the directory when we actually attempt to save the file, so
the error will happen at the appropriate interaction. This als
prevents pprof from creating empty settings directories.
Fixes the following error when running pprof's web UI as user nobody:
mkdir /nonexistent: permission denied
Add support for saving the current configuration settings (#535)
Add support for saving the current configuration settings as a named
configuration and reloading such a configuration later.
All of the configurations are stored in a settings file, by default:
~/.config/pprof.json
A struct named config replaces the old map[string]string which used
to store the set of configurable options. Instead, each option is
now a field in the config struct.
The UI now has a new 'Config' menu with
Save as: prompts for a name and saves current config.
Default: applies default config.
$X: for every config named X: applies settings from X.
The currently selected config is highlighted.
Every named config has a delete button to control deletion.
Some semi-related changes:
1. Both filefunctions and functions in the granularity group had an
initial value of true, which is incorrect since these are mutually
incompatible choices. Set filefunctions' initial value to false.
2. Renamed the group for sorting from "cumulative" to "sort".
3. Store testing.T in TestUI instead of leaving the field nil.
profile: change error message to print string representation of wire type (#514)
The proto write type code stored in buffer stores unprintable values
(e.g. 2 when unmarshalling). The desired output when printing an error
message is the string representation of the integer (i.e. strconv.Itoa),
instead of the current behavior string(int) or string(rune), which
return the utf8 literal corresponding to the integer.
As pointed out by @ianlancetaylor in
https://github.com/google/pprof/commit/4ac0da8#commitcomment-37524728, commit
4ac0da8 preserves the previous incorrect behavior to pass a vet check,
whereas this change prints the desired output.
Updates golang/go#32479.
As per the vet check being introduced in 1.15
(https://github.com/golang/go/issues/32479), conversions of the form
string(int) are flagged by go vet. The suggested fix is to instead use
string(rune).
Additionally, since google/pprof is vendored into the go tree, we avoid
test failures from vet flagging this dependency (see
CL https://go-review.googlesource.com/c/go/+/220977).
Make tag filter of the form `-tagfilter=foo=1` work. (#509)
Tag filters like `-tagfilter=foo=1` currently cannot be used to filter
by a unitless numeric tag as the tag filter regular expression expects
the unit part to be always present. They can be made working by using
`-tagfilter=foo=1unit` instead, but that's weird syntax. So fix this by
merely making the unit part optional.
I was wondering if this simple fix could have any unintended effects but
as far as I can tell from testing it does not.
* Add go.mod/go.sum
* travis: update to test in modules mode and with go1.13
Remove go1.11 setup
* fix appveyor config
AppVeyor sets the latest go stack in C:\go and that is GOROOT.
Cloning this repo under C:\go\src\.. directory confused go build
(as discussed in golang/go#34657). The fix in go is not yet
released. Thus this commit changes GOPATH to c:\gopath and clones
the repo under the directory.
Also, this commit removes the go get commands intended to pull in
dependencies. In modules mode, `go build` pulls in the required
dependencies.
webhtml: reenable sort option for flamegraphs (#491)
This sorts flamegraph elements lexographiaclly such that two similar
profiles can be compared side-by-side to eyeball differences in
flamegraph profile shapes and sizes.