diff options
| author | Fabien Thomas <fabient@FreeBSD.org> | 2012-01-03 16:35:00 +0000 |
|---|---|---|
| committer | Fabien Thomas <fabient@FreeBSD.org> | 2012-01-03 16:35:00 +0000 |
| commit | d34684c2d5470dc8526494c58c893088c782cda4 (patch) | |
| tree | 0e33191851ae6bdb219a17501952c671332bace8 /lib/libpmc | |
| parent | c7c870a4b0716c512a3c1d38e4dd28eaf8964880 (diff) | |
Notes
Diffstat (limited to 'lib/libpmc')
| -rw-r--r-- | lib/libpmc/libpmc.c | 6 | ||||
| -rw-r--r-- | lib/libpmc/pmc.3 | 4 | ||||
| -rw-r--r-- | lib/libpmc/pmc.h | 1 | ||||
| -rw-r--r-- | lib/libpmc/pmc_configure_logfile.3 | 11 |
4 files changed, 21 insertions, 1 deletions
diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c index 66609839dac1..efdabc824adf 100644 --- a/lib/libpmc/libpmc.c +++ b/lib/libpmc/libpmc.c @@ -2596,6 +2596,12 @@ pmc_flush_logfile(void) } int +pmc_close_logfile(void) +{ + return (PMC_CALL(CLOSELOG,0)); +} + +int pmc_get_driver_stats(struct pmc_driverstats *ds) { struct pmc_op_getdriverstats gms; diff --git a/lib/libpmc/pmc.3 b/lib/libpmc/pmc.3 index 2403e64686bb..2431080a32a9 100644 --- a/lib/libpmc/pmc.3 +++ b/lib/libpmc/pmc.3 @@ -322,6 +322,10 @@ to write logged events to. Flush all pending log data in .Xr hwpmc 4 Ns Ap s buffers. +.It Fn pmc_close_logfile +Flush all pending log data and close +.Xr hwpmc 4 Ns Ap s +side of the stream. .It Fn pmc_writelog Append arbitrary user data to the current log file. .El diff --git a/lib/libpmc/pmc.h b/lib/libpmc/pmc.h index 5b1ad07c339a..2be88b121d3c 100644 --- a/lib/libpmc/pmc.h +++ b/lib/libpmc/pmc.h @@ -76,6 +76,7 @@ int pmc_attach(pmc_id_t _pmcid, pid_t _pid); int pmc_capabilities(pmc_id_t _pmc, uint32_t *_caps); int pmc_configure_logfile(int _fd); int pmc_flush_logfile(void); +int pmc_close_logfile(void); int pmc_detach(pmc_id_t _pmcid, pid_t _pid); int pmc_disable(int _cpu, int _pmc); int pmc_enable(int _cpu, int _pmc); diff --git a/lib/libpmc/pmc_configure_logfile.3 b/lib/libpmc/pmc_configure_logfile.3 index a33688c222c0..399f21a7c542 100644 --- a/lib/libpmc/pmc_configure_logfile.3 +++ b/lib/libpmc/pmc_configure_logfile.3 @@ -29,7 +29,8 @@ .Sh NAME .Nm pmc_configure_logfile , .Nm pmc_flush_logfile , -.Nm pmc_writelog +.Nm pmc_writelog , +.Nm pmc_close_logfile .Nd log file management .Sh LIBRARY .Lb libpmc @@ -41,6 +42,8 @@ .Fn pmc_flush_logfile void .Ft int .Fn pmc_writelog "uint32_t userdata" +.Ft int +.Fn pmc_close_logfile void .Sh DESCRIPTION The functions manage logging of .Xr hwpmc 4 @@ -72,6 +75,12 @@ Function will append a log entry containing the value of argument .Fa userdata to the log file. +.Pp +Function +.Fn pmc_close_logfile +will flush all pending log data and close +.Xr hwpmc 4 Ns Ap s +side of the stream. .Sh RETURN VALUES .Rv -std .Sh ERRORS |
