summaryrefslogtreecommitdiff
path: root/kernel/events
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-08-24 14:08:20 +0400
committerIngo Molnar <mingo@kernel.org>2014-08-24 18:47:23 +0400
commite21ded5ecc531a64d6fc0c1693285e890b4e9569 (patch)
treedd8436b2fdeacf12dec49cde06f9a9b50bf7c11a /kernel/events
parentaf924aa35129edf338ebc8da6a4eae08cf7cb297 (diff)
parent39ee533fcc7feb5b7938a3973a2bf5ad79bb595b (diff)
downloadlinux-e21ded5ecc531a64d6fc0c1693285e890b4e9569.tar.xz
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: User visible changes: * Don't try to find DSOs in SYSV maps (Don Zickus) * Fallback to MAP__FUNCTION if daddr maps are NULL, i.e. addresses get looked upon more maps (Don Zickus) * Kernel fix to properly handle exited tasks, by returning POLLHUP values on perf event file descriptors. Tooling changes will come next, but were tested with this kernel fix. (Jiri Olsa) * Add +field argument support for --field option, so that one can add fields to the default list of fields to show, i.e. now one can just do: perf report --fields +pid And the pid will appear in addition to the default fields. (Jiri Olsa) Infrastructure changes: * More Intel PT prep stuff, including: - Add a 'perf test' for tracking with sched_switch - Add 'flush' callback to scripting API * hists browser (used in top and report) refactorings, getting rid of unused variables and reducing source code size by handling similar cases in a fewer functions (Namhyung Kim). * Explicitly include util/debug.h for powerpc, was being indirectly included, broke the build when some change made it stop being included. (Sukadev Bhattiprolu) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r--kernel/events/core.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 2d7363adf678..d8cb4d21a346 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3600,7 +3600,8 @@ perf_read_hw(struct perf_event *event, char __user *buf, size_t count)
* error state (i.e. because it was pinned but it couldn't be
* scheduled on to the CPU at some point).
*/
- if (event->state == PERF_EVENT_STATE_ERROR)
+ if ((event->state == PERF_EVENT_STATE_ERROR) ||
+ (event->state == PERF_EVENT_STATE_EXIT))
return 0;
if (count < event->read_size)
@@ -3627,9 +3628,13 @@ static unsigned int perf_poll(struct file *file, poll_table *wait)
{
struct perf_event *event = file->private_data;
struct ring_buffer *rb;
- unsigned int events = POLL_HUP;
+ unsigned int events = POLLHUP;
poll_wait(file, &event->waitq, wait);
+
+ if (event->state == PERF_EVENT_STATE_EXIT)
+ return events;
+
/*
* Pin the event->rb by taking event->mmap_mutex; otherwise
* perf_event_set_output() can swizzle our rb and make us miss wakeups.
@@ -7588,6 +7593,9 @@ __perf_event_exit_task(struct perf_event *child_event,
if (child_event->parent) {
sync_child_event(child_event, child);
free_event(child_event);
+ } else {
+ child_event->state = PERF_EVENT_STATE_EXIT;
+ perf_event_wakeup(child_event);
}
}