12 #include <linux/string.h>
13 #include <linux/perf_event.h>
15 #include <asm/cputable.h>
21 static int e500_generic_events[] = {
29 #define C(x) PERF_COUNT_HW_CACHE_##x
36 static int e500_cache_events[
C(
MAX)][
C(
OP_MAX)][
C(RESULT_MAX)] = {
44 [
C(OP_PREFETCH)] = { 29, 0 },
49 [
C(OP_PREFETCH)] = { 0, 0 },
60 [
C(OP_PREFETCH)] = { 0, 0 },
71 [
C(OP_PREFETCH)] = { -1, -1 },
76 [
C(OP_PREFETCH)] = { -1, -1 },
81 [
C(OP_PREFETCH)] = { -1, -1 },
85 static int num_events = 128;
90 u32 event_low = (
u32)event_id;
93 if (event_low >= num_events)
98 if (event_low >= 76 && event_low <= 81) {
102 }
else if (event_id &
112 .name =
"e500 family",
115 .xlate_event = e500_xlate_event,
117 .generic_events = e500_generic_events,
118 .cache_events = &e500_cache_events,
121 static int init_e500_pmu(
void)