From: Joerg Roedel <joerg.roedel@amd.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: David Ahern <dsahern@gmail.com>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
LKML <linux-kernel@vger.kernel.org>,
Jason Wang <jasowang@redhat.com>
Subject: Re: perf: record segfaults for cycles event when collecting data on a VM
Date: Thu, 9 Feb 2012 15:32:53 +0100 [thread overview]
Message-ID: <20120209143253.GP22598@amd.com> (raw)
In-Reply-To: <20120209133446.GD8830@elte.hu>
On Thu, Feb 09, 2012 at 02:34:47PM +0100, Ingo Molnar wrote:
>
> * Joerg Roedel <joerg.roedel@amd.com> wrote:
> > Well, there are two options:
> >
> > 1) Make sure machine == NULL does not happen. Changing the
> > default of perf_guest back to false does exactly this for
> > David's problem.
>
> So what if it's turned on by the user? Do we still crash
> occasionally?
It is only turned on by perf-kvm, and this path should setup a machine
object for guest samples.
>
> > 2) Make sure that a machine == NULL pointer is never
> > dereferenced
> >
> > I was going to fix it with option 1. Do you suggest option 2 is better?
>
> Looks like the better fix. You said:
>
> > Bottom line is that the perf-tool may receive samples tagged
> > as GUEST_KERNEL even when guest-sampling is disabled (probably
> > a race-condition). The perf-tool can not find a valid machine
> > pointer for such a sample and passes NULL down to the other
> > functions. And some functions don't seem to handle this.
>
> tooling should never be surprised by getting some unexpected
> sample via the perf.data or the ring-buffer - regardless of
> whether that functionality is default enabled or manually
> enabled.
Yeah, right. Guest samples may also show up intentionally when the event
modifiers are used. So crashing on machine==NULL needs to be fixed.
Joerg
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
next prev parent reply other threads:[~2012-02-09 14:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-08 16:55 perf: record segfaults for cycles event when collecting data on a VM David Ahern
2012-02-08 17:44 ` Joerg Roedel
2012-02-08 17:53 ` David Ahern
2012-02-08 17:57 ` Joerg Roedel
2012-02-09 7:30 ` Ingo Molnar
2012-02-09 11:14 ` Joerg Roedel
2012-02-09 13:34 ` Ingo Molnar
2012-02-09 14:32 ` Joerg Roedel [this message]
2012-02-09 15:28 ` Joerg Roedel
2012-02-09 15:47 ` David Ahern
2012-02-09 14:43 ` David Ahern
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=20120209143253.GP22598@amd.com \
--to=joerg.roedel@amd.com \
--cc=acme@ghostprotocols.net \
--cc=dsahern@gmail.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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