1PAPI_set_debug(3)                    PAPI                    PAPI_set_debug(3)
2
3
4

NAME

6       PAPI_set_debug - set the current debug level for PAPI
7
8

SYNOPSIS

10       C Interface
11       #include <papi.h>
12       int PAPI_set_debug(int debuglevel);
13       Fortran Interface
14       #include fpapi.h
15       PAPIF_set_debug(C_INT debug, C_INT check)
16
17

DESCRIPTION

19       PAPI_set_debug  sets  the  debug  level  for error output from the PAPI
20       library.
21
22

ARGUMENTS

24       debuglevel -- one of the constants shown in the table below and defined
25       in the papi.h header file.  The current debug level is used by both the
26       internal error and debug message handler subroutines. The debug handler
27       is  only  used if the library was compiled with -DDEBUG. The debug han‐
28       dler is called when there is an error upon a call to the PAPI API.  The
29       error  handler  is  always  active and it's behavior cannot be modified
30       except for whether or not it prints anything. NOTE: This  is  the  ONLY
31       function that may be called BEFORE PAPI_library_init().
32
33       The PAPI error handler prints out messages in the following form:
34
35       PAPI Error: message.
36
37       The  default  PAPI  debug  handler prints out messages in the following
38       form:
39
40       PAPI Error: Error Code code,symbol,description
41
42       If the error was caused from a system  call  and  the  return  code  is
43       PAPI_ESYS,  the message will have a colon space and the error string as
44       reported by strerror() appended to the end.
45
46       The possible debug levels for debugging are shown in the table below.
47
48       ┌────────────────┬───────────────────────────────────────────────────┐
49PAPI_QUIET      │ Do not print anything, just return the error code │
50       ├────────────────┼───────────────────────────────────────────────────┤
51PAPI_VERB_ECONT │ Print error message and continue                  │
52       ├────────────────┼───────────────────────────────────────────────────┤
53PAPI_VERB_ESTOP │ Print error message and exit                      │
54       └────────────────┴───────────────────────────────────────────────────┘
55

RETURN VALUES

57       On success, this function returns PAPI_OK.
58        On error, a non-zero error code is returned.
59
60

ERRORS

62       PAPI_EINVAL
63              The debuglevel is invalid.
64
65

EXAMPLES

67         if ( PAPI_set_debug(PAPI_VERB_ECONT) != PAPI_OK )
68            handle_error();
69
70

BUGS

72       This function has no known bugs.
73
74

SEE ALSO

76       PAPI_set_opt(3), PAPI_get_opt(3), PAPI_library_init(3)
77
78
79
80
81PAPI Programmer's Reference     September, 2004              PAPI_set_debug(3)
Impressum