perf, x86: Properly account n_added
Subsystems (2)
Commit-ID: 356e1f2e0ace2d4b100c8eda9d49b709e8323da5 Gitweb: http://git.kernel.org/tip/356e1f2e0ace2d4b100c8eda9d49b709e8323da5 Author: Peter Zijlstra <[email protected]> AuthorDate: Sat, 6 Mar 2010 13:49:56 +0100 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 10 Mar 2010 13:22:32 +0100
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 <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
LKML-Reference: <new-submission>
Signed-off-by Ingo Molnar <[email protected]>
--- arch/x86/kernel/cpu/perf_event.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/cpu/perf_event.c +2 -2
@@ -959,7 +959,7 @@ static int x86_pmu_enable(struct perf_event *event)memcpy (cpuc->assign, assign, n*sizeof (int )); cpuc->n_events = n; - cpuc->n_added = n - n0; + cpuc->n_added += n - n0;return 0 ; }
@@ -1302,7 +1302,7 @@ int hw_perf_group_sched_in(struct perf_event *leader,memcpy (cpuc->assign, assign, n0*sizeof (int )); cpuc->n_events = n0; - cpuc->n_added = n1; + cpuc->n_added += n1; ctx->nr_active += n1;/*