perf report: Add --show-time-info option
Em Mon, Dec 02, 2013 at 11:38:20PM +0900, Namhyung Kim escreveu:
Quoted 6 lines
Hi Arnaldo,
2013-12-02 (월), 09:33 -0300, Arnaldo Carvalho de Melo:
Quoted 3 lines
Em Mon, Dec 02, 2013 at 03:53:19PM +0900, Namhyung Kim escreveu:
Quoted 2 lines
From: Namhyung Kim <[email protected]>
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
The --show-time-info option is for displaying elapsed sampling time
Isn't that too long? Can't we use just --time/-t?
Hmm.. interesting. Your previous feedback was to use longer and clearer option name. :)
Hey, longer and more descriptive names _when required_, in that case I thought that even being longer --show-task-events would be better, but here using --show-time-info the 'info' part looks superfluous, at least to me, hence my suggestion/question :-)
<SNIP>
Quoted 14 lines
Quoted 4 lines
Quoted 4 lines
+++
b/tools/perf/ui/hist.c(quoted diff) +0
-0@@ -7,19 +7,24 @@ #include "../util/evsel.h"Quoted 9 lines
Review line 14
Quoted 6 lines
(quoted diff) +5
-0/* hist period print (hpp) functions */ +enum hpp_fmt_type { + HPP_FMT__PERCENT, + HPP_FMT__RAW, + HPP_FMT__TIME, +};I wonder if we can't make this a bitmask... Does it make sense to print both percent and time, for instance?
Quoted 4 lines
I'm not sure I understood you correctly, but did you mean printing both percent and time in a single column? This enum and the
__hpp_fmt()function is for a single column. I can add a new column for time percent if you want.
I have not delved into the code, it was just a first impression, lemme do that now...
- Arnaldo
Quoted 14 lines · Arnaldo Carvalho de Melo
Em Mon, Dec 02, 2013 at 11:38:20PM +0900, Namhyung Kim escreveu:
Quoted 12 lines
Hi Arnaldo,
2013-12-02 (월), 09:33 -0300, Arnaldo Carvalho de Melo:
Quoted 6 lines
Em Mon, Dec 02, 2013 at 03:53:19PM +0900, Namhyung Kim escreveu:
Quoted 3 lines
From: Namhyung Kim <[email protected]>
The --show-time-info option is for displaying elapsed sampling time
Isn't that too long? Can't we use just --time/-t?
Hmm.. interesting. Your previous feedback was to use longer and clearer option name. :)
Quoted 7 lines
Quoted 1 line
Hey, longer and more descriptive names
_whenrequired_, in that case I thought that even being longer --show-task-events would be better, but here using --show-time-info the 'info' part looks superfluous, at least to me, hence my suggestion/question :-)
I thought -t/--time is going to be used to specify a time interval? Collect data for N-seconds, analyze some middle M-seconds.
David
Em Mon, Dec 02, 2013 at 12:25:26PM -0700, David Ahern escreveu:
Quoted 15 lines · Arnaldo Carvalho de Melo
Quoted 13 lines
Em Mon, Dec 02, 2013 at 11:38:20PM +0900, Namhyung Kim escreveu:
Quoted 12 lines
2013-12-02 (월), 09:33 -0300, Arnaldo Carvalho de Melo:
Quoted 6 lines
Em Mon, Dec 02, 2013 at 03:53:19PM +0900, Namhyung Kim escreveu:
Quoted 3 lines
From: Namhyung Kim <[email protected]>
The --show-time-info option is for displaying elapsed sampling time
Isn't that too long? Can't we use just --time/-t?
Hmm.. interesting. Your previous feedback was to use longer and clearer option name. :)
Quoted 7 lines
Quoted 4 lines
Hey, longer and more descriptive names
_whenrequired_, in that case I thought that even being longer --show-task-events would be better, but here using --show-time-info the 'info' part looks superfluous, at least to me, hence my suggestion/question :-)I thought -t/--time is going to be used to specify a time interval? Collect data for N-seconds, analyze some middle M-seconds.
Can you suggest a better name for the option being discussed?
Perhaps one of:
--show-event-time
--event-time
?
As a policy I think we should go on adding just long options and only after there is a really strong case we should use a short option for really, really popular options.
- Arnaldo
Quoted 8 lines · Arnaldo Carvalho de Melo
Can you suggest a better name for the option being discussed?
Perhaps one of:
--show-event-time
--event-time?
Why not just --event-time?
Really should have dropped the 'show' from the recent perf-script change (just --task-events and --mmap-events).
Quoted 4 lines
As a policy I think we should go on adding just long options and only after there is a really strong case we should use a short option for really, really popular options.
And adding options to .perfconfig. Need to use that more.
David
Em Mon, Dec 02, 2013 at 12:58:35PM -0700, David Ahern escreveu:
Quoted 8 lines · Arnaldo Carvalho de Melo
Quoted 6 lines
Can you suggest a better name for the option being discussed?
Perhaps one of:
--show-event-time
--event-time
Quoted 7 lines
Quoted 1 line
?
Why not just --event-time?
Really should have dropped the 'show' from the recent perf-script change (just --task-events and --mmap-events).
Probably, yeah, Ingo made some point about using --show- for some reason, Ingo?
One I can think of is that, in general, plain --feature can mean, at least, one of --enable-feature and --show-feature, so perhaps that is the point.
But then, perhaps that may be implied by the context, i.e. when recording, --feature means enable it, while when reporting, what we're doing is basically _showing_ things, so --feature means just that.
- Arnaldo
Quoted 8 lines
Quoted 4 lines
As a policy I think we should go on adding just long options and only after there is a really strong case we should use a short option for really, really popular options.
And adding options to .perfconfig. Need to use that more.
David
Quoted 10 lines · Arnaldo Carvalho de Melo
Probably, yeah, Ingo made some point about using --show- for some reason, Ingo?
One I can think of is that, in general, plain --feature can mean, at least, one of --enable-feature and --show-feature, so perhaps that is the point.
But then, perhaps that may be implied by the context, i.e. when recording, --feature means enable it, while when reporting, what we're doing is
basically_showing_things, so --feature means just that.
exactly. perf has just --call-graph for both record and report, not enable-call-graph and show-call-graph.
David
Quoted 11 lines · Arnaldo Carvalho de Melo
Em Mon, Dec 02, 2013 at 12:58:35PM -0700, David Ahern escreveu:
Quoted 10 lines · Arnaldo Carvalho de Melo
Quoted 8 lines
Can you suggest a better name for the option being discussed?
Perhaps one of:
--show-event-time
--event-time?
Quoted 8 lines
Quoted 5 lines
Why not just --event-time?
Really should have dropped the 'show' from the recent perf-script change (just --task-events and --mmap-events).
Probably, yeah, Ingo made some point about using --show- for some reason, Ingo?
So the reason for my suggestion was that I've noticed a proliferation of such flags in perf report. To reduce namespace pollution it's always good to bring a certain kind of hierarchy into command line options.
Options that work alike should spell alike. Users shouldn't be required to memorize every naming quirk of the various disjunct 'display this extra data' options.
So if we expect more --show options in the future (and in particular if there are existing oddball options that could be changed to the --show-xyz pattern) then I'd suggest to do it unified. For example there's --show-nr-samples and --show-info already which follows this pattern.
This pattern would distinguish this option from the other perf report options, such as --vmlinux, --force, --sort, etc.
It might even make sense to unify it all into a single --show option. That would allow the following current mismash of options:
--task-events --mmap-events --show-nr-samples --show-info
to be replaced by a much more obvious, much more coherent looking option sequence:
--show task-events,mmap-events,nr-samples,info
an added bonus would be that '--show help' could be implemented as well, to list all displayable extra data.
(I'm not married to the specific naming, it could be something else as well, like --display or --report.)
Or something like that.
Thanks,
Ingo
Em Wed, Dec 04, 2013 at 11:11:17AM +0100, Ingo Molnar escreveu:
Quoted 32 lines · Arnaldo Carvalho de Melo
Quoted 9 lines
Em Mon, Dec 02, 2013 at 12:58:35PM -0700, David Ahern escreveu:
Quoted 5 lines · Arnaldo Carvalho de Melo
Why not just --event-time?
Really should have dropped the 'show' from the recent perf-script change (just --task-events and --mmap-events).
Probably, yeah, Ingo made some point about using --show- for some reason, Ingo?
So the reason for my suggestion was that I've noticed a proliferation of such flags in perf report. To reduce namespace pollution it's always good to bring a certain kind of hierarchy into command line options.
Options that work alike should spell alike. Users shouldn't be required to memorize every naming quirk of the various disjunct 'display this extra data' options.
So if we expect more --show options in the future (and in particular if there are existing oddball options that could be changed to the --show-xyz pattern) then I'd suggest to do it unified. For example there's --show-nr-samples and --show-info already which follows this pattern.
This pattern would distinguish this option from the other perf report options, such as --vmlinux, --force, --sort, etc.
It might even make sense to unify it all into a single --show option. That would allow the following current mismash of options:
Quoted 6 lines
--task-events --mmap-events --show-nr-samples --show-infoto be replaced by a much more obvious, much more coherent looking option sequence:
--show task-events,mmap-events,nr-samples,info
Excellent idea, agreed, we should probably try to implement this as a generic facility to be used accross all the tools.
This, together with the other options processing code should be a natural candidate for a tools/lib/opt/ directory, implemented in the way we discussed: a .a for tools that want all the options processing, but also as untangled as possible so that tools that want just specific bits can chew them individually.
So, in summary, we _will_ be dropping the 'show-' prefix from all those options, and those options as well, that then just become a single (top level) option with entries in a bitmask that are set via some OPT_ callback that receives some struct with a string table and has a bitmask that it will set.
Quoted 2 lines
an added bonus would be that '--show help' could be implemented as well, to list all displayable extra data.
Right, the string table I mentioned in fact should be a struct table that in turn has two strings, the --show bitname and bithelp.
Quoted 2 lines
(I'm not married to the specific naming, it could be something else as well, like --display or --report.)
I think 'show' is ok, 4 letters, shorter than 'display', already used in several places.
- Arnaldo