Merge tag 'armsoc-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[linux-2.6-block.git] / tools / perf / builtin-timechart.c
index f3bb1a4bf060c4a6ad2347f7f40b321916669533..e50fe1187b0ba2ca808f6c0a0d3effd8156b4982 100644 (file)
@@ -67,6 +67,7 @@ struct timechart {
                                skip_eagain;
        u64                     min_time,
                                merge_dist;
+       bool                    force;
 };
 
 struct per_pidcomm;
@@ -1598,6 +1599,7 @@ static int __cmd_timechart(struct timechart *tchart, const char *output_name)
        struct perf_data_file file = {
                .path = input_name,
                .mode = PERF_DATA_MODE_READ,
+               .force = tchart->force,
        };
 
        struct perf_session *session = perf_session__new(&file, false,
@@ -1623,7 +1625,7 @@ static int __cmd_timechart(struct timechart *tchart, const char *output_name)
                goto out_delete;
        }
 
-       ret = perf_session__process_events(session, &tchart->tool);
+       ret = perf_session__process_events(session);
        if (ret)
                goto out_delete;
 
@@ -1956,9 +1958,11 @@ int cmd_timechart(int argc, const char **argv,
        OPT_CALLBACK(0, "io-merge-dist", &tchart.merge_dist, "time",
                     "merge events that are merge-dist us apart",
                     parse_time),
+       OPT_BOOLEAN('f', "force", &tchart.force, "don't complain, do it"),
        OPT_END()
        };
-       const char * const timechart_usage[] = {
+       const char * const timechart_subcommands[] = { "record", NULL };
+       const char *timechart_usage[] = {
                "perf timechart [<options>] {record}",
                NULL
        };
@@ -1976,8 +1980,8 @@ int cmd_timechart(int argc, const char **argv,
                "perf timechart record [<options>]",
                NULL
        };
-       argc = parse_options(argc, argv, timechart_options, timechart_usage,
-                       PARSE_OPT_STOP_AT_NON_OPTION);
+       argc = parse_options_subcommand(argc, argv, timechart_options, timechart_subcommands,
+                       timechart_usage, PARSE_OPT_STOP_AT_NON_OPTION);
 
        if (tchart.power_only && tchart.tasks_only) {
                pr_err("-P and -T options cannot be used at the same time.\n");