aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-03-06 07:49:56 -0500
committerIngo Molnar <mingo@elte.hu>2010-03-10 07:22:32 -0500
commit356e1f2e0ace2d4b100c8eda9d49b709e8323da5 (patch)
treecb5f39d8cb7e7160b81f9a74c7eb4707cfbf10f7 /arch/x86/kernel/cpu
parent71e2d2828046133ed985696a02e2e1499ca0bfb8 (diff)
perf, x86: Properly account n_added
Make sure n_added is properly accounted so that we can rely on the value to reflect the number of added counters. This is needed if its going to be used for more than a boolean check. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: paulus@samba.org Cc: eranian@google.com Cc: robert.richter@amd.com Cc: fweisbec@gmail.com LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/perf_event.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index b68c4fb7a944..071c8405debd 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -959,7 +959,7 @@ static int x86_pmu_enable(struct perf_event *event)
959 memcpy(cpuc->assign, assign, n*sizeof(int)); 959 memcpy(cpuc->assign, assign, n*sizeof(int));
960 960
961 cpuc->n_events = n; 961 cpuc->n_events = n;
962 cpuc->n_added = n - n0; 962 cpuc->n_added += n - n0;
963 963
964 return 0; 964 return 0;
965} 965}
@@ -1302,7 +1302,7 @@ int hw_perf_group_sched_in(struct perf_event *leader,
1302 memcpy(cpuc->assign, assign, n0*sizeof(int)); 1302 memcpy(cpuc->assign, assign, n0*sizeof(int));
1303 1303
1304 cpuc->n_events = n0; 1304 cpuc->n_events = n0;
1305 cpuc->n_added = n1; 1305 cpuc->n_added += n1;
1306 ctx->nr_active += n1; 1306 ctx->nr_active += n1;
1307 1307
1308 /* 1308 /*