aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/perf_event.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-01-22 10:40:12 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-29 03:01:42 -0500
commitc933c1a603d5bf700ddce79216c1be0ec3bc0e6c (patch)
tree3bac24921bf5ef9bcf2db6f6e8bfa5a7a0b6c3a9 /arch/x86/kernel/cpu/perf_event.c
parent272d30be622c9c6cbd514b1211ff359292001baa (diff)
perf_event: x86: Optimize the fast path a little more
Remove num from the fast path and save a few ops. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <20100122155536.056430539@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_event.c')
-rw-r--r--arch/x86/kernel/cpu/perf_event.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 2c22ce4fa784..33c889ff21ae 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -1245,9 +1245,9 @@ static inline int is_x86_event(struct perf_event *event)
1245 1245
1246static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign) 1246static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
1247{ 1247{
1248 int i, j, w, num, wmax;
1249 struct event_constraint *c, *constraints[X86_PMC_IDX_MAX]; 1248 struct event_constraint *c, *constraints[X86_PMC_IDX_MAX];
1250 unsigned long used_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; 1249 unsigned long used_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
1250 int i, j, w, wmax, num = 0;
1251 struct hw_perf_event *hwc; 1251 struct hw_perf_event *hwc;
1252 1252
1253 bitmap_zero(used_mask, X86_PMC_IDX_MAX); 1253 bitmap_zero(used_mask, X86_PMC_IDX_MAX);
@@ -1260,7 +1260,7 @@ static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
1260 /* 1260 /*
1261 * fastpath, try to reuse previous register 1261 * fastpath, try to reuse previous register
1262 */ 1262 */
1263 for (i = 0, num = n; i < n; i++, num--) { 1263 for (i = 0; i < n; i++) {
1264 hwc = &cpuc->event_list[i]->hw; 1264 hwc = &cpuc->event_list[i]->hw;
1265 c = constraints[i]; 1265 c = constraints[i];
1266 1266
@@ -1288,7 +1288,7 @@ static int x86_schedule_events(struct cpu_hw_events *cpuc, int n, int *assign)
1288 if (assign) 1288 if (assign)
1289 assign[i] = hwc->idx; 1289 assign[i] = hwc->idx;
1290 } 1290 }
1291 if (!num) 1291 if (i == n)
1292 goto done; 1292 goto done;
1293 1293
1294 /* 1294 /*