Commit 2b74f0cd authored by John Levon's avatar John Levon Committed by Linus Torvalds

[PATCH] fix OProfile events with zero event values

A silly bug prevented certain events from being used.
parent 752b4f67
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com> * @remark Copyright 2004 Dave Jiang <dave.jiang@intel.com>
* @remark Copyright 2004 Intel Corporation * @remark Copyright 2004 Intel Corporation
* @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk> * @remark Copyright 2004 Zwane Mwaikambo <zwane@arm.linux.org.uk>
* @remark Copyright 2004 Oprofile Authors * @remark Copyright 2004 OProfile Authors
* *
* @remark Read the file COPYING * @remark Read the file COPYING
* *
...@@ -249,7 +249,7 @@ static int xscale_setup_ctrs(void) ...@@ -249,7 +249,7 @@ static int xscale_setup_ctrs(void)
int i; int i;
for (i = CCNT; i < MAX_COUNTERS; i++) { for (i = CCNT; i < MAX_COUNTERS; i++) {
if (counter_config[i].event) if (counter_config[i].enabled)
continue; continue;
counter_config[i].event = EVT_UNUSED; counter_config[i].event = EVT_UNUSED;
......
...@@ -70,7 +70,7 @@ static void athlon_setup_ctrs(struct op_msrs const * const msrs) ...@@ -70,7 +70,7 @@ static void athlon_setup_ctrs(struct op_msrs const * const msrs)
/* enable active counters */ /* enable active counters */
for (i = 0; i < NUM_COUNTERS; ++i) { for (i = 0; i < NUM_COUNTERS; ++i) {
if (counter_config[i].event) { if (counter_config[i].enabled) {
reset_value[i] = counter_config[i].count; reset_value[i] = counter_config[i].count;
CTR_WRITE(counter_config[i].count, msrs, i); CTR_WRITE(counter_config[i].count, msrs, i);
......
...@@ -578,7 +578,7 @@ static void p4_setup_ctrs(struct op_msrs const * const msrs) ...@@ -578,7 +578,7 @@ static void p4_setup_ctrs(struct op_msrs const * const msrs)
/* setup all counters */ /* setup all counters */
for (i = 0 ; i < num_counters ; ++i) { for (i = 0 ; i < num_counters ; ++i) {
if (counter_config[i].event) { if (counter_config[i].enabled) {
reset_value[i] = counter_config[i].count; reset_value[i] = counter_config[i].count;
pmc_setup_one_p4_counter(i); pmc_setup_one_p4_counter(i);
CTR_WRITE(counter_config[i].count, VIRT_CTR(stag, i)); CTR_WRITE(counter_config[i].count, VIRT_CTR(stag, i));
......
...@@ -67,7 +67,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) ...@@ -67,7 +67,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
/* enable active counters */ /* enable active counters */
for (i = 0; i < NUM_COUNTERS; ++i) { for (i = 0; i < NUM_COUNTERS; ++i) {
if (counter_config[i].event) { if (counter_config[i].enabled) {
reset_value[i] = counter_config[i].count; reset_value[i] = counter_config[i].count;
CTR_WRITE(counter_config[i].count, msrs, i); CTR_WRITE(counter_config[i].count, msrs, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment