lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <1464056944-166978-7-git-send-email-wangnan0@huawei.com> Date: Tue, 24 May 2016 02:29:03 +0000 From: Wang Nan <wangnan0@...wei.com> To: <acme@...nel.org> CC: <pi3orama@....com>, <linux-kernel@...r.kernel.org>, Wang Nan <wangnan0@...wei.com>, He Kuang <hekuang@...wei.com>, "Arnaldo Carvalho de Melo" <acme@...hat.com>, Jiri Olsa <jolsa@...nel.org>, Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>, Namhyung Kim <namhyung@...nel.org>, "Zefan Li" <lizefan@...wei.com> Subject: [PATCH v4 6/7] perf tools: Don't warn about out of order event if write_backward is used 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@...wei.com> Signed-off-by: He Kuang <hekuang@...wei.com> Cc: Arnaldo Carvalho de Melo <acme@...hat.com> Cc: Jiri Olsa <jolsa@...nel.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com> Cc: Namhyung Kim <namhyung@...nel.org> Cc: Zefan Li <lizefan@...wei.com> Cc: pi3orama@....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 2335b28..8e3d9d4 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1495,10 +1495,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) { @@ -1555,8 +1572,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
Powered by blists - more mailing lists