1LIBPFM(3) Linux Programmer's Manual LIBPFM(3)
2
3
4
6 pfm_set_options - set performance monitoring library debug options
7
9 #include <perfmon/pfmlib.h>
10
11 int pfm_set_options(pfmlib_options_t *opt);
12
13
15 This function can be called at any time to adjust the level of debug of
16 the library. In both cases, extra output will be generated on standard
17 error when the library gets called. This can be useful to figure out
18 how the PMC registers are initialized for instance.
19
20 The opt argument to this function is a pointer to a pfmlib_options_t
21 structure which is defined as follows:
22
23 typedef struct {
24 unsigned int pfm_debug:1;
25 unsigned int pfm_verbose:1;
26 } pfmlib_options_t;
27
28
29 Setting pfm_debug to 1 will enable debug messages whereas setting
30 pfm_verbose will enable verbose messages.
31
32
34 Setting library options with this function has lower priority than with
35 environment variables. As such, the call to this function may not have
36 any actual effects. A user can set the following environment variables
37 to control verbosity and debug output:
38
39 LIBPFM_VERBOSE
40 Enable verbose output. Value must be 0 or 1. When not set, ver‐
41 bosity level can be controlled with this function.
42
43 LIBPFM_DEBUG
44 Enable debug output. Value must be 0 or 1. When not set, debug
45 level can be controlled with this function.
46
48 The function returns whether or not it was successful. A return value
49 of PFMLIB_SUCCESS indicates success, otherwise the value is the error
50 code.
51
52 When environment variables exist, they take precedence and this func‐
53 tion returns PFMLIB_SUCCESS.
54
56 PFMLIB_ERR_INVAL
57 the argument is invalid, most likely a NULL pointer.
58
60 Stephane Eranian <eranian@hpl.hp.com>
61
62 November, 2003 LIBPFM(3)