[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1505281453220.31735@vincent-weaver-1.umelst.maine.edu>
Date: Thu, 28 May 2015 15:06:19 -0400 (EDT)
From: Vince Weaver <vincent.weaver@...ne.edu>
To: linux-kernel@...r.kernel.org
cc: mingo@...nel.org, peterz@...radead.org, eranian@...gle.com,
Paul Mackerras <paulus@...ba.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: [patch] inherited events not signalling parent on overflow
We're trying to get self-monitoring multi-threaded sampling working in
PAPI. Fun times.
Is this even possible?
Ideally in your parent thread you could perf_event_open() with
inherit set. Then your program (say an OpenMP program) would do its thing
and all of the samples would get written back to the parent thread's
mmap() buffer.
But this won't work as mmap'ing an inherited event is explicitly
disasllowed in events.c due to "performance reasons".
Which is believable, it's just there's not really a good alternative that
doesn't involve having to somehow manually instrument every single
possible thread.
on a related note, I turned up the following issue when working on this
issue. I don't know if this is the proper fix but it makes my simple test
case behave as expected.
If we inherit events, we inherit the signal state but not the fasync
state, so overflows in inherited children will never trigger the signal
handler.
Signed-off-by: Vince Weaver <vincent.weaver@...ne.edu>
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 1a3bf48..7df4cf5 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8626,6 +8630,8 @@ inherit_event(struct perf_event *parent_event,
child_event->overflow_handler_context
= parent_event->overflow_handler_context;
+ child_event->fasync = parent_event->fasync;
+
/*
* Precalculate sample_data sizes
*/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists