aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-03-17 10:23:21 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-03-17 10:49:08 -0400
commitf371594a514a4d3bc8fca6913ce9b5d9e325095d (patch)
tree5c308e3444ac8ef4f1f003a2dd0b1efb2bfeae72
parentb40e36121e23031f1e8916a70110ffc841230670 (diff)
perf timechart: Use OPT_PARENT for common options
Move -T/--tasks-only and -P/--power-only options to a separate options array that then gets referenced via OPT_PARENT from the 'perf timechart' and 'perf timechart record' option arrays. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Changbin Du <changbin.du@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-j80lol9wj1i6556ibh48iebe@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-timechart.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index e7eaa298d34a..fbd7c6c695b8 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -1933,6 +1933,11 @@ int cmd_timechart(int argc, const char **argv,
1933 .merge_dist = 1000, 1933 .merge_dist = 1000,
1934 }; 1934 };
1935 const char *output_name = "output.svg"; 1935 const char *output_name = "output.svg";
1936 const struct option timechart_common_options[] = {
1937 OPT_BOOLEAN('P', "power-only", &tchart.power_only, "output power data only"),
1938 OPT_BOOLEAN('T', "tasks-only", &tchart.tasks_only, "output processes data only"),
1939 OPT_END()
1940 };
1936 const struct option timechart_options[] = { 1941 const struct option timechart_options[] = {
1937 OPT_STRING('i', "input", &input_name, "file", "input file name"), 1942 OPT_STRING('i', "input", &input_name, "file", "input file name"),
1938 OPT_STRING('o', "output", &output_name, "file", "output file name"), 1943 OPT_STRING('o', "output", &output_name, "file", "output file name"),
@@ -1940,9 +1945,6 @@ int cmd_timechart(int argc, const char **argv,
1940 OPT_CALLBACK(0, "highlight", NULL, "duration or task name", 1945 OPT_CALLBACK(0, "highlight", NULL, "duration or task name",
1941 "highlight tasks. Pass duration in ns or process name.", 1946 "highlight tasks. Pass duration in ns or process name.",
1942 parse_highlight), 1947 parse_highlight),
1943 OPT_BOOLEAN('P', "power-only", &tchart.power_only, "output power data only"),
1944 OPT_BOOLEAN('T', "tasks-only", &tchart.tasks_only,
1945 "output processes data only"),
1946 OPT_CALLBACK('p', "process", NULL, "process", 1948 OPT_CALLBACK('p', "process", NULL, "process",
1947 "process selector. Pass a pid or process name.", 1949 "process selector. Pass a pid or process name.",
1948 parse_process), 1950 parse_process),
@@ -1962,22 +1964,18 @@ int cmd_timechart(int argc, const char **argv,
1962 "merge events that are merge-dist us apart", 1964 "merge events that are merge-dist us apart",
1963 parse_time), 1965 parse_time),
1964 OPT_BOOLEAN('f', "force", &tchart.force, "don't complain, do it"), 1966 OPT_BOOLEAN('f', "force", &tchart.force, "don't complain, do it"),
1965 OPT_END() 1967 OPT_PARENT(timechart_common_options),
1966 }; 1968 };
1967 const char * const timechart_subcommands[] = { "record", NULL }; 1969 const char * const timechart_subcommands[] = { "record", NULL };
1968 const char *timechart_usage[] = { 1970 const char *timechart_usage[] = {
1969 "perf timechart [<options>] {record}", 1971 "perf timechart [<options>] {record}",
1970 NULL 1972 NULL
1971 }; 1973 };
1972
1973 const struct option timechart_record_options[] = { 1974 const struct option timechart_record_options[] = {
1974 OPT_BOOLEAN('P', "power-only", &tchart.power_only, "output power data only"),
1975 OPT_BOOLEAN('T', "tasks-only", &tchart.tasks_only,
1976 "output processes data only"),
1977 OPT_BOOLEAN('I', "io-only", &tchart.io_only, 1975 OPT_BOOLEAN('I', "io-only", &tchart.io_only,
1978 "record only IO data"), 1976 "record only IO data"),
1979 OPT_BOOLEAN('g', "callchain", &tchart.with_backtrace, "record callchain"), 1977 OPT_BOOLEAN('g', "callchain", &tchart.with_backtrace, "record callchain"),
1980 OPT_END() 1978 OPT_PARENT(timechart_common_options),
1981 }; 1979 };
1982 const char * const timechart_record_usage[] = { 1980 const char * const timechart_record_usage[] = {
1983 "perf timechart record [<options>]", 1981 "perf timechart record [<options>]",