PAPIC:PAPI get component info.3
From PAPIDocs
Jump to: navigation, search


  • PAPI_get_component_info - get information about a specific software component


C Interface

#include <papi.h>
const PAPI_component_info_t *PAPI_get_component_info(int  cidx );

Fortran Interface



This function returns a pointer to a structure containing detailed information about a specific software component in the PAPI library. This includes versioning information, preset and native event information, and more. For full details, see the structure listing below.




If called before the behavior of the routine is undefined.


 const PAPI_component_info_t *cmpinfo = NULL;
if ((cmpinfo = PAPI_get_component_info(0)) == NULL)
printf("This component supports %d Preset Events and %d Native events.\n",
cmpinfo->num_preset_events, cmpinfo->num_native_events);


The C data structure returned by this function is found in papi.h and reproduced below:

typedef struct _papi_component_option {
char name[PAPI_MAX_STR_LEN];		/* Name of the component we're using, usually CVS RCS Id */
char version[PAPI_MIN_STR_LEN];		/* Version of this component, usually CVS Revision */
char support_version[PAPI_MIN_STR_LEN];	/* Version of the support library */
char kernel_version[PAPI_MIN_STR_LEN];	/* Version of the kernel PMC support driver */
int CmpIdx;				/* Index into the vector array for this component; set at init time */
int num_cntrs;				/* Number of hardware counters the substrate supports */
int num_mpx_cntrs;				/* Number of multiplexed hardware counters the substrate or PAPI support: PAPI_MPX_DEF_DEG */
int num_preset_events;			/* Number of preset events the substrate supports */
int num_native_events;			/* Number of native events the substrate supports */
int default_domain;			/* The default domain when this substrate is used: PAPI_DOM_USER */
int available_domains;			/* Available domains; default: .default_domain */
int default_granularity;			/* The default granularity when this substrate is used: PAPI_GRN_THR */
int available_granularities;		/* Available granularities; default:.default_granularity */
int hardware_intr_sig;			/* Signal used by hardware to deliver PMC events: PAPI_SIGNAL */
int opcode_match_width;			/* Width of opcode matcher if exists, 0 if not */
int reserved_ints[4];
unsigned int hardware_intr:1;		/* hw overflow intr, does not need to be emulated in software*/
unsigned int precise_intr:1;		/* Performance interrupts happen precisely */
unsigned int posix1b_timers:1;		/* Using POSIX 1b interval timers (timer_create) instead of setitimer */
unsigned int kernel_profile:1;		/* Has kernel profiling support (buffered interrupts or sprofil-like) */
unsigned int kernel_multiplex:1;		/* In kernel multiplexing */
unsigned int data_address_range:1;		/* Supports data address range limiting */
unsigned int instr_address_range:1;	/* Supports instruction address range limiting */
unsigned int fast_counter_read:1;		/* Supports a user level PMC read instruction */
unsigned int fast_real_timer:1;		/* Supports a fast real timer */
unsigned int fast_virtual_timer:1;		/* Supports a fast virtual timer */
unsigned int attach:1;			/* Supports attach */
unsigned int attach_must_ptrace:1;		/* Attach must first ptrace and stop the thread/process*/
unsigned int edge_detect:1;		/* Supports edge detection on events */
unsigned int invert:1;			/* Supports invert detection on events */
unsigned int profile_ear:1;		/* Supports data/instr/tlb miss address sampling */
unsigned int grouped_cntrs:1;		/* Underlying hardware uses counter groups */
unsigned int reserved_bits:16;
} PAPI_component_info_t;

See Also

PAPI_get_executable_info(3), PAPI_get_hardware_info(3), PAPI_get_dmem_info(3), PAPI_get_opt(3), PAPI_library_init(3)