Merge tag 'for-f2fs-4.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk...
[firefly-linux-kernel-4.4.55.git] / tools / perf / builtin-inject.c
index a13641e066f5608363c7eb1575f7e3414ae6863a..40a33d7334cce224fb0ac8317554189f1821dfcf 100644 (file)
@@ -53,6 +53,13 @@ static int perf_event__repipe_synth(struct perf_tool *tool,
        return 0;
 }
 
+static int perf_event__repipe_oe_synth(struct perf_tool *tool,
+                                      union perf_event *event,
+                                      struct ordered_events *oe __maybe_unused)
+{
+       return perf_event__repipe_synth(tool, event);
+}
+
 static int perf_event__repipe_op2_synth(struct perf_tool *tool,
                                        union perf_event *event,
                                        struct perf_session *session
@@ -359,8 +366,6 @@ static int __cmd_inject(struct perf_inject *inject)
        } else if (inject->sched_stat) {
                struct perf_evsel *evsel;
 
-               inject->tool.ordered_events = true;
-
                evlist__for_each(session->evlist, evsel) {
                        const char *name = perf_evsel__name(evsel);
 
@@ -379,7 +384,7 @@ static int __cmd_inject(struct perf_inject *inject)
        if (!file_out->is_pipe)
                lseek(fd, session->header.data_offset, SEEK_SET);
 
-       ret = perf_session__process_events(session, &inject->tool);
+       ret = perf_session__process_events(session);
 
        if (!file_out->is_pipe) {
                if (inject->build_ids)
@@ -408,7 +413,7 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
                        .unthrottle     = perf_event__repipe,
                        .attr           = perf_event__repipe_attr,
                        .tracing_data   = perf_event__repipe_op2_synth,
-                       .finished_round = perf_event__repipe_op2_synth,
+                       .finished_round = perf_event__repipe_oe_synth,
                        .build_id       = perf_event__repipe_op2_synth,
                        .id_index       = perf_event__repipe_op2_synth,
                },
@@ -438,6 +443,7 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
                         "be more verbose (show build ids, etc)"),
                OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name, "file",
                           "kallsyms pathname"),
+               OPT_BOOLEAN('f', "force", &file.force, "don't complain, do it"),
                OPT_END()
        };
        const char * const inject_usage[] = {
@@ -458,6 +464,8 @@ int cmd_inject(int argc, const char **argv, const char *prefix __maybe_unused)
                return -1;
        }
 
+       inject.tool.ordered_events = inject.sched_stat;
+
        file.path = inject.input_name;
        inject.session = perf_session__new(&file, true, &inject.tool);
        if (inject.session == NULL)