diff options
author | rstone <rstone@FreeBSD.org> | 2010-05-24 18:21:42 +0000 |
---|---|---|
committer | rstone <rstone@FreeBSD.org> | 2010-05-24 18:21:42 +0000 |
commit | 6cf9d569bff51cdf233ee966504d07237edcb906 (patch) | |
tree | 514d454bb114cd84b8b4552baaec3b92b86f71fc /sys/dev | |
parent | c4da1669c2950e6c61ffac9de7b9e5d7712370bc (diff) | |
download | FreeBSD-src-6cf9d569bff51cdf233ee966504d07237edcb906.zip FreeBSD-src-6cf9d569bff51cdf233ee966504d07237edcb906.tar.gz |
MFC r207484:
When configuring a system-wide couting PMC, hwpmc was incorrectly logging
process mappings for that PMC. Nothing ever reads pmc logs out of a
counting PMC, so the log buffers were leaked when the PMC was
deconfigured. The process mappings are only useful for sampling PMCs
anyway, so only log the mappings if the PMC is a sampling PMC.
This bug would cause allocating sample-mode PMCs to fail with ENOMEM
after allocating several counting-mode PMCs.
Approved by: emaste (mentor)
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/hwpmc/hwpmc_mod.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index 2ecebef..bccdb2b 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -2675,16 +2675,16 @@ pmc_start(struct pmc *pm) PMCDBG(PMC,OPS,1, "po=%p in global list", po); } po->po_sscount++; - } - /* - * Log mapping information for all existing processes in the - * system. Subsequent mappings are logged as they happen; - * see pmc_process_mmap(). - */ - if (po->po_logprocmaps == 0) { - pmc_log_all_process_mappings(po); - po->po_logprocmaps = 1; + /* + * Log mapping information for all existing processes in the + * system. Subsequent mappings are logged as they happen; + * see pmc_process_mmap(). + */ + if (po->po_logprocmaps == 0) { + pmc_log_all_process_mappings(po); + po->po_logprocmaps = 1; + } } /* |