diff options
| author | Joseph Koshy <jkoshy@FreeBSD.org> | 2006-03-22 10:25:37 +0000 |
|---|---|---|
| committer | Joseph Koshy <jkoshy@FreeBSD.org> | 2006-03-22 10:25:37 +0000 |
| commit | 893c7cb5dd0f88b215b5a3ab495a0ca2ee314b90 (patch) | |
| tree | 2123ae351f15c22d1fe3fffb3ec0dbe831a9af32 /sys/dev | |
| parent | 49b82345cba1b9981afb516de80e456339937f6c (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/hwpmc/hwpmc_logging.c | 8 | ||||
| -rw-r--r-- | sys/dev/hwpmc/hwpmc_mod.c | 10 |
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/dev/hwpmc/hwpmc_logging.c b/sys/dev/hwpmc/hwpmc_logging.c index 8b6f376b2f02..26a97e287f58 100644 --- a/sys/dev/hwpmc/hwpmc_logging.c +++ b/sys/dev/hwpmc/hwpmc_logging.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 Joseph Koshy + * Copyright (c) 2005-2006 Joseph Koshy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -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 e4ab45d16120..6473172e50f5 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003-2005 Joseph Koshy + * Copyright (c) 2003-2006 Joseph Koshy * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -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,13 @@ 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 && + pm->pm_state == PMC_STATE_RUNNING) + pmc_stop(pm); error = pmclog_deconfigure_log(po); + } } else error = EINVAL; } |
