PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
perf_event_lib.h
Go to the documentation of this file.
1 /* Various definitions */
2 
3 /* This is arbitrary. Typically you can add up to ~1000 before */
4 /* you run out of fds */
5 #define PERF_EVENT_MAX_MPX_COUNTERS 128
6 
7 /* We really don't need fancy definitions for these */
8 
9 typedef struct
10 {
11  int group_leader_fd; /* fd of group leader */
12  int event_fd; /* fd of event */
13  int event_opened; /* event successfully opened */
14  uint32_t nr_mmap_pages; /* number pages in the mmap buffer */
15  void *mmap_buf; /* used for control/profiling */
16  uint64_t tail; /* current read location in mmap buffer */
17  uint64_t mask; /* mask used for wrapping the pages */
18  int cpu; /* cpu associated with this event */
19  struct perf_event_attr attr; /* perf_event config structure */
20  unsigned int wakeup_mode; /* wakeup mode when sampling */
22 
23 
24 typedef struct {
25  int num_events; /* number of events in control state */
26  unsigned int domain; /* control-state wide domain */
27  unsigned int granularity; /* granularity */
28  unsigned int multiplexed; /* multiplexing enable */
29  unsigned int overflow; /* overflow enable */
30  unsigned int inherit; /* inherit enable */
31  unsigned int overflow_signal; /* overflow signal */
32  int cidx; /* current component */
33  int cpu; /* which cpu to measure */
34  pid_t tid; /* thread we are monitoring */
36  long long counts[PERF_EVENT_MAX_MPX_COUNTERS];
37 } pe_control_t;
38 
39 
40 typedef struct {
41  int initialized; /* are we initialized? */
42  int state; /* are we opened and/or running? */
43  int cidx; /* our component id */
44  struct native_event_table_t *event_table; /* our event table */
45 } pe_context_t;
46 
50  long long *from );
52  long long **events, int flags );
55 int _pe_ctl( hwd_context_t *ctx, int code, _papi_int_option_t *option );
56 
int _pe_shutdown_thread(hwd_context_t *ctx)
Definition: perf_event.c:861
int _pe_stop(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: perf_event.c:1176
int _pe_reset(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: perf_event.c:875
#define PERF_EVENT_MAX_MPX_COUNTERS
Definition: perf_event_lib.h:5
unsigned int granularity
long long flags
Definition: iozone.c:12330
unsigned int wakeup_mode
uint32_t nr_mmap_pages
unsigned int domain
char events[MAX_EVENTS][BUFSIZ]
unsigned int overflow
int _pe_read(hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
Definition: perf_event.c:930
unsigned int multiplexed
struct native_event_table_t * event_table
int _pe_start(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: perf_event.c:1132
unsigned int overflow_signal
int _pe_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
Definition: perf_event.c:1337
unsigned int inherit
int _pe_write(hwd_context_t *ctx, hwd_control_state_t *ctl, long long *from)
Definition: perf_event.c:900
pthread_attr_t attr
Definition: iozone.c:18466