Re: perf: record segfaults for cycles event when collecting data ona VM

From: Joerg Roedel
Date: Thu Feb 09 2012 - 06:15:26 EST


On Thu, Feb 09, 2012 at 08:30:24AM +0100, Ingo Molnar wrote:
>
> * Joerg Roedel <joerg.roedel@xxxxxxx> wrote:
>
> > > which makes sense. It forces
> > > perf_session__find_machine_for_cpumode() to return the host
> > > machine always.
> >
> > Great, thanks. I will send two patches tomorrow to fix Jason's
> > problem and change the default for perf_guest.
>
> Well, if the crash is fixed then the the default can stay,
> right?

David's crash is fixed by changing the default back to its original
value :)

> Generally we should treat all input data in a perf.data or even
> the bits we get in the ring-buffer as external data that has to
> be checked carefully, with no assumptions made about data.

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.
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?


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/