PAPIC:papi vector t
From PAPIDocs
Jump to: navigation, search

The papi_vector_t Structure

A separate instance of this structure is declared for each component. When a component is included in the build process, a reference to it is conditionally included in a table of components for reference by the PAPI Framework. All access to the component is done through the vector structure.

This structure includes a section of parameters setting exposed to the user; a small section defining private data structure sizes for use by PAPI in allocating space and traversing arrays; and a table of pointers to functions that actually perform the operations unique to the Component.

Structure Definition

The words in bold link to pages that provide more detailed descriptions of the named structures or function calls.

/* Vector Table Stuff */
typedef struct papi_vectors {
/* Substrate specific data structure */
   PAPI_component_info_t   cmp_info; /* See definition in papi.h */
/* Substrate specific structure sizes*/
   cmp_struct_sizes_t size;
/* List of exposed function pointers for this component */
   void 	(*dispatch_timer)		(int, hwd_siginfo_t *, void *);
   void *	(*get_overflow_address)	(int, char *, int);
   int		(*start)			(hwd_context_t *, hwd_control_state_t *);
   int		(*stop)			(hwd_context_t *, hwd_control_state_t *);
   int		(*read)			(hwd_context_t *, hwd_control_state_t *, long long **, int);
   int		(*reset)			(hwd_context_t *, hwd_control_state_t *);
   int		(*write)			(hwd_context_t *, hwd_control_state_t *, long long[]);
   long long	(*get_real_cycles)	(void);
   long long	(*get_real_usec)		(void);
   long long	(*get_virt_cycles)	(const hwd_context_t *);
   long long	(*get_virt_usec)		(const hwd_context_t *);
   int		(*stop_profiling)		(ThreadInfo_t *, EventSetInfo_t *);
   int		(*init_substrate)		(int);
   int		(*init)			(hwd_context_t *);
   int		(*init_control_state)	(hwd_control_state_t * ptr);
   int		(*update_shlib_info)	(void);
   int		(*get_system_info)	(void);
   int		(*get_memory_info)	(PAPI_hw_info_t *, int);
   int		(*update_control_state)	(hwd_control_state_t *, NativeInfo_t *, int, hwd_context_t *);
   int		(*ctl)			(hwd_context_t *, int , _papi_int_option_t *);
   int		(*set_overflow)		(EventSetInfo_t *, int, int);
   int		(*set_profile)		(EventSetInfo_t *, int, int);
   int		(*add_prog_event)	(hwd_control_state_t *, unsigned int, void *, EventInfo_t *);
   int		(*set_domain)		(hwd_control_state_t *, int);
   int		(*ntv_enum_events)	(unsigned int *, int);
   int		(*ntv_name_to_code)	(char *, unsigned int *);
   int		(*ntv_code_to_name)	(unsigned int, char *, int);
   int		(*ntv_code_to_descr)	(unsigned int, char *, int);
   int		(*ntv_code_to_bits)	(unsigned int, hwd_register_t *);
   int		(*ntv_bits_to_info)	(hwd_register_t *, char *, unsigned int *, int, int);
   int		(*allocate_registers)	(EventSetInfo_t *);
   int		(*bpt_map_avail)		(hwd_reg_alloc_t *, int);
   void 	(*bpt_map_set)		(hwd_reg_alloc_t *, int);
   int		(*bpt_map_exclusive)	(hwd_reg_alloc_t *);
   int		(*bpt_map_shared)	(hwd_reg_alloc_t *, hwd_reg_alloc_t *);
   void 	(*bpt_map_preempt)	(hwd_reg_alloc_t *, hwd_reg_alloc_t *);
   void 	(*bpt_map_update)	(hwd_reg_alloc_t *, hwd_reg_alloc_t *);
   int		(*get_dmem_info)	(PAPI_dmem_info_t *);
   int		(*shutdown)		(hwd_context_t *);
   int		(*shutdown_global)	(void);
   int		(*user)			(int, void *, void *);