Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1429458

[PATCH v10 09/10] perf tools: Don't warn about out of order event if write_backward is used

From Wang Nan <wangnan0@huawei.com>
Newsgroups linux.kernel
Subject [PATCH v10 09/10] perf tools: Don't warn about out of order event if write_backward is used
Date 2016-06-23 07:30 +0200
Message-ID <rN5nc-5t9-17@gated-at.bofh.it> (permalink)
References <rN5nb-5t9-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


If write_backward attribute is set, records are written into kernel
ring buffer from end to beginning, but read from beginning to end.
To avoid 'XX out of order events recorded' warning message (timestamps
of records is in reverse order when using write_backward), suppress the
warning message if write_backward is selected by at lease one event.

Result:

Before this patch:
 # perf record -m 1 -e raw_syscalls:sys_exit/overwrite/ \
                    -e raw_syscalls:sys_enter \
                    dd if=/dev/zero of=/dev/null count=300
 300+0 records in
 300+0 records out
 153600 bytes (154 kB) copied, 0.000601617 s, 255 MB/s
 [ perf record: Woken up 5 times to write data ]
 Warning:
 40 out of order events recorded.
 [ perf record: Captured and wrote 0.096 MB perf.data (696 samples) ]

After this patch:
 # perf record -m 1 -e raw_syscalls:sys_exit/overwrite/ \
                    -e raw_syscalls:sys_enter \
                    dd if=/dev/zero of=/dev/null count=300
 300+0 records in
 300+0 records out
 153600 bytes (154 kB) copied, 0.000644873 s, 238 MB/s
 [ perf record: Woken up 5 times to write data ]
 [ perf record: Captured and wrote 0.096 MB perf.data (696 samples) ]

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: He Kuang <hekuang@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
---
 tools/perf/util/session.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 43be0c5..0d19530 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1499,10 +1499,27 @@ int perf_session__register_idle_thread(struct perf_session *session)
 	return err;
 }
 
+static void
+perf_session__warn_order(const struct perf_session *session)
+{
+	const struct ordered_events *oe = &session->ordered_events;
+	struct perf_evsel *evsel;
+	bool should_warn = true;
+
+	evlist__for_each(session->evlist, evsel) {
+		if (evsel->attr.write_backward)
+			should_warn = false;
+	}
+
+	if (!should_warn)
+		return;
+	if (oe->nr_unordered_events != 0)
+		ui__warning("%u out of order events recorded.\n", oe->nr_unordered_events);
+}
+
 static void perf_session__warn_about_errors(const struct perf_session *session)
 {
 	const struct events_stats *stats = &session->evlist->stats;
-	const struct ordered_events *oe = &session->ordered_events;
 
 	if (session->tool->lost == perf_event__process_lost &&
 	    stats->nr_events[PERF_RECORD_LOST] != 0) {
@@ -1559,8 +1576,7 @@ static void perf_session__warn_about_errors(const struct perf_session *session)
 			    stats->nr_unprocessable_samples);
 	}
 
-	if (oe->nr_unordered_events != 0)
-		ui__warning("%u out of order events recorded.\n", oe->nr_unordered_events);
+	perf_session__warn_order(session);
 
 	events_stats__auxtrace_error_warn(stats);
 
-- 
1.8.3.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v10 00/10] perf tools: Support overwritable ring buffer Wang Nan <wangnan0@huawei.com> - 2016-06-23 07:30 +0200
  [PATCH v10 07/10] perf record: Read from overwritable ring buffer Wang Nan <wangnan0@huawei.com> - 2016-06-23 07:30 +0200
    Re: [PATCH v10 07/10] perf record: Read from overwritable ring buffer Nilay Vaish <nilayvaish@gmail.com> - 2016-06-23 16:30 +0200
      Re: [PATCH v10 07/10] perf record: Read from overwritable ring buffer pi3orama <pi3orama@163.com> - 2016-06-23 16:40 +0200
  [PATCH v10 04/10] perf evlist: Introduce aux evlist Wang Nan <wangnan0@huawei.com> - 2016-06-23 07:30 +0200
    Re: [PATCH v10 04/10] perf evlist: Introduce aux evlist Nilay Vaish <nilayvaish@gmail.com> - 2016-06-23 16:20 +0200
  [PATCH v10 09/10] perf tools: Don't warn about out of order event if write_backward is used Wang Nan <wangnan0@huawei.com> - 2016-06-23 07:30 +0200
  [PATCH v10 10/10] perf tools: Add --tail-synthesize option Wang Nan <wangnan0@huawei.com> - 2016-06-23 07:40 +0200
  [PATCH v10 03/10] perf record: Prepare picking perf_event_mmap_page from multiple evlists Wang Nan <wangnan0@huawei.com> - 2016-06-23 07:40 +0200
  [PATCH v10 06/10] perf record: Introduce rec->overwrite_evlist for overwritable events Wang Nan <wangnan0@huawei.com> - 2016-06-23 07:40 +0200
  [PATCH v10 08/10] perf tools: Enable overwrite settings Wang Nan <wangnan0@huawei.com> - 2016-06-23 07:40 +0200
  [PATCH v10 01/10] perf record: Prepare mmap multiple evlists Wang Nan <wangnan0@huawei.com> - 2016-06-23 07:40 +0200
  [PATCH v10 02/10] perf record: Prepare reading from multiple evlists in record__mmap_read_all() Wang Nan <wangnan0@huawei.com> - 2016-06-23 07:40 +0200
  [PATCH v10 05/10] perf tests: Add testcase for auxiliary evlist Wang Nan <wangnan0@huawei.com> - 2016-06-23 07:40 +0200

csiph-web