PAPI  5.3.2.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 64
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  struct perf_event_attr attr; /* perf_event config structure */
19  unsigned int wakeup_mode; /* wakeup mode when sampling */
21 
22 
23 typedef struct {
24  int num_events; /* number of events in control state */
25  unsigned int domain; /* control-state wide domain */
26  unsigned int granularity; /* granularity */
27  unsigned int multiplexed; /* multiplexing enable */
28  unsigned int overflow; /* overflow enable */
29  unsigned int inherit; /* inherit enable */
30  unsigned int overflow_signal; /* overflow signal */
31  int cidx; /* current component */
32  int cpu; /* which cpu to measure */
33  pid_t tid; /* thread we are monitoring */
35  long long counts[PERF_EVENT_MAX_MPX_COUNTERS];
36 } pe_control_t;
37 
38 
39 typedef struct {
40  int initialized; /* are we initialized? */
41  int state; /* are we opened and/or running? */
42  int cidx; /* our component id */
43  struct native_event_table_t *event_table; /* our event table */
44 } pe_context_t;
45 
46 int _pe_set_domain( hwd_control_state_t *ctl, int domain);
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:846
int _pe_stop(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: perf_event.c:1158
int _pe_reset(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: perf_event.c:860
#define PERF_EVENT_MAX_MPX_COUNTERS
Definition: perf_event_lib.h:5
unsigned int granularity
long long flags
Definition: iozone.c:12330
int _pe_set_domain(hwd_control_state_t *ctl, int domain)
Definition: perf_event.c:821
unsigned int wakeup_mode
uint32_t nr_mmap_pages
unsigned int domain
unsigned int overflow
int _pe_read(hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags)
Definition: perf_event.c:915
unsigned int multiplexed
char events[MAX_EVENTS][BUFSIZ]
struct native_event_table_t * event_table
int _pe_start(hwd_context_t *ctx, hwd_control_state_t *ctl)
Definition: perf_event.c:1114
unsigned int overflow_signal
int _pe_ctl(hwd_context_t *ctx, int code, _papi_int_option_t *option)
Definition: perf_event.c:1253
unsigned int inherit
int _pe_write(hwd_context_t *ctx, hwd_control_state_t *ctl, long long *from)
Definition: perf_event.c:885
pthread_attr_t attr
Definition: iozone.c:18466