1PAPI_state(3)                        PAPI                        PAPI_state(3)
2
3
4

NAME

6       PAPI_state - return the counting state of an EventSet
7
8

SYNOPSIS

10       C Interface
11       #include <papi.h>
12       int PAPI_state (int EventSet, int *status);
13       Fortran Interface
14       #include fpapi.h
15       PAPIF_state(C_INT EventSet, C_INT status, C_INT check)
16
17

DESCRIPTION

19       PAPI_state() returns the counting state of the specified event set.
20
21

ARGUEMENTS

23       EventSet  --   an  integer  handle  for  a PAPI event set as created by
24       PAPI_create_eventset(3)
25
26       status -- an integer containing a boolean combination of one or more of
27       the  following  nonzero  constants  as  defined in the PAPI header file
28       papi.h:
29
30
31       ┌──────────────────┬──────────────────────────────────────────────┐
32PAPI_STOPPED      │ EventSet is stopped                          │
33       ├──────────────────┼──────────────────────────────────────────────┤
34PAPI_RUNNING      │ EventSet is running                          │
35       ├──────────────────┼──────────────────────────────────────────────┤
36PAPI_PAUSED       │ EventSet temporarily disabled by the library │
37       ├──────────────────┼──────────────────────────────────────────────┤
38PAPI_NOT_INIT     │ EventSet defined, but not initialized        │
39       ├──────────────────┼──────────────────────────────────────────────┤
40PAPI_OVERFLOWING  │ EventSet has overflowing enabled             │
41       ├──────────────────┼──────────────────────────────────────────────┤
42PAPI_PROFILING    │ EventSet has profiling enabled               │
43       ├──────────────────┼──────────────────────────────────────────────┤
44PAPI_MULTIPLEXING │ EventSet has multiplexing enabled            │
45       ├──────────────────┼──────────────────────────────────────────────┤
46PAPI_ACCUMULATING │ reserved for future use                      │
47       ├──────────────────┼──────────────────────────────────────────────┤
48PAPI_HWPROFILING  │ reserved for future use                      │
49       └──────────────────┴──────────────────────────────────────────────┘
50

RETURN VALUES

52       On success, this function returns PAPI_OK.
53        On error, a non-zero error code is returned.
54
55

ERRORS

57       PAPI_EINVAL
58              One or more of the arguments is invalid.
59
60       PAPI_ENOEVST
61              The EventSet specified does not exist.
62
63

EXAMPLES

65       int EventSet = PAPI_NULL;
66       int status = 0;
67
68       if (PAPI_create_eventset(&EventSet) != PAPI_OK)
69         handle_error(1);
70
71       /* Add Total Instructions Executed to our EventSet */
72
73       if (PAPI_add_event(EventSet, PAPI_TOT_INS) != PAPI_OK)
74         handle_error(1);
75
76       /* Start counting */
77
78       if (PAPI_state(EventSet, &status) != PAPI_OK)
79         handle_error(1);
80
81       printf("State is now %d\n",status);
82
83       if (PAPI_start(EventSet) != PAPI_OK)
84         handle_error(1);
85
86       if (PAPI_state(EventSet, &status) != PAPI_OK)
87         handle_error(1);
88
89       printf("State is now %d\n",status);
90
91

BUGS

93       This function has no known bugs.
94
95

SEE ALSO

97       PAPI_start(3), PAPI_stop(3)
98
99
100
101PAPI Programmer's Reference     September, 2004                  PAPI_state(3)
Impressum