diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/perf_counter.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 47c92fb927f2..75ae76796df1 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
| @@ -3091,14 +3091,12 @@ static int perf_swcounter_match(struct perf_counter *counter, | |||
| 3091 | enum perf_event_types type, | 3091 | enum perf_event_types type, |
| 3092 | u32 event, struct pt_regs *regs) | 3092 | u32 event, struct pt_regs *regs) |
| 3093 | { | 3093 | { |
| 3094 | u64 event_config; | ||
| 3095 | |||
| 3096 | event_config = ((u64) type << PERF_COUNTER_TYPE_SHIFT) | event; | ||
| 3097 | |||
| 3098 | if (!perf_swcounter_is_counting(counter)) | 3094 | if (!perf_swcounter_is_counting(counter)) |
| 3099 | return 0; | 3095 | return 0; |
| 3100 | 3096 | ||
| 3101 | if (counter->attr.config != event_config) | 3097 | if (counter->attr.type != type) |
| 3098 | return 0; | ||
| 3099 | if (counter->attr.config != event) | ||
| 3102 | return 0; | 3100 | return 0; |
| 3103 | 3101 | ||
| 3104 | if (regs) { | 3102 | if (regs) { |
| @@ -3403,7 +3401,7 @@ static const struct pmu *sw_perf_counter_init(struct perf_counter *counter) | |||
| 3403 | * to be kernel events, and page faults are never hypervisor | 3401 | * to be kernel events, and page faults are never hypervisor |
| 3404 | * events. | 3402 | * events. |
| 3405 | */ | 3403 | */ |
| 3406 | switch (perf_event_id(&counter->attr)) { | 3404 | switch (counter->attr.config) { |
| 3407 | case PERF_COUNT_CPU_CLOCK: | 3405 | case PERF_COUNT_CPU_CLOCK: |
| 3408 | pmu = &perf_ops_cpu_clock; | 3406 | pmu = &perf_ops_cpu_clock; |
| 3409 | 3407 | ||
| @@ -3496,12 +3494,12 @@ perf_counter_alloc(struct perf_counter_attr *attr, | |||
| 3496 | if (attr->inherit && (attr->sample_type & PERF_SAMPLE_GROUP)) | 3494 | if (attr->inherit && (attr->sample_type & PERF_SAMPLE_GROUP)) |
| 3497 | goto done; | 3495 | goto done; |
| 3498 | 3496 | ||
| 3499 | if (perf_event_raw(attr)) { | 3497 | if (attr->type == PERF_TYPE_RAW) { |
| 3500 | pmu = hw_perf_counter_init(counter); | 3498 | pmu = hw_perf_counter_init(counter); |
| 3501 | goto done; | 3499 | goto done; |
| 3502 | } | 3500 | } |
| 3503 | 3501 | ||
| 3504 | switch (perf_event_type(attr)) { | 3502 | switch (attr->type) { |
| 3505 | case PERF_TYPE_HARDWARE: | 3503 | case PERF_TYPE_HARDWARE: |
| 3506 | pmu = hw_perf_counter_init(counter); | 3504 | pmu = hw_perf_counter_init(counter); |
| 3507 | break; | 3505 | break; |
