Skip to content

Commit

Permalink
[PATCH] oprofile: ppro: need to enable/disable all the counters
Browse files Browse the repository at this point in the history
Need to enable/disable all the counters instead of just counter 0.

This affects all cpus with family=6, including i386/core.  Usual symptom:
only counter 0 provides samples.  Other counters don't produce samples.

Signed-off-by: Arun Sharma <arun.sharma@google.com>
Cc: Philippe Elie <phil.el@wanadoo.fr>
Cc: John Levon <levon@movementarian.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Arun Sharma authored and Linus Torvalds committed Sep 29, 2006
1 parent 5046206 commit 6b77df0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions arch/i386/oprofile/op_model_ppro.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,29 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
static void ppro_start(struct op_msrs const * const msrs)
{
unsigned int low,high;
int i;

if (reset_value[0]) {
CTRL_READ(low, high, msrs, 0);
CTRL_SET_ACTIVE(low);
CTRL_WRITE(low, high, msrs, 0);
for (i = 0; i < NUM_COUNTERS; ++i) {
if (reset_value[i]) {
CTRL_READ(low, high, msrs, i);
CTRL_SET_ACTIVE(low);
CTRL_WRITE(low, high, msrs, i);
}
}
}


static void ppro_stop(struct op_msrs const * const msrs)
{
unsigned int low,high;
int i;

if (reset_value[0]) {
CTRL_READ(low, high, msrs, 0);
for (i = 0; i < NUM_COUNTERS; ++i) {
if (!reset_value[i])
continue;
CTRL_READ(low, high, msrs, i);
CTRL_SET_INACTIVE(low);
CTRL_WRITE(low, high, msrs, 0);
CTRL_WRITE(low, high, msrs, i);
}
}

Expand Down

0 comments on commit 6b77df0

Please sign in to comment.