On Fri, Nov 09, 2012 at 05:27:41PM -0800, Andi Kleen wrote:
> From: Andi Kleen <[email protected]>
> 
> Add a precise qualifier, like cpu/event=0x3c,precise=1/
> 
> This is needed so that the kernel can request enabling PEBS
> for TSX events. The parser bails out on any sysfs parse errors,
> so this is needed in any case to handle any event on the TSX
> perf kernel.
> 
> Signed-off-by: Andi Kleen <[email protected]>
> ---
>  tools/perf/util/parse-events.c |    6 ++++++
>  tools/perf/util/parse-events.h |    1 +
>  tools/perf/util/parse-events.l |    1 +
>  3 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index c0b785b..5b97a2b 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -526,6 +526,12 @@ do {                                                     
>         \
>       case PARSE_EVENTS__TERM_TYPE_NAME:
>               CHECK_TYPE_VAL(STR);
>               break;
> +     case PARSE_EVENTS__TERM_TYPE_PRECISE:
> +             CHECK_TYPE_VAL(NUM);
> +             if ((unsigned)term->val.num > 2)
> +                     return -EINVAL;

Should we test for >3?

        * precise_ip:
        *
        *  0 - SAMPLE_IP can have arbitrary skid
        *  1 - SAMPLE_IP must have constant skid
        *  2 - SAMPLE_IP requested to have 0 skid
        *  3 - SAMPLE_IP must have 0 skid

Maybe it's not implemented in hw yet, but in general it's allowed.

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to