19 #define L4STAT_ERR_OK 0 20 #define L4STAT_ERR_EINVAL -1 21 #define L4STAT_ERR_ERROR -2 22 #define L4STAT_ERR_TOOMANY -3 23 #define L4STAT_ERR_IMPLEMENTED -4 26 void l4stat_register_drv (
void);
28 extern int l4stat_counter_print(
unsigned int counter);
33 #define CCTRL_NCPU (0xf << CCTRL_NCPU_BIT) 34 #define CCTRL_NCNT_L3STAT (0x1ff << CCTRL_NCNT_BIT) 35 #define CCTRL_NCNT (0x1f << CCTRL_NCNT_BIT) 36 #define CCTRL_MC (0x1 << CCTRL_MC_BIT) 37 #define CCTRL_IA (0x1 << CCTRL_IA_BIT) 38 #define CCTRL_DS (0x1 << CCTRL_DS_BIT) 39 #define CCTRL_EE (0x1 << CCTRL_EE_BIT) 40 #define CCTRL_AE (0x1 << CCTRL_AE_BIT) 41 #define CCTRL_EL (0x1 << CCTRL_EL_BIT) 42 #define CCTRL_CD (0x1 << CCTRL_CD_BIT) 43 #define CCTRL_SU (0x3 << CCTRL_SU_BIT) 44 #define CCTRL_CL (0x1 << CCTRL_CL_BIT) 45 #define CCTRL_EN (0x1 << CCTRL_EN_BIT) 46 #define CCTRL_EVENTID (0xff << CCTRL_EVENTID_BIT) 47 #define CCTRL_CPUAHBM (0xf << CCTRL_CPUAHBM_BIT) 49 #define CCTRL_NCPU_BIT 28 50 #define CCTRL_NCNT_BIT 23 51 #define CCTRL_MC_BIT 22 52 #define CCTRL_IA_BIT 21 53 #define CCTRL_DS_BIT 20 54 #define CCTRL_EE_BIT 19 55 #define CCTRL_AE_BIT 18 56 #define CCTRL_EL_BIT 17 57 #define CCTRL_CD_BIT 16 58 #define CCTRL_SU_BIT 14 59 #define CCTRL_CL_BIT 13 60 #define CCTRL_EN_BIT 12 61 #define CCTRL_EVENTID_BIT 4 62 #define CCTRL_CPUAHBM_BIT 0 64 #define L4STAT_OPTIONS_EVENT_LEVEL_ENABLE CCTRL_EL 65 #define L4STAT_OPTIONS_EVENT_LEVEL_DISABLE 0 66 #define L4STAT_OPTIONS_MAXIMUM_DURATION CCTRL_CD 67 #define L4STAT_OPTIONS_SUPERVISOR_MODE_FILTER (0x1 << CCTRL_SU_BIT) 68 #define L4STAT_OPTIONS_USER_MODE_FILTER (0x2 << CCTRL_SU_BIT) 69 #define L4STAT_OPTIONS_NO_FILTER 0 70 #define L4STAT_OPTIONS_CLEAR_ON_READ CCTRL_CL 72 extern int l4stat_counter_enable(
unsigned int counter,
int event,
int cpu,
int options);
73 extern int l4stat_counter_disable(
unsigned int counter);
74 extern int l4stat_counter_set(
unsigned int counter, uint32_t val);
75 extern int l4stat_counter_get(
unsigned int counter, uint32_t *val);
77 static inline int l4stat_counter_clear(
unsigned int counter)
79 return l4stat_counter_set(counter, 0);
82 extern int l4stat_counter_max_set(
unsigned int counter, uint32_t val);
83 extern int l4stat_counter_max_get(
unsigned int counter, uint32_t *val);
84 extern int l4stat_tstamp_set(uint32_t val);
85 extern int l4stat_tstamp_get(uint32_t *val);