perf_counter: PERF_TYPE_HW_CACHE is a hardware counter too

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, June 12, 2009 - 2:02 pm

Gitweb:     http://git.kernel.org/linus/f1a3c979059b2033d0b1cc4f9ee5c90bf92b5f94
Commit:     f1a3c979059b2033d0b1cc4f9ee5c90bf92b5f94
Parent:     4c921126fe553440261f56691c5f60fbaaa486d6
Author:     Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Thu Jun 11 17:56:09 2009 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri Jun 12 14:28:51 2009 +0200

    perf_counter: PERF_TYPE_HW_CACHE is a hardware counter too
    
    is_software_counter() was missing the new HW_CACHE category.
    
    ( This could have caused some counter scheduling artifacts
      with mixed sw and hw counters and counter groups. )
    
    Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Paul Mackerras <paulus@samba.org>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    LKML-Reference: <new-submission>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/linux/perf_counter.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 6e13395..7c4f32f 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -621,7 +621,8 @@ extern int perf_counter_overflow(struct perf_counter *counter, int nmi,
 static inline int is_software_counter(struct perf_counter *counter)
 {
 	return (counter->attr.type != PERF_TYPE_RAW) &&
-		(counter->attr.type != PERF_TYPE_HARDWARE);
+		(counter->attr.type != PERF_TYPE_HARDWARE) &&
+		(counter->attr.type != PERF_TYPE_HW_CACHE);
 }
 
 extern void perf_swcounter_event(u32, u64, int, struct pt_regs *, u64);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
perf_counter: PERF_TYPE_HW_CACHE is a hardware counter too, Linux Kernel Mailing ..., (Fri Jun 12, 2:02 pm)