aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 18:35:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 18:35:47 -0400
commit560ae37178b12e3bd37626f7b1e0b29c503ea558 (patch)
tree24105534940152466aa331fb76a9438c85e634b5 /arch
parent4fa109b13042868de84bedc70ea9b8337b502cf9 (diff)
parentbaf64b85445546a38b44052d71782dfe7531e350 (diff)
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Thomas Gleixner: - fix for do_div() abuse on x86 - locking fix in perf core - a pile of (build) fixes and cleanups in perf tools * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits) perf/x86: Fix incorrect use of do_div() in NMI warning perf: Fix perf_lock_task_context() vs RCU perf: Remove WARN_ON_ONCE() check in __perf_event_enable() for valid scenario perf: Clone child context from parent context pmu perf script: Fix broken include in Context.xs perf tools: Fix -ldw/-lelf link test when static linking perf tools: Revert regression in configuration of Python support perf tools: Fix perf version generation perf stat: Fix per-socket output bug for uncore events perf symbols: Fix vdso list searching perf evsel: Fix missing increment in sample parsing perf tools: Update symbol_conf.nr_events when processing attribute events perf tools: Fix new_term() missing free on error path perf tools: Fix parse_events_terms() segfault on error path perf evsel: Fix count parameter to read call in event_format__new perf tools: fix a typo of a Power7 event name perf tools: Fix -x/--exclude-other option for report command perf evlist: Enhance perf_evlist__start_workload() perf record: Remove -f/--force option perf record: Remove -A/--append option ...
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/perf/power7-pmu.c12
-rw-r--r--arch/x86/kernel/nmi.c7
2 files changed, 10 insertions, 9 deletions
diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
index 13c3f0e547a2..d1821b8bbc4c 100644
--- a/arch/powerpc/perf/power7-pmu.c
+++ b/arch/powerpc/perf/power7-pmu.c
@@ -60,7 +60,7 @@
60#define PME_PM_LD_REF_L1 0xc880 60#define PME_PM_LD_REF_L1 0xc880
61#define PME_PM_LD_MISS_L1 0x400f0 61#define PME_PM_LD_MISS_L1 0x400f0
62#define PME_PM_BRU_FIN 0x10068 62#define PME_PM_BRU_FIN 0x10068
63#define PME_PM_BRU_MPRED 0x400f6 63#define PME_PM_BR_MPRED 0x400f6
64 64
65#define PME_PM_CMPLU_STALL_FXU 0x20014 65#define PME_PM_CMPLU_STALL_FXU 0x20014
66#define PME_PM_CMPLU_STALL_DIV 0x40014 66#define PME_PM_CMPLU_STALL_DIV 0x40014
@@ -349,7 +349,7 @@ static int power7_generic_events[] = {
349 [PERF_COUNT_HW_CACHE_REFERENCES] = PME_PM_LD_REF_L1, 349 [PERF_COUNT_HW_CACHE_REFERENCES] = PME_PM_LD_REF_L1,
350 [PERF_COUNT_HW_CACHE_MISSES] = PME_PM_LD_MISS_L1, 350 [PERF_COUNT_HW_CACHE_MISSES] = PME_PM_LD_MISS_L1,
351 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = PME_PM_BRU_FIN, 351 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = PME_PM_BRU_FIN,
352 [PERF_COUNT_HW_BRANCH_MISSES] = PME_PM_BRU_MPRED, 352 [PERF_COUNT_HW_BRANCH_MISSES] = PME_PM_BR_MPRED,
353}; 353};
354 354
355#define C(x) PERF_COUNT_HW_CACHE_##x 355#define C(x) PERF_COUNT_HW_CACHE_##x
@@ -405,7 +405,7 @@ GENERIC_EVENT_ATTR(instructions, INST_CMPL);
405GENERIC_EVENT_ATTR(cache-references, LD_REF_L1); 405GENERIC_EVENT_ATTR(cache-references, LD_REF_L1);
406GENERIC_EVENT_ATTR(cache-misses, LD_MISS_L1); 406GENERIC_EVENT_ATTR(cache-misses, LD_MISS_L1);
407GENERIC_EVENT_ATTR(branch-instructions, BRU_FIN); 407GENERIC_EVENT_ATTR(branch-instructions, BRU_FIN);
408GENERIC_EVENT_ATTR(branch-misses, BRU_MPRED); 408GENERIC_EVENT_ATTR(branch-misses, BR_MPRED);
409 409
410POWER_EVENT_ATTR(CYC, CYC); 410POWER_EVENT_ATTR(CYC, CYC);
411POWER_EVENT_ATTR(GCT_NOSLOT_CYC, GCT_NOSLOT_CYC); 411POWER_EVENT_ATTR(GCT_NOSLOT_CYC, GCT_NOSLOT_CYC);
@@ -414,7 +414,7 @@ POWER_EVENT_ATTR(INST_CMPL, INST_CMPL);
414POWER_EVENT_ATTR(LD_REF_L1, LD_REF_L1); 414POWER_EVENT_ATTR(LD_REF_L1, LD_REF_L1);
415POWER_EVENT_ATTR(LD_MISS_L1, LD_MISS_L1); 415POWER_EVENT_ATTR(LD_MISS_L1, LD_MISS_L1);
416POWER_EVENT_ATTR(BRU_FIN, BRU_FIN) 416POWER_EVENT_ATTR(BRU_FIN, BRU_FIN)
417POWER_EVENT_ATTR(BRU_MPRED, BRU_MPRED); 417POWER_EVENT_ATTR(BR_MPRED, BR_MPRED);
418 418
419POWER_EVENT_ATTR(CMPLU_STALL_FXU, CMPLU_STALL_FXU); 419POWER_EVENT_ATTR(CMPLU_STALL_FXU, CMPLU_STALL_FXU);
420POWER_EVENT_ATTR(CMPLU_STALL_DIV, CMPLU_STALL_DIV); 420POWER_EVENT_ATTR(CMPLU_STALL_DIV, CMPLU_STALL_DIV);
@@ -449,7 +449,7 @@ static struct attribute *power7_events_attr[] = {
449 GENERIC_EVENT_PTR(LD_REF_L1), 449 GENERIC_EVENT_PTR(LD_REF_L1),
450 GENERIC_EVENT_PTR(LD_MISS_L1), 450 GENERIC_EVENT_PTR(LD_MISS_L1),
451 GENERIC_EVENT_PTR(BRU_FIN), 451 GENERIC_EVENT_PTR(BRU_FIN),
452 GENERIC_EVENT_PTR(BRU_MPRED), 452 GENERIC_EVENT_PTR(BR_MPRED),
453 453
454 POWER_EVENT_PTR(CYC), 454 POWER_EVENT_PTR(CYC),
455 POWER_EVENT_PTR(GCT_NOSLOT_CYC), 455 POWER_EVENT_PTR(GCT_NOSLOT_CYC),
@@ -458,7 +458,7 @@ static struct attribute *power7_events_attr[] = {
458 POWER_EVENT_PTR(LD_REF_L1), 458 POWER_EVENT_PTR(LD_REF_L1),
459 POWER_EVENT_PTR(LD_MISS_L1), 459 POWER_EVENT_PTR(LD_MISS_L1),
460 POWER_EVENT_PTR(BRU_FIN), 460 POWER_EVENT_PTR(BRU_FIN),
461 POWER_EVENT_PTR(BRU_MPRED), 461 POWER_EVENT_PTR(BR_MPRED),
462 462
463 POWER_EVENT_PTR(CMPLU_STALL_FXU), 463 POWER_EVENT_PTR(CMPLU_STALL_FXU),
464 POWER_EVENT_PTR(CMPLU_STALL_DIV), 464 POWER_EVENT_PTR(CMPLU_STALL_DIV),
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 0920212e6159..ba77ebc2c353 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -111,7 +111,7 @@ static int __kprobes nmi_handle(unsigned int type, struct pt_regs *regs, bool b2
111 */ 111 */
112 list_for_each_entry_rcu(a, &desc->head, list) { 112 list_for_each_entry_rcu(a, &desc->head, list) {
113 u64 before, delta, whole_msecs; 113 u64 before, delta, whole_msecs;
114 int decimal_msecs, thishandled; 114 int remainder_ns, decimal_msecs, thishandled;
115 115
116 before = local_clock(); 116 before = local_clock();
117 thishandled = a->handler(type, regs); 117 thishandled = a->handler(type, regs);
@@ -123,8 +123,9 @@ static int __kprobes nmi_handle(unsigned int type, struct pt_regs *regs, bool b2
123 continue; 123 continue;
124 124
125 nmi_longest_ns = delta; 125 nmi_longest_ns = delta;
126 whole_msecs = do_div(delta, (1000 * 1000)); 126 whole_msecs = delta;
127 decimal_msecs = do_div(delta, 1000) % 1000; 127 remainder_ns = do_div(whole_msecs, (1000 * 1000));
128 decimal_msecs = remainder_ns / 1000;
128 printk_ratelimited(KERN_INFO 129 printk_ratelimited(KERN_INFO
129 "INFO: NMI handler (%ps) took too long to run: " 130 "INFO: NMI handler (%ps) took too long to run: "
130 "%lld.%03d msecs\n", a->handler, whole_msecs, 131 "%lld.%03d msecs\n", a->handler, whole_msecs,