* small perfmon1 patch for 2.4
@ 2003-09-10 18:42 Stephane Eranian
0 siblings, 0 replies; only message in thread
From: Stephane Eranian @ 2003-09-10 18:42 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 513 bytes --]
Hi,
The attached patch fixes a long standing bug in the perfmon-1 implementation
for all 2.4 based kernels. The PFM_FL_INHERIT_ONCE flag is defined as
allowing a perfmon context to be clone ONCE across fork. Without this
fix, it is in fact clone to all first level child of the parent process.
That's why, for instance, when you run pfmon-2.0 on a command, you see
3 active per-process sessions instead of two (pfmon is multi-threaded).
Bjorn, please apply this patch in your 2.4 tree.
Thanks.
--
-Stephane
[-- Attachment #2: kernel24-perfmon1-030910.diff --]
[-- Type: text/plain, Size: 537 bytes --]
--- linux-ia64-2.4/arch/ia64/kernel/perfmon.c.old 2003-09-10 11:36:15.000000000 -0700
+++ linux-ia64-2.4/arch/ia64/kernel/perfmon.c 2003-09-10 11:37:01.000000000 -0700
@@ -4013,6 +4013,10 @@
if (CTX_INHERIT_MODE(ctx) == PFM_FL_INHERIT_ONCE) {
nctx->ctx_fl_inherit = PFM_FL_INHERIT_NONE;
DBprintk(("downgrading to INHERIT_NONE for [%d]\n", task->pid));
+ /*
+ * downgrade parent: once means only first child!
+ */
+ ctx->ctx_fl_inherit = PFM_FL_INHERIT_NONE;
}
/*
* task is not yet visible in the tasklist, so we do
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-09-10 18:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-10 18:42 small perfmon1 patch for 2.4 Stephane Eranian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox