PAPI  5.3.0.0
perf_event_lib.h
Go to the documentation of this file.
00001 /* Various definitions */
00002 
00003 /* This is arbitrary.  Typically you can add up to ~1000 before */
00004 /* you run out of fds                                           */
00005 #define PERF_EVENT_MAX_MPX_COUNTERS 64
00006 
00007 /* We really don't need fancy definitions for these */
00008 
00009 typedef struct
00010 {
00011   int group_leader_fd;            /* fd of group leader                   */
00012   int event_fd;                   /* fd of event                          */
00013   int event_opened;               /* event successfully opened            */
00014   uint32_t nr_mmap_pages;         /* number pages in the mmap buffer      */
00015   void *mmap_buf;                 /* used for control/profiling           */
00016   uint64_t tail;                  /* current read location in mmap buffer */
00017   uint64_t mask;                  /* mask used for wrapping the pages     */
00018   struct perf_event_attr attr;    /* perf_event config structure          */
00019   unsigned int wakeup_mode;       /* wakeup mode when sampling            */
00020 } pe_event_info_t;
00021 
00022 
00023 typedef struct {
00024   int num_events;                 /* number of events in control state */
00025   unsigned int domain;            /* control-state wide domain         */
00026   unsigned int granularity;       /* granularity                       */
00027   unsigned int multiplexed;       /* multiplexing enable               */
00028   unsigned int overflow;          /* overflow enable                   */
00029   unsigned int inherit;           /* inherit enable                    */
00030   unsigned int overflow_signal;   /* overflow signal                   */
00031   int cidx;                       /* current component                 */
00032   int cpu;                        /* which cpu to measure              */
00033   pid_t tid;                      /* thread we are monitoring          */
00034   pe_event_info_t events[PERF_EVENT_MAX_MPX_COUNTERS];
00035   long long counts[PERF_EVENT_MAX_MPX_COUNTERS];
00036 } pe_control_t;
00037 
00038 
00039 typedef struct {
00040   int initialized;                /* are we initialized?           */
00041   int state;                      /* are we opened and/or running? */
00042   int cidx;                       /* our component id              */
00043   struct native_event_table_t *event_table; /* our event table     */
00044 } pe_context_t;
00045 
00046 int _pe_set_domain( hwd_control_state_t *ctl, int domain);
00047 int _pe_shutdown_thread( hwd_context_t *ctx );
00048 int _pe_reset( hwd_context_t *ctx, hwd_control_state_t *ctl );
00049 int _pe_write( hwd_context_t *ctx, hwd_control_state_t *ctl,
00050             long long *from );
00051 int _pe_read( hwd_context_t *ctx, hwd_control_state_t *ctl,
00052            long long **events, int flags );
00053 int _pe_start( hwd_context_t *ctx, hwd_control_state_t *ctl );
00054 int _pe_stop( hwd_context_t *ctx, hwd_control_state_t *ctl );
00055 int _pe_ctl( hwd_context_t *ctx, int code, _papi_int_option_t *option );
00056 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines