From: Arnaldo Carvalho de Melo <a...@redhat.com>

To figure out if ordered_events are being used when doing a flush
operation, it is enough to check if there were in fact some events
queued, i.e. look at oe->nr_events.

Cc: Adrian Hunter <adrian.hun...@intel.com>
Cc: Borislav Petkov <b...@suse.de>
Cc: David Ahern <dsah...@gmail.com>
Cc: Don Zickus <dzic...@redhat.com>
Cc: Frederic Weisbecker <fweis...@gmail.com>
Cc: Jiri Olsa <jo...@redhat.com>
Cc: Mike Galbraith <efa...@gmx.de>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Stephane Eranian <eran...@google.com>
Link: http://lkml.kernel.org/n/tip-1c5r404vy766kt5nflv88...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com>
---
 tools/perf/util/ordered-events.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index fd4be94125fb..077ddd25189f 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -166,7 +166,7 @@ static int __ordered_events__flush(struct perf_session *s,
        struct ui_progress prog;
        int ret;
 
-       if (!tool->ordered_events || !limit)
+       if (!limit)
                return 0;
 
        if (show_progress)
@@ -216,6 +216,9 @@ int ordered_events__flush(struct perf_session *s, struct 
perf_tool *tool,
        };
        int err;
 
+       if (oe->nr_events == 0)
+               return 0;
+
        switch (how) {
        case OE_FLUSH__FINAL:
                oe->next_flush = ULLONG_MAX;
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to