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 '-noinlines' a separate flag, introduce '-filefunctions' granularity. (#420)
This change consists of two relatively independent parts, but they are
both about handling the granularity, so bundling them together.
First, in #415 there is a discussion that having a granularity mode by
source lines but with inlines hidden would be useful. The agreement is
also that adding `-linenoinlines` granularity would make the granularity
flags too messy (and they are already somewhat messy with `-addresses`
and `-addressnoinlines`. So, it was proposed to make `-noinlines` a
separate flag, which is what this change does. Note that the flag is now
pulled out of the granularity group so it's a bit of backward
incompatible change but I think it is acceptable. For the example in
issue #415 the user would now be able to specify `-list foo -noinlines`
to produce annotated source where the metrics from the inlined functions
are attributed to the calling inliner line.
With this change, I am also dropping the `-addressnoinlines` granularity
which is now supported as `-addresses -noinlines` combination. I
couldn't find any usage of this option at least internally at Google, so
I think it's safe to remove it.
Second, I am adding a separate `-filefunctions` granularity which groups
the data by both function and file. This is a follow-up to #110 from the
past where we changed the `-functions` granularity to not group by file
(it used to), and since then there was a couple of reports where using
just function name alone would over-aggregate the data in cases when a
function with the same name is contained in multiple source files (e.g.
see b/18874275 internally).
Also, make a number of assorted documentation and `-help` fixes.
* 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
* Added an interactive web interface triggered by passing -http=port
on the command line. The interface is available by visiting
localhost:port in a browser.
Requirements:
* Graphviz must be installed.
* Browser must support Javascript.
* Tested in recent stable versions of chrome and firefox.
Features:
* The entry point is a dot graph display (equivalent to "web" output).
* Nodes in the graph can be selected by clicking.
* A regular expression can also be typed in for selection.
* The current selection (either list of nodes or a regexp)
can be focused, ignored, or hidden.
* Source code or disassembly of the current selection can be displayed.
* Remove unused function.
* Skip graph generation test if graphviz is not installed.
* Added -http port and the various modes of using pprof to the
usage message.
* Web interface now supports "show" option.
* Web interface automatically opens the browser pointed at
the page corresponding to command line arguments.
* Some tweaks for firefox.
* Handle review comments (better usage message, more testing).
* Handled review comments:
1. Capture and display errors like "Focus expression matched no samples".
2. Re-ordered buttons to match other interfaces.
3. Use UI.PrintErr to print error messages.
* Handle javascript code review comments (a bunch of cleanups).
Also added pprof binary to .gitignore.