]>
Commit | Line | Data |
---|---|---|
5bdb2afd GKH |
1 | From f61ff6c06dc8f32c7036013ad802c899ec590607 Mon Sep 17 00:00:00 2001 |
2 | From: Jiri Olsa <jolsa@kernel.org> | |
3 | Date: Wed, 26 Nov 2014 16:39:31 +0100 | |
4 | Subject: perf session: Do not fail on processing out of order event | |
5 | ||
6 | From: Jiri Olsa <jolsa@kernel.org> | |
7 | ||
8 | commit f61ff6c06dc8f32c7036013ad802c899ec590607 upstream. | |
9 | ||
10 | Linus reported perf report command being interrupted due to processing | |
11 | of 'out of order' event, with following error: | |
12 | ||
13 | Timestamp below last timeslice flush | |
14 | 0x5733a8 [0x28]: failed to process type: 3 | |
15 | ||
16 | I could reproduce the issue and in my case it was caused by one CPU | |
17 | (mmap) being behind during record and userspace mmap reader seeing the | |
18 | data after other CPUs data were already stored. | |
19 | ||
20 | This is expected under some circumstances because we need to limit the | |
21 | number of events that we queue for reordering when we receive a | |
22 | PERF_RECORD_FINISHED_ROUND or when we force flush due to memory | |
23 | pressure. | |
24 | ||
25 | Reported-by: Linus Torvalds <torvalds@linux-foundation.org> | |
26 | Signed-off-by: Jiri Olsa <jolsa@kernel.org> | |
27 | Acked-by: Ingo Molnar <mingo@kernel.org> | |
28 | Cc: Andi Kleen <ak@linux.intel.com> | |
29 | Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> | |
30 | Cc: David Ahern <dsahern@gmail.com> | |
31 | Cc: Frederic Weisbecker <fweisbec@gmail.com> | |
32 | Cc: Ingo Molnar <mingo@kernel.org> | |
33 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
34 | Cc: Matt Fleming <matt.fleming@intel.com> | |
35 | Cc: Namhyung Kim <namhyung@kernel.org> | |
36 | Cc: Paul Mackerras <paulus@samba.org> | |
37 | Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> | |
38 | Cc: Stephane Eranian <eranian@google.com> | |
39 | Link: http://lkml.kernel.org/r/1417016371-30249-1-git-send-email-jolsa@kernel.org | |
40 | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> | |
41 | Signed-off-by: Zhiqiang Zhang <zhangzhiqiang.zhang@huawei.com> | |
42 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
43 | ||
44 | --- | |
45 | tools/perf/util/event.h | 1 + | |
46 | tools/perf/util/session.c | 11 +++++------ | |
47 | 2 files changed, 6 insertions(+), 6 deletions(-) | |
48 | ||
49 | --- a/tools/perf/util/event.h | |
50 | +++ b/tools/perf/util/event.h | |
51 | @@ -214,6 +214,7 @@ struct events_stats { | |
52 | u32 nr_invalid_chains; | |
53 | u32 nr_unknown_id; | |
54 | u32 nr_unprocessable_samples; | |
55 | + u32 nr_unordered_events; | |
56 | }; | |
57 | ||
58 | struct attr_event { | |
59 | --- a/tools/perf/util/session.c | |
60 | +++ b/tools/perf/util/session.c | |
61 | @@ -521,15 +521,11 @@ int perf_session_queue_event(struct perf | |
62 | return -ETIME; | |
63 | ||
64 | if (timestamp < oe->last_flush) { | |
65 | - WARN_ONCE(1, "Timestamp below last timeslice flush\n"); | |
66 | - | |
67 | - pr_oe_time(timestamp, "out of order event"); | |
68 | + pr_oe_time(timestamp, "out of order event\n"); | |
69 | pr_oe_time(oe->last_flush, "last flush, last_flush_type %d\n", | |
70 | oe->last_flush_type); | |
71 | ||
72 | - /* We could get out of order messages after forced flush. */ | |
73 | - if (oe->last_flush_type != OE_FLUSH__HALF) | |
74 | - return -EINVAL; | |
75 | + s->stats.nr_unordered_events++; | |
76 | } | |
77 | ||
78 | new = ordered_events__new(oe, timestamp, event); | |
79 | @@ -1057,6 +1053,9 @@ static void perf_session__warn_about_err | |
80 | "Do you have a KVM guest running and not using 'perf kvm'?\n", | |
81 | session->stats.nr_unprocessable_samples); | |
82 | } | |
83 | + | |
84 | + if (session->stats.nr_unordered_events != 0) | |
85 | + ui__warning("%u out of order events recorded.\n", session->stats.nr_unordered_events); | |
86 | } | |
87 | ||
88 | volatile int session_done; |