diff options
-rw-r--r-- | include/linux/perf_counter.h | 53 | ||||
-rw-r--r-- | kernel/perf_counter.c | 6 |
2 files changed, 28 insertions, 31 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 95c797c480e8..d5911b02bc8c 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -24,24 +24,21 @@ | |||
24 | /* | 24 | /* |
25 | * attr.type | 25 | * attr.type |
26 | */ | 26 | */ |
27 | enum perf_event_types { | 27 | enum perf_type_id { |
28 | PERF_TYPE_HARDWARE = 0, | 28 | PERF_TYPE_HARDWARE = 0, |
29 | PERF_TYPE_SOFTWARE = 1, | 29 | PERF_TYPE_SOFTWARE = 1, |
30 | PERF_TYPE_TRACEPOINT = 2, | 30 | PERF_TYPE_TRACEPOINT = 2, |
31 | PERF_TYPE_HW_CACHE = 3, | 31 | PERF_TYPE_HW_CACHE = 3, |
32 | PERF_TYPE_RAW = 4, | ||
32 | 33 | ||
33 | /* | 34 | PERF_TYPE_MAX, /* non ABI */ |
34 | * available TYPE space, raw is the max value. | ||
35 | */ | ||
36 | |||
37 | PERF_TYPE_RAW = 128, | ||
38 | }; | 35 | }; |
39 | 36 | ||
40 | /* | 37 | /* |
41 | * Generalized performance counter event types, used by the attr.event_id | 38 | * Generalized performance counter event types, used by the attr.event_id |
42 | * parameter of the sys_perf_counter_open() syscall: | 39 | * parameter of the sys_perf_counter_open() syscall: |
43 | */ | 40 | */ |
44 | enum attr_ids { | 41 | enum perf_hw_id { |
45 | /* | 42 | /* |
46 | * Common hardware events, generalized by the kernel: | 43 | * Common hardware events, generalized by the kernel: |
47 | */ | 44 | */ |
@@ -53,7 +50,7 @@ enum attr_ids { | |||
53 | PERF_COUNT_BRANCH_MISSES = 5, | 50 | PERF_COUNT_BRANCH_MISSES = 5, |
54 | PERF_COUNT_BUS_CYCLES = 6, | 51 | PERF_COUNT_BUS_CYCLES = 6, |
55 | 52 | ||
56 | PERF_HW_EVENTS_MAX = 7, | 53 | PERF_HW_EVENTS_MAX, /* non ABI */ |
57 | }; | 54 | }; |
58 | 55 | ||
59 | /* | 56 | /* |
@@ -63,30 +60,30 @@ enum attr_ids { | |||
63 | * { read, write, prefetch } x | 60 | * { read, write, prefetch } x |
64 | * { accesses, misses } | 61 | * { accesses, misses } |
65 | */ | 62 | */ |
66 | enum hw_cache_id { | 63 | enum perf_hw_cache_id { |
67 | PERF_COUNT_HW_CACHE_L1D, | 64 | PERF_COUNT_HW_CACHE_L1D = 0, |
68 | PERF_COUNT_HW_CACHE_L1I, | 65 | PERF_COUNT_HW_CACHE_L1I = 1, |
69 | PERF_COUNT_HW_CACHE_L2, | 66 | PERF_COUNT_HW_CACHE_L2 = 2, |
70 | PERF_COUNT_HW_CACHE_DTLB, | 67 | PERF_COUNT_HW_CACHE_DTLB = 3, |
71 | PERF_COUNT_HW_CACHE_ITLB, | 68 | PERF_COUNT_HW_CACHE_ITLB = 4, |
72 | PERF_COUNT_HW_CACHE_BPU, | 69 | PERF_COUNT_HW_CACHE_BPU = 5, |
73 | 70 | ||
74 | PERF_COUNT_HW_CACHE_MAX, | 71 | PERF_COUNT_HW_CACHE_MAX, /* non ABI */ |
75 | }; | 72 | }; |
76 | 73 | ||
77 | enum hw_cache_op_id { | 74 | enum perf_hw_cache_op_id { |
78 | PERF_COUNT_HW_CACHE_OP_READ, | 75 | PERF_COUNT_HW_CACHE_OP_READ = 0, |
79 | PERF_COUNT_HW_CACHE_OP_WRITE, | 76 | PERF_COUNT_HW_CACHE_OP_WRITE = 1, |
80 | PERF_COUNT_HW_CACHE_OP_PREFETCH, | 77 | PERF_COUNT_HW_CACHE_OP_PREFETCH = 2, |
81 | 78 | ||
82 | PERF_COUNT_HW_CACHE_OP_MAX, | 79 | PERF_COUNT_HW_CACHE_OP_MAX, /* non ABI */ |
83 | }; | 80 | }; |
84 | 81 | ||
85 | enum hw_cache_op_result_id { | 82 | enum perf_hw_cache_op_result_id { |
86 | PERF_COUNT_HW_CACHE_RESULT_ACCESS, | 83 | PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0, |
87 | PERF_COUNT_HW_CACHE_RESULT_MISS, | 84 | PERF_COUNT_HW_CACHE_RESULT_MISS = 1, |
88 | 85 | ||
89 | PERF_COUNT_HW_CACHE_RESULT_MAX, | 86 | PERF_COUNT_HW_CACHE_RESULT_MAX, /* non ABI */ |
90 | }; | 87 | }; |
91 | 88 | ||
92 | /* | 89 | /* |
@@ -95,7 +92,7 @@ enum hw_cache_op_result_id { | |||
95 | * physical and sw events of the kernel (and allow the profiling of them as | 92 | * physical and sw events of the kernel (and allow the profiling of them as |
96 | * well): | 93 | * well): |
97 | */ | 94 | */ |
98 | enum sw_event_ids { | 95 | enum perf_sw_ids { |
99 | PERF_COUNT_CPU_CLOCK = 0, | 96 | PERF_COUNT_CPU_CLOCK = 0, |
100 | PERF_COUNT_TASK_CLOCK = 1, | 97 | PERF_COUNT_TASK_CLOCK = 1, |
101 | PERF_COUNT_PAGE_FAULTS = 2, | 98 | PERF_COUNT_PAGE_FAULTS = 2, |
@@ -104,7 +101,7 @@ enum sw_event_ids { | |||
104 | PERF_COUNT_PAGE_FAULTS_MIN = 5, | 101 | PERF_COUNT_PAGE_FAULTS_MIN = 5, |
105 | PERF_COUNT_PAGE_FAULTS_MAJ = 6, | 102 | PERF_COUNT_PAGE_FAULTS_MAJ = 6, |
106 | 103 | ||
107 | PERF_SW_EVENTS_MAX = 7, | 104 | PERF_SW_EVENTS_MAX, /* non ABI */ |
108 | }; | 105 | }; |
109 | 106 | ||
110 | /* | 107 | /* |
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 3b2829de5590..c02535bed26f 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -3162,7 +3162,7 @@ static int perf_swcounter_is_counting(struct perf_counter *counter) | |||
3162 | } | 3162 | } |
3163 | 3163 | ||
3164 | static int perf_swcounter_match(struct perf_counter *counter, | 3164 | static int perf_swcounter_match(struct perf_counter *counter, |
3165 | enum perf_event_types type, | 3165 | enum perf_type_id type, |
3166 | u32 event, struct pt_regs *regs) | 3166 | u32 event, struct pt_regs *regs) |
3167 | { | 3167 | { |
3168 | if (!perf_swcounter_is_counting(counter)) | 3168 | if (!perf_swcounter_is_counting(counter)) |
@@ -3194,7 +3194,7 @@ static void perf_swcounter_add(struct perf_counter *counter, u64 nr, | |||
3194 | } | 3194 | } |
3195 | 3195 | ||
3196 | static void perf_swcounter_ctx_event(struct perf_counter_context *ctx, | 3196 | static void perf_swcounter_ctx_event(struct perf_counter_context *ctx, |
3197 | enum perf_event_types type, u32 event, | 3197 | enum perf_type_id type, u32 event, |
3198 | u64 nr, int nmi, struct pt_regs *regs, | 3198 | u64 nr, int nmi, struct pt_regs *regs, |
3199 | u64 addr) | 3199 | u64 addr) |
3200 | { | 3200 | { |
@@ -3225,7 +3225,7 @@ static int *perf_swcounter_recursion_context(struct perf_cpu_context *cpuctx) | |||
3225 | return &cpuctx->recursion[0]; | 3225 | return &cpuctx->recursion[0]; |
3226 | } | 3226 | } |
3227 | 3227 | ||
3228 | static void __perf_swcounter_event(enum perf_event_types type, u32 event, | 3228 | static void __perf_swcounter_event(enum perf_type_id type, u32 event, |
3229 | u64 nr, int nmi, struct pt_regs *regs, | 3229 | u64 nr, int nmi, struct pt_regs *regs, |
3230 | u64 addr) | 3230 | u64 addr) |
3231 | { | 3231 | { |