From: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: Alexander Yarygin <yarygin@linux.vnet.ibm.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Christian Borntraeger <borntraeger@de.ibm.com>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@kernel.org>, Jiri Olsa <jolsa@redhat.com>,
Mike Galbraith <efault@gmx.de>,
Namhyung Kim <namhyung.kim@lge.com>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Stephane Eranian <eranian@google.com>
Subject: [PATCH 2/2] perf kvm stat live: Enable events copying
Date: Thu, 18 Sep 2014 21:07:39 +0400 [thread overview]
Message-ID: <1411060059-23589-3-git-send-email-yarygin@linux.vnet.ibm.com> (raw)
In-Reply-To: <1411060059-23589-1-git-send-email-yarygin@linux.vnet.ibm.com>
Process of analyzing events caused by 2 functions: mmap_read() and
finished_round().
During mmap_read(), perf receives events from shared memory, queues
their pointers for further processing in finished_round() and notifies
the kernel that the events have been processed.
By the time when finished_round() is invoked, queued events can be
overwritten by the kernel, so the finished_round() occurs on potentially
corrupted memory.
Let's copy events when queueing.
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
tools/perf/builtin-kvm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index f5d3ae4..c5b6d1d 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1369,6 +1369,7 @@ static int kvm_events_live(struct perf_kvm_stat *kvm,
goto out;
}
kvm->session->evlist = kvm->evlist;
+ kvm->session->copy_on_queue = true;
perf_session__set_id_hdr_size(kvm->session);
machine__synthesize_threads(&kvm->session->machines.host, &kvm->opts.target,
kvm->evlist->threads, false);
--
1.9.1
next prev parent reply other threads:[~2014-09-18 17:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-18 17:07 [PATCH 0/2] perf kvm stat live: Copy events Alexander Yarygin
2014-09-18 17:07 ` [PATCH 1/2] perf session: Add option to copy events when queueing Alexander Yarygin
2014-09-18 18:53 ` Arnaldo Carvalho de Melo
2014-09-18 20:21 ` David Ahern
2014-09-18 20:29 ` David Ahern
2014-09-19 8:48 ` Alexander Yarygin
2014-09-19 14:21 ` David Ahern
2014-09-19 16:25 ` Alexander Yarygin
2014-09-22 7:04 ` Jiri Olsa
2014-09-22 7:04 ` Jiri Olsa
2014-09-29 18:33 ` Arnaldo Carvalho de Melo
2014-09-18 17:07 ` Alexander Yarygin [this message]
2014-10-02 10:32 [PATCH v2 0/2] perf kvm stat live: Copy events Alexander Yarygin
2014-10-02 10:32 ` [PATCH 2/2] perf kvm stat live: Enable events copying Alexander Yarygin
2014-10-02 16:38 [PATCH v3 0/2] perf kvm stat live: Copy events Alexander Yarygin
2014-10-02 16:38 ` [PATCH 2/2] perf kvm stat live: Enable events copying Alexander Yarygin
2014-10-03 14:40 [PATCH v4 0/2] perf kvm stat live: Copy events Alexander Yarygin
2014-10-03 14:40 ` [PATCH 2/2] perf kvm stat live: Enable events copying Alexander Yarygin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1411060059-23589-3-git-send-email-yarygin@linux.vnet.ibm.com \
--to=yarygin@linux.vnet.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=borntraeger@de.ibm.com \
--cc=dsahern@gmail.com \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).