* [GIT PULL 0/1] perf/urgent fix
@ 2012-04-11 20:57 Arnaldo Carvalho de Melo
2012-04-11 20:57 ` [PATCH 1/1] perf kvm: Finding struct machine fails for PERF_RECORD_MMAP Arnaldo Carvalho de Melo
2012-04-13 7:49 ` [GIT PULL 0/1] perf/urgent fix Ingo Molnar
0 siblings, 2 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-04-11 20:57 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
Frederic Weisbecker, Ingo Molnar, Nikunj A. Dadhania,
Paul Mackerras, Peter Zijlstra, Stephane Eranian, arnaldo.melo,
Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling.
Now there are 6 outstanding fixes in this branch.
- Arnaldo
The following changes since commit 31d68e7b66f168e623902e194af1e52b8cf75d71:
perf annotate: Validate addr in symbol__inc_addr_samples (2012-04-05 19:51:14 -0300)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-urgent-for-mingo
for you to fetch changes up to 7fb0a5ee8889488f7568ffddffeb66ddeb50917e:
perf kvm: Finding struct machine fails for PERF_RECORD_MMAP (2012-04-11 11:45:12 -0300)
----------------------------------------------------------------
One more fix for perf/urgent:
. Fix mmap processing for guest kernels, from Nikunj A. Dadhania.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Nikunj A. Dadhania (1):
perf kvm: Finding struct machine fails for PERF_RECORD_MMAP
tools/perf/util/session.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] perf kvm: Finding struct machine fails for PERF_RECORD_MMAP
2012-04-11 20:57 [GIT PULL 0/1] perf/urgent fix Arnaldo Carvalho de Melo
@ 2012-04-11 20:57 ` Arnaldo Carvalho de Melo
2012-04-13 7:49 ` [GIT PULL 0/1] perf/urgent fix Ingo Molnar
1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-04-11 20:57 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Nikunj A. Dadhania, David Ahern,
Frederic Weisbecker, Ingo Molnar, Paul Mackerras, Peter Zijlstra,
Stephane Eranian, Arnaldo Carvalho de Melo
From: "Nikunj A. Dadhania" <nikunj@linux.vnet.ibm.com>
Running 'perf kvm --host --guest --guestmount /tmp/guestmount record -a -g -- sleep 2'
Was resulting in a segfault. For event type PERF_RECORD_MMAP,
event->ip.pid is being used in perf_session__find_machine_for_cpumode,
which is not correct.
The event->ip.pid field happens to be 0 in this case and results in
returning a NULL machine object. Finally, access to self->pid in
machine__mmap_name, results in a segfault later.
For PERF_RECORD_MMAP type, pass event->mmap.pid.
Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20120409081835.10576.22018.stgit@abhimanyu.in.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/session.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 9412e3b..00923cd 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -826,8 +826,16 @@ static struct machine *
{
const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
- if (cpumode == PERF_RECORD_MISC_GUEST_KERNEL && perf_guest)
- return perf_session__find_machine(session, event->ip.pid);
+ if (cpumode == PERF_RECORD_MISC_GUEST_KERNEL && perf_guest) {
+ u32 pid;
+
+ if (event->header.type == PERF_RECORD_MMAP)
+ pid = event->mmap.pid;
+ else
+ pid = event->ip.pid;
+
+ return perf_session__find_machine(session, pid);
+ }
return perf_session__find_host_machine(session);
}
--
1.7.9.2.358.g22243
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [GIT PULL 0/1] perf/urgent fix
2012-04-11 20:57 [GIT PULL 0/1] perf/urgent fix Arnaldo Carvalho de Melo
2012-04-11 20:57 ` [PATCH 1/1] perf kvm: Finding struct machine fails for PERF_RECORD_MMAP Arnaldo Carvalho de Melo
@ 2012-04-13 7:49 ` Ingo Molnar
1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2012-04-13 7:49 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, David Ahern, Frederic Weisbecker, Ingo Molnar,
Nikunj A. Dadhania, Paul Mackerras, Peter Zijlstra,
Stephane Eranian, arnaldo.melo, Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
> Hi Ingo,
>
> Please consider pulling.
>
> Now there are 6 outstanding fixes in this branch.
>
> - Arnaldo
>
> The following changes since commit 31d68e7b66f168e623902e194af1e52b8cf75d71:
>
> perf annotate: Validate addr in symbol__inc_addr_samples (2012-04-05 19:51:14 -0300)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-urgent-for-mingo
>
> for you to fetch changes up to 7fb0a5ee8889488f7568ffddffeb66ddeb50917e:
>
> perf kvm: Finding struct machine fails for PERF_RECORD_MMAP (2012-04-11 11:45:12 -0300)
>
> ----------------------------------------------------------------
> One more fix for perf/urgent:
>
> . Fix mmap processing for guest kernels, from Nikunj A. Dadhania.
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Nikunj A. Dadhania (1):
> perf kvm: Finding struct machine fails for PERF_RECORD_MMAP
>
> tools/perf/util/session.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
Pulled, thanks a lot Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-13 7:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 20:57 [GIT PULL 0/1] perf/urgent fix Arnaldo Carvalho de Melo
2012-04-11 20:57 ` [PATCH 1/1] perf kvm: Finding struct machine fails for PERF_RECORD_MMAP Arnaldo Carvalho de Melo
2012-04-13 7:49 ` [GIT PULL 0/1] perf/urgent fix Ingo Molnar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.