summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2014-06-12 09:50:11 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-08-12 12:03:02 -0300
commitb0a45203a75a800015828ac89f2945981019b65b (patch)
tree18e559b95f140ac387bb35f9b00f0df8ee9c58a6 /tools/perf/util/session.c
parentcee3ab9caa7ae5ee81027e60c0109063664d9217 (diff)
downloadop-kernel-dev-b0a45203a75a800015828ac89f2945981019b65b.zip
op-kernel-dev-b0a45203a75a800015828ac89f2945981019b65b.tar.gz
perf tools: Allow out of order messages in forced flush
In forced flush (OE_FLUSH__HALF) we break the rules of the flush timestamp via PERF_RECORD_FINISHED_ROUND event, so we could get out of order event. Do not force error in this case plus changing the output warning to use WARN_ONCE. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: David Ahern <dsahern@gmail.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jean Pihet <jean.pihet@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-8q8794a8nlmpd1u8xrqmcyd2@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 462be27..7e27f1e 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -14,6 +14,7 @@
#include "util.h"
#include "cpumap.h"
#include "perf_regs.h"
+#include "asm/bug.h"
static int perf_session__open(struct perf_session *session)
{
@@ -500,10 +501,15 @@ int perf_session_queue_event(struct perf_session *s, union perf_event *event,
return -ETIME;
if (timestamp < oe->last_flush) {
- printf("Warning: Timestamp below last timeslice flush\n");
+ WARN_ONCE(1, "Timestamp below last timeslice flush\n");
+
pr_oe_time(timestamp, "out of order event");
- pr_oe_time(oe->last_flush, "last flush");
- return -EINVAL;
+ pr_oe_time(oe->last_flush, "last flush, last_flush_type %d\n",
+ oe->last_flush_type);
+
+ /* We could get out of order messages after forced flush. */
+ if (oe->last_flush_type != OE_FLUSH__HALF)
+ return -EINVAL;
}
new = ordered_events__new(oe, timestamp);
OpenPOWER on IntegriCloud