lkml.org 
[lkml]   [2011]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/3] perf, core: Introduce attrs to count in either host or guest mode
    On Tue, May 10, 2011 at 12:07:18PM -0400, Peter Zijlstra wrote:
    > On Tue, 2011-05-10 at 17:38 +0200, Roedel, Joerg wrote:
    > > On Tue, May 10, 2011 at 11:18:29AM -0400, Peter Zijlstra wrote:
    > > > On Tue, 2011-05-10 at 16:59 +0200, Roedel, Joerg wrote:
    > > > > On Tue, May 10, 2011 at 10:45:46AM -0400, Peter Zijlstra wrote:
    > > > > > On Tue, 2011-05-10 at 16:35 +0200, Joerg Roedel wrote:
    > > > > > > + /* Can't exclude counting in guest and in host mode */
    > > > > > > + if (attr.exclude_host && attr.exclude_guest)
    > > > > > > + return -EINVAL;
    > > > > >
    > > > > > Why not?
    > > > >
    > > > > By definition the counter won't count at all. The hardware just ignores
    > > > > the bits if they are both set. My rationale here was that it does not
    > > > > makes sense to setup a counter and exclude guest and host mode.
    > > >
    > > > I would expect it to 'work' but simply return 0. If that isn't what the
    > > > AMD hardware does you need to fix that in the AMD driver.
    > >
    > > By 'work' you mean that userspace can set it up but it doesn't count at
    > > all in this situation?
    >
    > Right.
    >
    > > This would certainly be consistent behavior but I
    > > can't imagine any use-case for it so that this code assumes that such a
    > > situation is most likely a bug.
    > > I can certainly change that if wanted, but I think its better to inform
    > > userspace if we get weird values?
    >
    > The eternal how much rope to give and what knots to teach argument I
    > guess. As it is, I think we allow people to exclude both user- and
    > kernel-space, giving a similar situation, so allowing to exclude both
    > host and guest is consistent.

    Okay, fine. So I change that.

    Joerg




    \
     
     \ /
      Last update: 2011-05-10 18:29    [W:0.023 / U:4.436 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site