aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/ABI/testing/sysfs-bus-event_source-devices-events2
-rw-r--r--arch/powerpc/perf/power7-pmu.c12
-rw-r--r--arch/x86/kernel/nmi.c7
-rw-r--r--kernel/events/core.c28
-rw-r--r--tools/lib/lk/Makefile17
-rw-r--r--tools/perf/Documentation/Makefile12
-rw-r--r--tools/perf/Documentation/examples.txt4
-rw-r--r--tools/perf/Documentation/perf-record.txt8
-rw-r--r--tools/perf/Makefile5
-rw-r--r--tools/perf/bench/mem-memcpy.c4
-rw-r--r--tools/perf/bench/mem-memset.c2
-rw-r--r--tools/perf/builtin-diff.c1
-rw-r--r--tools/perf/builtin-kmem.c2
-rw-r--r--tools/perf/builtin-lock.c2
-rw-r--r--tools/perf/builtin-record.c85
-rw-r--r--tools/perf/builtin-report.c3
-rw-r--r--tools/perf/builtin-sched.c1
-rw-r--r--tools/perf/builtin-stat.c30
-rw-r--r--tools/perf/builtin-timechart.c4
-rw-r--r--tools/perf/builtin-top.c2
-rw-r--r--tools/perf/config/Makefile6
-rw-r--r--tools/perf/config/utilities.mak4
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/Context.xs2
-rwxr-xr-xtools/perf/util/PERF-VERSION-GEN21
-rw-r--r--tools/perf/util/dso.c10
-rw-r--r--tools/perf/util/dso.h3
-rw-r--r--tools/perf/util/evlist.c10
-rw-r--r--tools/perf/util/evsel.c4
-rw-r--r--tools/perf/util/header.c15
-rw-r--r--tools/perf/util/parse-events.c4
-rw-r--r--tools/perf/util/symbol.c1
-rw-r--r--tools/perf/util/util.h2
-rw-r--r--tools/perf/util/vdso.c2
-rw-r--r--tools/scripts/Makefile.include2
34 files changed, 154 insertions, 163 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-event_source-devices-events b/Documentation/ABI/testing/sysfs-bus-event_source-devices-events
index 8b25ffb42562..3c1cc24361bd 100644
--- a/Documentation/ABI/testing/sysfs-bus-event_source-devices-events
+++ b/Documentation/ABI/testing/sysfs-bus-event_source-devices-events
@@ -29,7 +29,7 @@ Description: Generic performance monitoring events
29 29
30What: /sys/devices/cpu/events/PM_1PLUS_PPC_CMPL 30What: /sys/devices/cpu/events/PM_1PLUS_PPC_CMPL
31 /sys/devices/cpu/events/PM_BRU_FIN 31 /sys/devices/cpu/events/PM_BRU_FIN
32 /sys/devices/cpu/events/PM_BRU_MPRED 32 /sys/devices/cpu/events/PM_BR_MPRED
33 /sys/devices/cpu/events/PM_CMPLU_STALL 33 /sys/devices/cpu/events/PM_CMPLU_STALL
34 /sys/devices/cpu/events/PM_CMPLU_STALL_BRU 34 /sys/devices/cpu/events/PM_CMPLU_STALL_BRU
35 /sys/devices/cpu/events/PM_CMPLU_STALL_DCACHE_MISS 35 /sys/devices/cpu/events/PM_CMPLU_STALL_DCACHE_MISS
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,
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 1833bc5a84a7..eba8fb5834ae 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -947,8 +947,18 @@ perf_lock_task_context(struct task_struct *task, int ctxn, unsigned long *flags)
947{ 947{
948 struct perf_event_context *ctx; 948 struct perf_event_context *ctx;
949 949
950 rcu_read_lock();
951retry: 950retry:
951 /*
952 * One of the few rules of preemptible RCU is that one cannot do
953 * rcu_read_unlock() while holding a scheduler (or nested) lock when
954 * part of the read side critical section was preemptible -- see
955 * rcu_read_unlock_special().
956 *
957 * Since ctx->lock nests under rq->lock we must ensure the entire read
958 * side critical section is non-preemptible.
959 */
960 preempt_disable();
961 rcu_read_lock();
952 ctx = rcu_dereference(task->perf_event_ctxp[ctxn]); 962 ctx = rcu_dereference(task->perf_event_ctxp[ctxn]);
953 if (ctx) { 963 if (ctx) {
954 /* 964 /*
@@ -964,6 +974,8 @@ retry:
964 raw_spin_lock_irqsave(&ctx->lock, *flags); 974 raw_spin_lock_irqsave(&ctx->lock, *flags);
965 if (ctx != rcu_dereference(task->perf_event_ctxp[ctxn])) { 975 if (ctx != rcu_dereference(task->perf_event_ctxp[ctxn])) {