Re: [PATCH 08/11] perf tool: precise mode requires exclude_guest
From: Robert Richter
Date: Thu Sep 06 2012 - 15:58:14 EST
On 06.09.12 13:17:19, David Ahern wrote:
> On 9/6/12 1:02 PM, Robert Richter wrote:
> > just found your patch...
I tested the patch and it runs ok with my kernel patch that checks
syscall attributes for ibs. perf tools falls back and clears
exclude_guest/_host bits in attr. It also should work if the kernel
ignores those bits (without my patch).
Acked-by: Robert Richter <robert.richter@xxxxxxx>
> > To summarize how I think it should work:
> >
> > -e cycles:p ..... Enable exclude_guest bit. If the syscall fails,
> > fall back by disabling the guest bit and send
> > syscall again
>
> I think the fallback scenarios are getting out of hand -- too many and
> too many combinations. For this case (:p only) I proposed setting
> exclude_guest. It should not fail if the pebs/ibs is supported. If so,
> give the user a helpful message. e.g., https://lkml.org/lkml/2012/7/20/440
>
>
> >
> > -e cycles:pGH ... Do not enable exclude_guest/_host. Do not fall back
> > on syscall errors.
>
> In this case give the user a message that the requested combination is
> invalid. I have a patch similar to the one above for this.
Yes, but cases where only guest or host-only mode is supported are
rare.
>
> >
> > Same for the case the p modifier is not set.
> >
> > So we have the following:
> >
> > G ... set exclude_host bit, clear exclude_guest
> > H ... set exclude_guest bit, clear exclude_host
> > GH ... clear both exclude_guest/_host
> > <no G or H> ... default (set exclude_host bit, clear exclude_guest),
> > but fall back on syscall errors to clear both
> > exclude_guest/_host
>
> you lost me on the last one. If the user specifies no attributes on the
> events then exclude_host/exclude_guest is controlled by the
> perf_host/perf_guest variables - see event_attr_init().
As you said above, falling back by disabling flags becomes unhandy.
Current implementation falls back without (?) notice even if the user
explicitly demanded G or H. Falling back should only be the case if no
G/H modifiers are given. This is what I meant here.
> > The modifier parser should be correctly implemented and should work
> > with ibs. Will test this patch.
>
> Thanks!
Sorry far being late a bit with all this.
-Robert
--
Advanced Micro Devices, Inc.
Operating System Research Center
--
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/