lkml.org 
[lkml]   [2009]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -tip] perf stat: define CHECK_ATTRS for easy attrs checking

* Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:

> CHECK_ATTRS is useful :
> 1. for multiple attrs checking
> 2. avoid repetition of PERF_TYPE_ and PERF_COUNT_ and save space
> 3. avoids line breakage
>
> Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
> ---
> tools/perf/builtin-stat.c | 18 ++++++++----------
> 1 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index 3e5ea4e..6231b39 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -96,6 +96,10 @@ static u64 walltime_nsecs_noise;
> static u64 runtime_cycles_avg;
> static u64 runtime_cycles_noise;
>
> +#define CHECK_ATTRS(t, c, counter) \
> + (attrs[counter].type == PERF_TYPE_##t && \
> + attrs[counter].config == PERF_COUNT_##c)

looks good except that the name should be something like
MATCH_EVENT() not CHECK_ATTRS().

Ingo


\
 
 \ /
  Last update: 2009-06-30 12:11    [W:0.039 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site