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.
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 support for tag units
Updated tests for adding tag units
* updated proto docs to describe tag units
* fixed formatting
* added additional test
* require specific units for graph tag to be recognixed
* updated tests and formatting
* Fixed formatting
* Fixed style error
* modify proto_test to be sure tag units not overwritten
* Clarified label docs
* call legacy profile memory allocations size, not byte
* updated tests to call bytes tags in legacy profile size
* Revert "updated tests to call bytes tags in legacy profile size"
This reverts commit 9289378af2.
* Revert "call legacy profile memory allocations size, not byte"
This reverts commit 6b18973562.
* Updated so units not modified when profile written out
* Fixed formatting errors
* Removed field for inferred numeric label units from profile
* Modified profile String() output
* fixed formatting error
* changed name of function used to identify units for numeric labels
* Refactor String() for profile
* Modified for clarity and address comments
* renamed function for clarity
* Made numeric label units field seperate in profile
* Modified test
* Refactored identifyNumLabelUnits()
* Updated comments
* Fixed formatting error
* Addressed comments
* Fixed style error
* clarify comment
* Refactored to address comments
* addressed comments
* addressed comments
* addressed comments
* Modified variable type to have []string value
* added repeatableStringKind
* modify repeatableStringKind to actually handle multiple values
* Modify applyFocus to work with multiple values for tagfocus/tagignore
* Modify applyFocus to work with multiple values for tagfocus/tagignore
* Modified CompileTagFilter to handle tag filters of the form -tagfocus=key1=val1
* Modified StringList
* add testing for compileTagFilter
* fixed typo
* fixed code style error
* Revert "fixed code style error"
This reverts commit 0b1826c163.
* Revert "fixed typo"
This reverts commit 2593652bd0.
* Revert "add testing for compileTagFilter"
This reverts commit 152d7b0363.
* Revert "Modified StringList"
This reverts commit b57d35a762.
* Revert "Modified CompileTagFilter to handle tag filters of the form -tagfocus=key1=val1"
This reverts commit ebe1e344bf.
* Revert "Modify applyFocus to work with multiple values for tagfocus/tagignore"
This reverts commit 3b62091b67.
* Revert "Modify applyFocus to work with multiple values for tagfocus/tagignore"
This reverts commit 7172159cd3.
* Revert "modify repeatableStringKind to actually handle multiple values"
This reverts commit abb1e3ec4b.
* Revert "added repeatableStringKind"
This reverts commit 8b8e4e76fc.
* Revert "Modified variable type to have []string value"
This reverts commit 5f213dc4d1.
* added support for filtering by specific tags
* Fixed formatting problems
* Updated variable name for clarity
* Added test cases for tag filtering
* Update tagfocus and tagignore description
* Fixed formatting error
* Updated docs to explain new tag filtering
* Updated docs to clarify tag filtering
* Updated docs to clarify tag filtering
* Updated docs and help comments for tag filtering
* Updated docs for tag filtering
* Update pprof docs for tag filtering
* Update tagfocus and tagignore help descriptions
* Update tagfocus and tagignore descriptions in docs
* Update tagfocus and tagignore descriptions in docs and help
* Updated tagfocus and tagignore descriptions in docs; added TODO for regexp matching
* Updated tagfocus and tagignore descriptions in docs
* Modified docs fo tagfocus for clarity
*: golint, go tool vet, unsued, gosimple, staticcheck (#113)
* `git ls-files -- '*.go' | xargs gofmt -s -w`
* driver: unexport InternalOptions
This was an exported method that returned an internal type, so it's
unlikely that anyone depends on its presence.
* internal/binutils: remove newline in error string
golint reported: error strings should not be capitalized or end with
punctuation or a newline
* internal/driver: s/buildId/buildID/ per golint
* internal/elfexec: remove punctuation in error string
golint reported: error strings should not be capitalized or end with
punctuation or a newline
* internal/graph: correct comment
Found with golint.
* internal/graph: add method comment
golint reported: exported method Edge.WeightValue should have comment
or be unexported
* internal/report: remove newline in error string
golint reported: error strings should not be capitalized or end with
punctuation or a newline
* *: remove unused code
Found with honnef.co/go/tools/cmd/unused:
internal/binutils/disasm_test.go:137:8: const objdump is unused (U1000)
internal/driver/driver_test.go:353:6: type testProfile is unused (U1000)
internal/graph/graph.go:838:6: func countEdges is unused (U1000)
profile/proto.go:148:6: func encodeStringOpt is unused (U1000)
* *: simply code
Found with honnef.co/go/tools/cmd/gosimple:
internal/driver/commands.go:471:24: should omit comparison to bool constant, can be simplified to !b (S1002)
internal/driver/driver.go:163:5: should omit comparison to bool constant, can be simplified to !trim (S1002)
internal/driver/driver.go:168:5: should omit comparison to bool constant, can be simplified to !focus (S1002)
internal/driver/driver.go:172:5: should omit comparison to bool constant, can be simplified to !tagfocus (S1002)
internal/driver/driver.go:176:5: should omit comparison to bool constant, can be simplified to !hide (S1002)
internal/graph/dotgraph.go:213:34: should use make(map[string][]*Tag) instead (S1019)
internal/report/report.go:1061:3: should replace loop with label = append(label, rpt.options.ProfileLabels...) (S1011)
profile/proto.go:157:5: should omit comparison to bool constant, can be simplified to !x (S1002)
* *: correct mistakes
Found with honnef.co/go/tools/cmd/staticcheck:
driver/driver.go:280:20: infinite recursive call (SA5007)
internal/driver/driver_focus.go:54:11: this value of err is never used (SA4006)
profile/proto.go:74:32: x | 0 always equals x (SA4016)
* Add linters to .travis.yml