aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-22 13:17:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-22 13:17:01 -0400
commit38f0b33e6d5bbf7caa23d0abae19bce1e8db5866 (patch)
treef4103d52274c79f2d109cdcbac64396255fffcc1 /kernel
parent18de45a925c905d086cd2db2d3d7e7a653e08003 (diff)
parentc042f7e9bb6ad9429ea0f2c9138dc06413198967 (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: "A larger set of updates for perf. Kernel: - Handle the SBOX uncore monitoring correctly on Broadwell CPUs which do not have SBOX. - Store context switch out type in PERF_RECORD_SWITCH[_CPU_WIDE]. The percentage of preempting and non-preempting context switches help understanding the nature of workloads (CPU or IO bound) that are running on a machine. This adds the kernel facility and userspace changes needed to show this information in 'perf script' and 'perf report -D' (Alexey Budankov) - Remove a WARN_ON() in the trace/kprobes code which is pointless because the return error code is already telling the caller what's wrong. - Revert a fugly workaround for clang BPF targets. - Fix sample_max_stack maximum check and do not proceed when an error has been detect, return them to avoid misidentifying errors (Jiri Olsa) - Add SPDX idenitifiers and get rid of GPL boilderplate. Tools: - Synchronize kernel ABI headers, v4.17-rc1 (Ingo Molnar) - Support MAP_FIXED_NOREPLACE, noticed when updating the tools/include/ copies (Arnaldo Carvalho de Melo) - Add '\n' at the end of parse-options error messages (Ravi Bangoria) - Add s390 support for detailed/verbose PMU event description (Thomas Richter) - perf annotate fixes and improvements: * Allow showing offsets in more than just jump targets, use the new 'O' hotkey in the TUI, config ~/.perfconfig annotate.offset_level for it and for --stdio2 (Arnaldo Carvalho de Melo) * Use the resolved variable names from objdump disassembled lines to make them more compact, just like was already done for some instructions, like "mov", this eventually will be done more generally, but lets now add some more to the existing mechanism (Arnaldo Carvalho de Melo) - perf record fixes: * Change warning for missing topology sysfs entry to debug, as not all architectures have those files, s390 being one of those (Thomas Richter) * Remove old error messages about things that unlikely to be the root cause in modern systems (Andi Kleen) - perf sched fixes: * Fix -g/--call-graph documentation (Takuya Yamamoto) - perf stat: * Enable 1ms interval for printing event counters values in (Alexey Budankov) - perf test fixes: * Run dwarf unwind on arm32 (Kim Phillips) * Remove unused ptrace.h include from LLVM test, sidesteping older clang's lack of support for some asm constructs (Arnaldo Carvalho de Melo) * Fixup BPF test using epoll_pwait syscall function probe, to cope with the syscall routines renames performed in this development cycle (Arnaldo Carvalho de Melo) - perf version fixes: * Do not print info about HAVE_LIBAUDIT_SUPPORT in 'perf version --build-options' when HAVE_SYSCALL_TABLE_SUPPORT is true, as libaudit won't be used in that case, print info about syscall_table support instead (Jin Yao) - Build system fixes: * Use HAVE_..._SUPPORT used consistently (Jin Yao) * Restore READ_ONCE() C++ compatibility in tools/include (Mark Rutland) * Give hints about package names needed to build jvmti (Arnaldo Carvalho de Melo)" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (37 commits) perf/x86/intel/uncore: Fix SBOX support for Broadwell CPUs perf/x86/intel/uncore: Revert "Remove SBOX support for Broadwell server" coresight: Move to SPDX identifier perf test BPF: Fixup BPF test using epoll_pwait syscall function probe perf tests mmap: Show which tracepoint is failing perf tools: Add '\n' at the end of parse-options error messages perf record: Remove suggestion to enable APIC perf record: Remove misleading error suggestion perf hists browser: Clarify top/report browser help perf mem: Allow all record/report options perf trace: Support MAP_FIXED_NOREPLACE perf: Remove superfluous allocation error check perf: Fix sample_max_stack maximum check perf: Return proper values for user stack errors perf list: Add s390 support for detailed/verbose PMU event description perf script: Extend misc field decoding with switch out event type perf report: Extend raw dump (-D) out with switch out event type perf/core: Store context switch out type in PERF_RECORD_SWITCH[_CPU_WIDE] tools/headers: Synchronize kernel ABI headers, v4.17-rc1 trace_kprobe: Remove warning message "Could not insert probe at..." ...
Diffstat (limited to 'kernel')
-rw-r--r--kernel/events/callchain.c25
-rw-r--r--kernel/events/core.c8
-rw-r--r--kernel/trace/trace_kprobe.c2
3 files changed, 17 insertions, 18 deletions
diff --git a/kernel/events/callchain.c b/kernel/events/callchain.c
index 772a43fea825..c187aa3df3c8 100644
--- a/kernel/events/callchain.c
+++ b/kernel/events/callchain.c
@@ -119,23 +119,20 @@ int get_callchain_buffers(int event_max_stack)
119 goto exit; 119 goto exit;
120 } 120 }
121 121
122 if (count > 1) { 122 /*
123 /* If the allocation failed, give up */ 123 * If requesting per event more than the global cap,
124 if (!callchain_cpus_entries) 124 * return a different error to help userspace figure
125 err = -ENOMEM; 125 * this out.
126 /* 126 *
127 * If requesting per event more than the global cap, 127 * And also do it here so that we have &callchain_mutex held.
128 * return a different error to help userspace figure 128 */
129 * this out. 129 if (event_max_stack > sysctl_perf_event_max_stack) {
130 * 130 err = -EOVERFLOW;
131 * And also do it here so that we have &callchain_mutex held.
132 */
133 if (event_max_stack > sysctl_perf_event_max_stack)
134 err = -EOVERFLOW;
135 goto exit; 131 goto exit;
136 } 132 }
137 133
138 err = alloc_callchain_buffers(); 134 if (count == 1)
135 err = alloc_callchain_buffers();
139exit: 136exit:
140 if (err) 137 if (err)
141 atomic_dec(&nr_callchain_events); 138 atomic_dec(&nr_callchain_events);
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 2d5fe26551f8..67612ce359ad 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7587,6 +7587,10 @@ static void perf_event_switch(struct task_struct *task,
7587 }, 7587 },
7588 }; 7588 };
7589 7589
7590 if (!sched_in && task->state == TASK_RUNNING)
7591 switch_event.event_id.header.misc |=
7592 PERF_RECORD_MISC_SWITCH_OUT_PREEMPT;
7593
7590 perf_iterate_sb(perf_event_switch_output, 7594 perf_iterate_sb(perf_event_switch_output,
7591 &switch_event, 7595 &switch_event,
7592 NULL); 7596 NULL);
@@ -10205,9 +10209,9 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
10205 * __u16 sample size limit. 10209 * __u16 sample size limit.
10206 */ 10210 */
10207 if (attr->sample_stack_user >= USHRT_MAX) 10211 if (attr->sample_stack_user >= USHRT_MAX)
10208 ret = -EINVAL; 10212 return -EINVAL;
10209 else if (!IS_ALIGNED(attr->sample_stack_user, sizeof(u64))) 10213 else if (!IS_ALIGNED(attr->sample_stack_user, sizeof(u64)))
10210 ret = -EINVAL; 10214 return -EINVAL;
10211 } 10215 }
10212 10216
10213 if (!attr->sample_max_stack) 10217 if (!attr->sample_max_stack)
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 1cd3fb4d70f8..02aed76e0978 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -512,8 +512,6 @@ static int __register_trace_kprobe(struct trace_kprobe *tk)
512 if (ret == 0) 512 if (ret == 0)
513 tk->tp.flags |= TP_FLAG_REGISTERED; 513 tk->tp.flags |= TP_FLAG_REGISTERED;
514 else { 514 else {
515 pr_warn("Could not insert probe at %s+%lu: %d\n",
516 trace_kprobe_symbol(tk), trace_kprobe_offset(tk), ret);
517 if (ret == -ENOENT && trace_kprobe_is_on_module(tk)) { 515 if (ret == -ENOENT && trace_kprobe_is_on_module(tk)) {
518 pr_warn("This probe might be able to register after target module is loaded. Continue.\n"); 516 pr_warn("This probe might be able to register after target module is loaded. Continue.\n");
519 ret = 0; 517 ret = 0;