summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2006-03-09 02:08:12 +0000
committerjkoshy <jkoshy@FreeBSD.org>2006-03-09 02:08:12 +0000
commitcc4ea0b46dbb746e0c3a8da09b9480b850a0c421 (patch)
tree8a18f5c4a09e0dae2ac014dacad343d439fdf231 /sys
parent5b9c942eb7a5a8866922074a6ace5089b3b53c9d (diff)
downloadFreeBSD-src-cc4ea0b46dbb746e0c3a8da09b9480b850a0c421.zip
FreeBSD-src-cc4ea0b46dbb746e0c3a8da09b9480b850a0c421.tar.gz
When a process is de-configuring a log file, also stop all of its
PMCs that require a log file to operate. This change should fix PR 90269. PR: kern/90269 MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/hwpmc/hwpmc_logging.c6
-rw-r--r--sys/dev/hwpmc/hwpmc_mod.c7
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c
index ff6298e..f901cbe 100644
--- a/sys/dev/hwpmc/hwpmc_logging.c
+++ b/sys/dev/hwpmc/hwpmc_logging.c
@@ -619,10 +619,8 @@ pmclog_deconfigure_log(struct pmc_owner *po)
if ((po->po_flags & PMC_PO_OWNS_LOGFILE) == 0)
return EINVAL;
- /* remove this owner from the global SS pmc owner list */
- if (po->po_sscount)
- LIST_REMOVE(po, po_ssnext);
-
+ KASSERT(po->po_sscount == 0,
+ ("[pmc,%d] po=%p still owning SS PMCs", __LINE__, po));
KASSERT(po->po_file != NULL,
("[pmc,%d] po=%p no log file", __LINE__, po));
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
index 2a8b0fb..9c7b3b2 100644
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -2408,6 +2408,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
case PMC_OP_CONFIGURELOG:
{
+ struct pmc *pm;
struct pmc_owner *po;
struct pmc_op_configurelog cl;
struct proc *p;
@@ -2436,8 +2437,12 @@ pmc_syscall_handler(struct thread *td, void *syscall_args)
else if (po->po_flags & PMC_PO_OWNS_LOGFILE) {
pmclog_process_closelog(po);
error = pmclog_flush(po);
- if (error == 0)
+ if (error == 0) {
+ LIST_FOREACH(pm, &po->po_pmcs, pm_next)
+ if (pm->pm_flags & PMC_F_NEEDS_LOGFILE)
+ pmc_stop(pm);
error = pmclog_deconfigure_log(po);
+ }
} else
error = EINVAL;
}
OpenPOWER on IntegriCloud