Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pmc_configure_logfile(3) [freebsd man page]

PMC_CONFIGURE_LOGFILE(3)				   BSD Library Functions Manual 				  PMC_CONFIGURE_LOGFILE(3)

NAME
pmc_configure_logfile, pmc_flush_logfile, pmc_writelog, pmc_close_logfile -- log file management LIBRARY
Performance Counters Library (libpmc, -lpmc) SYNOPSIS
#include <pmc.h> int pmc_configure_logfile(int fd); int pmc_flush_logfile(void); int pmc_writelog(uint32_t userdata); int pmc_close_logfile(void); DESCRIPTION
The functions manage logging of hwpmc(4) events. Function pmc_configure_logfile() is used to turn on and turn off logging. If argument fd is a valid file handle returned by a prior call to open(2) or socket(2) then performance events will be logged to the file corresponding to the specified handle. If the value of argument fd is -1 then logging will be stopped after any pending data is flushed. Function pmc_flush_logfile() will force all log data queued inside the hwpmc(4) driver to be written out. Function pmc_writelog() will append a log entry containing the value of argument userdata to the log file. Function pmc_close_logfile() will flush all pending log data and close hwpmc(4)'s side of the stream. RETURN VALUES
Upon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
A call to pmc_configure_logfile() may fail with the following errors: [EAGAIN] The hwpmc(4) driver was not able to create a helper process due to system limits being reached. [EBUSY] Function pmc_configure_logfile() was called with a log file already configured. [EINVAL] Function pmc_configure_logfile() was called with an argument of -1 without a log file being previously configured. [ENOMEM] The system encountered a memory shortage when servicing this request. A call to pmc_flush_logfile() may fail with the following errors: [EINVAL] Function pmc_flush_logfile() was called without a log file being previously configured. A call to pmc_writelog() may fail with the following errors: [EINVAL] Function pmc_writelog() was called without a log file being previously configured. [ENOMEM] The system encountered a memory shortage when servicing this request. SEE ALSO
pmc(3), hwpmc(4) BSD
November 24, 2007 BSD

Check Out this Related Man Page

PMC_NAME_OF_CAPABILITY(3)				   BSD Library Functions Manual 				 PMC_NAME_OF_CAPABILITY(3)

NAME
pmc_name_of_capability, pmc_name_of_class, pmc_name_of_cputype, pmc_name_of_disposition, pmc_name_of_event, pmc_name_of_mode, pmc_name_of_state -- human readable names for numeric constants used by pmc(3) and hwpmc(4) LIBRARY
Performance Counters Library (libpmc, -lpmc) SYNOPSIS
#include <pmc.h> const char * pmc_name_of_capability(enum pmc_caps pc); const char * pmc_name_of_class(enum pmc_class pc); const char * pmc_name_of_cputype(enum pmc_cputype ct); const char * pmc_name_of_disposition(enum pmc_disp pd); const char * pmc_name_of_event(enum pmc_event pe); const char * pmc_name_of_mode(enum pmc_mode pm); const char * pmc_name_of_state(enum pmc_state ps); DESCRIPTION
These convenience functions translate numeric constants used by the Performance Counters Library (libpmc, -lpmc) to const char * pointers to human readable representations of their arguments. Function pmc_name_of_capability() translates a PMC capability flag given in argument pc to a human readable string. PMC capabilities are described in pmc(3). Function pmc_name_of_class() translates the PMC class value specified in argument pc to a human readable name. PMC classes are described in pmc(3). Function pmc_name_of_cputype() translates the CPU type value specified in argument ct to a human readable name. CPU types known to the library are described in pmc(3). Function pmc_name_of_disposition() translates the PMC row disposition specified in argument pd to a human readable name. PMC row disposi- tions are described in hwpmc(4). Function pmc_name_of_event() translates the PMC event number specified by argument pe to a string. PMC event names are documented in section EVENT SPECIFIERS of pmc(3). Function pmc_name_of_mode() translates the PMC mode specified by argument pm to a human readable string. PMC modes are described in pmc(3). Function pmc_name_of_state() translates the value of argument ps to a human readable name. IMPLEMENTATION NOTES
The returned pointers point to static storage inside the PMC library and should not be freed by the caller. RETURN VALUES
These functions return a non-NULL pointer on successful completion. In case of an error, a NULL pointer is returned and the global variable errno is set to indicate the error. ERRORS
A call to these functions may fail with the following errors: [EINVAL] The function argument specified an invalid value. SEE ALSO
pmc(3), pmc_cpuinfo(3), pmc_pmcinfo(3), hwpmc(4) BSD
November 24, 2007 BSD
Man Page