Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No warning if filter argument has no matches. #629

Closed
prattmic opened this issue May 11, 2021 · 0 comments · Fixed by #631
Closed

No warning if filter argument has no matches. #629

prattmic opened this issue May 11, 2021 · 0 comments · Fixed by #631

Comments

@prattmic
Copy link
Member

Please answer these questions before submitting your issue. Thanks!

What version of pprof are you using?

If you are using pprof via go tool pprof, what's your go env output?
If you run pprof from GitHub, what's the Git revision?

923b5ab (latest HEAD)

What operating system and processor architecture are you using?

Linux, amd64

What did you do?

If possible, provide a recipe for reproducing the error.
Attaching a profile you are trying to analyze is good.

Attempt to disasm, list, peek a symbol that doesn't exist.

What did you expect to see?

An explanation that there are no matching symbols. Something like:

$ ./pprof /tmp/cpu.pprof
File: runtime.test
Type: cpu
Time: May 11, 2021 at 12:26pm (EDT)
Duration: 12.01s, Total samples = 36.44s (303.40%)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) disasm blargity
no matches found for regexp: blargity 

What did you see instead?

$ ./pprof /tmp/cpu.pprof
File: runtime.test
Type: cpu
Time: May 11, 2021 at 12:26pm (EDT)
Duration: 12.01s, Total samples = 36.44s (303.40%)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) disasm blargity
Total: 36.44s

To a user that doesn't fully understand this behavior, it is rather confusing to only get a "total" with no other output.

Note that commands with a focus argument do display a warning (in red):

(pprof) top blargity
Focus expression matched no samples
Active filters:
   focus=blargity
Showing nodes accounting for 0, 0% of 36.44s total
      flat  flat%   sum%        cum   cum%

I can send a simple CL to add a warning to the few commands with an argument.

prattmic added a commit to prattmic/pprof that referenced this issue May 11, 2021
list, weblist, disasm, and peek all take a regexp argument that acts as
a filter.

Currently if this filter results in no matches we simply generate an
empty report, which can be confusing to users. Instead, explicitly treat
this as an error condition that is clearly reported to users.

Fixes google#629
prattmic added a commit to prattmic/pprof that referenced this issue Jul 13, 2021
list, weblist, disasm, and peek all take a regexp argument that acts as
a filter.

Currently if this filter results in no matches we simply generate an
empty report, which can be confusing to users. Instead, explicitly treat
this as an error condition that is clearly reported to users.

Fixes google#629
aalexand pushed a commit that referenced this issue Jul 15, 2021
list, weblist, disasm, and peek all take a regexp argument that acts as
a filter.

Currently if this filter results in no matches we simply generate an
empty report, which can be confusing to users. Instead, explicitly treat
this as an error condition that is clearly reported to users.

Fixes #629
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant