perf tools: make -C consistent across commands (for cpu list arg)
PATCH 1/1 perf tools: make -C consistent across commands (for cpu list arg)
Currently the meaning of -C varies by perf command: for perf-top, perf-stat, perf-record it means cpu list. For perf-report it means comm list. Then perf-annotate, perf-report and perf-script use -c for cpu list.
Fix annotate, report and script to use -C for cpu list to be consistent with top, stat and record. This means report needs to use -c for comm list which does introduce a backward compatibility change.
--- tools/perf/Documentation/perf-annotate.txt | 2 +- tools/perf/Documentation/perf-report.txt | 4 ++-- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-report.c | 4 ++-- tools/perf/builtin-script.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-)
tools/perf/Documentation/perf-annotate.txt +1 -1
@@ -66,7 +66,7 @@ OPTIONS used. This interfaces starts by centering on the line with more samples, TAB/UNTAB cycles through the lines with more samples. --c:: +-C:: --cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can be provided as a comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. Default is to report samples on all
tools/perf/Documentation/perf-report.txt +2 -2
@@ -39,7 +39,7 @@ OPTIONS -T:: --threads:: Show per-thread event counters --C:: +-c:: --comms=:: Only consider symbols in these comms. CSV that understands file://filename entries.
@@ -128,7 +128,7 @@ OPTIONS --symfs=<directory>:: Look for files with symbols relative to this directory. --c:: +-C:: --cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can be provided as a comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. Default is to report samples on all
tools/perf/builtin-annotate.c +1 -1
@@ -269,7 +269,7 @@ static const struct option options[] = { "print matching source lines (may be slow)"),OPT_BOOLEAN ('P' ,"full-paths" , &full_paths,"Don't shorten the displayed pathnames" ), -OPT_STRING ('c' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ), +OPT_STRING ('C' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ),OPT_STRING (0 ,"symfs" , &symbol_conf.symfs,"directory" ,"Look for files with symbols relative to this directory" ), OPT_BOOLEAN(0, "source", &symbol_conf.annotate_src,
tools/perf/builtin-report.c +2 -2
@@ -474,7 +474,7 @@ static const struct option options[] = {OPT_BOOLEAN ('G' ,"inverted" , &inverted_callchain,"alias for inverted call graph" ),OPT_STRING ('d' ,"dsos" , &symbol_conf.dso_list_str,"dso[,dso...]" ,"only consider symbols in these dsos" ), -OPT_STRING ('C' ,"comms" , &symbol_conf.comm_list_str,"comm[,comm...]" , +OPT_STRING ('c' ,"comms" , &symbol_conf.comm_list_str,"comm[,comm...]" ,"only consider symbols in these comms" ),OPT_STRING ('S' ,"symbols" , &symbol_conf.sym_list_str,"symbol[,symbol...]" , "only consider these symbols"),
@@ -488,7 +488,7 @@ static const struct option options[] = { "Only display entries resolved to a symbol"),OPT_STRING (0 ,"symfs" , &symbol_conf.symfs,"directory" ,"Look for files with symbols relative to this directory" ), -OPT_STRING ('c' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ), +OPT_STRING ('C' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ),OPT_BOOLEAN ('I' ,"show-info" , &show_full_info,"Display extended information about perf.data file" ), OPT_BOOLEAN(0, "source", &symbol_conf.annotate_src,
tools/perf/builtin-script.c +1 -1
@@ -1083,7 +1083,7 @@ static const struct option options[] = {OPT_CALLBACK ('f' ,"fields" ,NULL ,"str" ,"comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace,raw. Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,addr" , parse_output_fields), -OPT_STRING ('c' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ), +OPT_STRING ('C' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ),OPT_BOOLEAN ('I' ,"show-info" , &show_full_info,"display extended information from perf.data file" ),OPT_END ()
Signature · 1 line
1.7.7.1
Disregard this version; forgot to save the script documentation file before committing.
Quoted 102 lines · David Ahern
Currently the meaning of -C varies by perf command: for perf-top, perf-stat, perf-record it means cpu list. For perf-report it means comm list. Then perf-annotate, perf-report and perf-script use -c for cpu list.
Fix annotate, report and script to use -C for cpu list to be consistent with top, stat and record. This means report needs to use -c for comm list which does introduce a backward compatibility change.
Signed-off-by David Ahern <[email protected]>--- tools/perf/Documentation/perf-annotate.txt | 2 +- tools/perf/Documentation/perf-report.txt | 4 ++-- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-report.c | 4 ++-- tools/perf/builtin-script.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-)tools/perf/Documentation/perf-annotate.txt +1
-1@@ -66,7 +66,7 @@ OPTIONS used. This interfaces starts by centering on the line with more samples, TAB/UNTAB cycles through the lines with more samples. --c:: +-C:: --cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can be provided as a comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. Default is to report samples on alltools/perf/Documentation/perf-report.txt +2
-2@@ -39,7 +39,7 @@ OPTIONS -T:: --threads:: Show per-thread event counters --C:: +-c:: --comms=:: Only consider symbols in these comms. CSV that understands file://filename entries.@@ -128,7 +128,7 @@ OPTIONS --symfs=<directory>:: Look for files with symbols relative to this directory. --c:: +-C:: --cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can be provided as a comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. Default is to report samples on alltools/perf/builtin-annotate.c +1
-1@@ -269,7 +269,7 @@ static const struct option options[] = { "print matching source lines (may be slow)"),OPT_BOOLEAN ('P' ,"full-paths" , &full_paths,"Don't shorten the displayed pathnames" ), -OPT_STRING ('c' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ), +OPT_STRING ('C' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ),OPT_STRING (0 ,"symfs" , &symbol_conf.symfs,"directory" ,"Look for files with symbols relative to this directory" ), OPT_BOOLEAN(0, "source", &symbol_conf.annotate_src,tools/perf/builtin-report.c +2
-2@@ -474,7 +474,7 @@ static const struct option options[] = {OPT_BOOLEAN ('G' ,"inverted" , &inverted_callchain,"alias for inverted call graph" ),OPT_STRING ('d' ,"dsos" , &symbol_conf.dso_list_str,"dso[,dso...]" ,"only consider symbols in these dsos" ), -OPT_STRING ('C' ,"comms" , &symbol_conf.comm_list_str,"comm[,comm...]" , +OPT_STRING ('c' ,"comms" , &symbol_conf.comm_list_str,"comm[,comm...]" ,"only consider symbols in these comms" ),OPT_STRING ('S' ,"symbols" , &symbol_conf.sym_list_str,"symbol[,symbol...]" , "only consider these symbols"),@@ -488,7 +488,7 @@ static const struct option options[] = { "Only display entries resolved to a symbol"),OPT_STRING (0 ,"symfs" , &symbol_conf.symfs,"directory" ,"Look for files with symbols relative to this directory" ), -OPT_STRING ('c' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ), +OPT_STRING ('C' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ),OPT_BOOLEAN ('I' ,"show-info" , &show_full_info,"Display extended information about perf.data file" ), OPT_BOOLEAN(0, "source", &symbol_conf.annotate_src,tools/perf/builtin-script.c +1
-1@@ -1083,7 +1083,7 @@ static const struct option options[] = {OPT_CALLBACK ('f' ,"fields" ,NULL ,"str" ,"comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace,raw. Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,addr" , parse_output_fields), -OPT_STRING ('c' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ), +OPT_STRING ('C' ,"cpu" , &cpu_list,"cpu" ,"list of cpus to profile" ),OPT_BOOLEAN ('I' ,"show-info" , &show_full_info,"display extended information from perf.data file" ),OPT_END ()