aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2018-04-21 03:38:33 -0400
committerIngo Molnar <mingo@kernel.org>2018-04-21 03:38:33 -0400
commitc042f7e9bb6ad9429ea0f2c9138dc06413198967 (patch)
treeb6806dcd59c7a2b8f11167b4ff26271c378e6837 /kernel
parent15a3e845b01ce2342cf187dc123c92c44c3c8170 (diff)
parent8a9fd8323087e794f1d3cd4850b393ced048bc73 (diff)
Merge tag 'perf-urgent-for-mingo-4.17-20180420' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes and improvements from Arnaldo Carvalho de Melo: - 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 old error messages about things that unlikely to be the root cause in modern systems (Andi Kleen) - Synchronize kernel ABI headers, v4.17-rc1 (Ingo Molnar) - Support MAP_FIXED_NOREPLACE, noticed when updating the tools/include/ copies (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) - 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 '\n' at the end of parse-options error messages (Ravi Bangoria) - Add s390 support for detailed/verbose PMU event description (Thomas Richter) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/events/callchain.c25
-rw-r--r--kernel/events/core.c8
2 files changed, 17 insertions, 16 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)