- Previous thread: [PATCH] powerpc/perf_counter: POWER7 has alternate PR/HV bits
- Next thread: [PATCHv3 0/4] kvm: locking and API rework for iosignalfd
- Threads sorted by date: kernel 200906
* Jaswinder Singh Rajput 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
> ---
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Conversations: [PATCH -tip] perf stat: define CHECK_ATTRS for easy attrs checking
- [PATCH -tip] perf stat: define CHECK_ATTRS for easy attrs checking by Jaswinder Singh Rajput on 2009-06-29T11:20:21+00:00
- Re: [PATCH -tip] perf stat: define CHECK_ATTRS for easy attrs checking by Ingo Molnar on 2009-06-30T10:09:32+00:00
- Re: [PATCH -tip] perf stat: define CHECK_ATTRS for easy attrs checking by Jaswinder Singh Rajput on 2009-06-30T13:10:45+00:00
Related Threads
- DO NOT REPLY [Bug 48831] New: Properly closing JULI FileHandler - tomcat
- Delaying message delivery - activemq
- [OT] ssh security - freebsd
- [Hendrix] 3.6. very buggy regarding to tabs & processor usage - firefox
- jpeg2swf segfaults - freebsd
- No required field indication in TabularInline - django
- [Hendrix] help - firefox
- [Bug 22119] New: X11 mouse pointer shows over fullscreen window - wine
- [python-win32] Win API call to display a BMP/PNG file as a splash screen for a console app? - python
- [Hendrix] request for mail title change function - thunderbird
- [PATCH] cfq-iosched: Do not merge queues of BE and IDLE classes - kernel
- [Hendrix] Crashes on Citi Cards site - firefox