diff options
author | fabient <fabient@FreeBSD.org> | 2011-10-18 15:25:43 +0000 |
---|---|---|
committer | fabient <fabient@FreeBSD.org> | 2011-10-18 15:25:43 +0000 |
commit | c0da433b0a908c85fe0547ba8054795948e39d30 (patch) | |
tree | 3965b86bd8e0e5d008fd4219e7d38fa2351bfcac /sys/dev/hwpmc/hwpmc_mod.c | |
parent | 9e1982ba8eaabe131f148406f3f2819d8e0e1563 (diff) | |
download | FreeBSD-src-c0da433b0a908c85fe0547ba8054795948e39d30.zip FreeBSD-src-c0da433b0a908c85fe0547ba8054795948e39d30.tar.gz |
Add a flush of the current PMC log buffer before displaying the next top.
As the underlying block is 4KB if the PMC throughput is low the measurement
will be reported on the next tick. pmcstat(8) use the modified flush API to
reclaim current buffer before displaying next top.
MFC after: 1 month
Diffstat (limited to 'sys/dev/hwpmc/hwpmc_mod.c')
-rw-r--r-- | sys/dev/hwpmc/hwpmc_mod.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index fc82908..7ca7a47 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -2891,7 +2891,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_args) error = pmclog_configure_log(md, po, cl.pm_logfd); } else if (po->po_flags & PMC_PO_OWNS_LOGFILE) { pmclog_process_closelog(po); - error = pmclog_flush(po); + error = pmclog_close(po); if (error == 0) { LIST_FOREACH(pm, &po->po_pmcs, pm_next) if (pm->pm_flags & PMC_F_NEEDS_LOGFILE && @@ -2907,7 +2907,6 @@ pmc_syscall_handler(struct thread *td, void *syscall_args) } break; - /* * Flush a log file. */ @@ -2928,6 +2927,25 @@ pmc_syscall_handler(struct thread *td, void *syscall_args) break; /* + * Close a log file. + */ + + case PMC_OP_CLOSELOG: + { + struct pmc_owner *po; + + sx_assert(&pmc_sx, SX_XLOCKED); + + if ((po = pmc_find_owner_descriptor(td->td_proc)) == NULL) { + error = EINVAL; + break; + } + + error = pmclog_close(po); + } + break; + + /* * Retrieve hardware configuration. */ |