aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-21 12:06:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-21 12:06:31 -0400
commitf4eccb6d979e0cc5a719a50af5f9a56e79092a2d (patch)
tree00b3ca17251430ce1336d813cf76e95ccdd55099 /arch
parent8e4bc3dd2ca07d77882eba73cea240aba95a1854 (diff)
parentcd74c86bdf705f824d494a2bbda393d1d562b40a (diff)
Merge branch 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: perf_counter, powerpc, sparc: Fix compilation after perf_counter_overflow() change perf_counter: x86: Fix PMU resource leak perf util: SVG performance improvements perf util: Make the timechart SVG width dynamic perf timechart: Show the duration of scheduler delays in the SVG perf timechart: Show the name of the waker/wakee in timechart
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/perf_counter.c3
-rw-r--r--arch/sparc/kernel/perf_counter.c3
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c9
3 files changed, 8 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c
index 7ceefaf3a7f5..5ccf9bca96c0 100644
--- a/arch/powerpc/kernel/perf_counter.c
+++ b/arch/powerpc/kernel/perf_counter.c
@@ -1162,7 +1162,6 @@ static void record_and_restart(struct perf_counter *counter, unsigned long val,
1162 */ 1162 */
1163 if (record) { 1163 if (record) {
1164 struct perf_sample_data data = { 1164 struct perf_sample_data data = {
1165 .regs = regs,
1166 .addr = 0, 1165 .addr = 0,
1167 .period = counter->hw.last_period, 1166 .period = counter->hw.last_period,
1168 }; 1167 };
@@ -1170,7 +1169,7 @@ static void record_and_restart(struct perf_counter *counter, unsigned long val,
1170 if (counter->attr.sample_type & PERF_SAMPLE_ADDR) 1169 if (counter->attr.sample_type & PERF_SAMPLE_ADDR)
1171 perf_get_data_addr(regs, &data.addr); 1170 perf_get_data_addr(regs, &data.addr);
1172 1171
1173 if (perf_counter_overflow(counter, nmi, &data)) { 1172 if (perf_counter_overflow(counter, nmi, &data, regs)) {
1174 /* 1173 /*
1175 * Interrupts are coming too fast - throttle them 1174 * Interrupts are coming too fast - throttle them
1176 * by setting the counter to 0, so it will be 1175 * by setting the counter to 0, so it will be
diff --git a/arch/sparc/kernel/perf_counter.c b/arch/sparc/kernel/perf_counter.c
index 09de4035eaa9..b1265ce8a053 100644
--- a/arch/sparc/kernel/perf_counter.c
+++ b/arch/sparc/kernel/perf_counter.c
@@ -493,7 +493,6 @@ static int __kprobes perf_counter_nmi_handler(struct notifier_block *self,
493 493
494 regs = args->regs; 494 regs = args->regs;
495 495
496 data.regs = regs;
497 data.addr = 0; 496 data.addr = 0;
498 497
499 cpuc = &__get_cpu_var(cpu_hw_counters); 498 cpuc = &__get_cpu_var(cpu_hw_counters);
@@ -513,7 +512,7 @@ static int __kprobes perf_counter_nmi_handler(struct notifier_block *self,
513 if (!sparc_perf_counter_set_period(counter, hwc, idx)) 512 if (!sparc_perf_counter_set_period(counter, hwc, idx))
514 continue; 513 continue;
515 514
516 if (perf_counter_overflow(counter, 1, &data)) 515 if (perf_counter_overflow(counter, 1, &data, regs))
517 sparc_pmu_disable_counter(hwc, idx); 516 sparc_pmu_disable_counter(hwc, idx);
518 } 517 }
519 518
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index dbdf712fae9e..a6c8b27553cd 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -924,6 +924,8 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
924 if (err) 924 if (err)
925 return err; 925 return err;
926 926
927 counter->destroy = hw_perf_counter_destroy;
928
927 /* 929 /*
928 * Generate PMC IRQs: 930 * Generate PMC IRQs:
929 * (keep 'enabled' bit clear for now) 931 * (keep 'enabled' bit clear for now)
@@ -953,8 +955,6 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
953 return -EOPNOTSUPP; 955 return -EOPNOTSUPP;
954 } 956 }
955 957
956 counter->destroy = hw_perf_counter_destroy;
957
958 /* 958 /*
959 * Raw event type provide the config in the event structure 959 * Raw event type provide the config in the event structure
960 */ 960 */
@@ -2107,8 +2107,11 @@ const struct pmu *hw_perf_counter_init(struct perf_counter *counter)
2107 int err; 2107 int err;
2108 2108
2109 err = __hw_perf_counter_init(counter); 2109 err = __hw_perf_counter_init(counter);
2110 if (err) 2110 if (err) {
2111 if (counter->destroy)
2112 counter->destroy(counter);
2111 return ERR_PTR(err); 2113 return ERR_PTR(err);
2114 }
2112 2115
2113 return &pmu; 2116 return &pmu;
2114} 2117}