PAPI  5.0.1.0
papi.c File Reference

Most of the low-level API is here. More...

Include dependency graph for papi.c:

Go to the source code of this file.

Defines

#define papi_return(a)

Functions

static int valid_component (int cidx)
static int valid_ESI_component (EventSetInfo_t *ESI)
int PAPI_thread_init (unsigned long int(*id_fn)(void))
unsigned long PAPI_thread_id (void)
int PAPI_register_thread (void)
int PAPI_unregister_thread (void)
int PAPI_list_threads (PAPI_thread_id_t *tids, int *number)
int PAPI_get_thr_specific (int tag, void **ptr)
int PAPI_set_thr_specific (int tag, void *ptr)
int PAPI_library_init (int version)
int PAPI_query_event (int EventCode)
int PAPI_query_named_event (char *EventName)
const PAPI_component_info_tPAPI_get_component_info (int cidx)
int PAPI_get_event_info (int EventCode, PAPI_event_info_t *info)
int PAPI_event_code_to_name (int EventCode, char *out)
int PAPI_event_name_to_code (char *in, int *out)
int PAPI_enum_event (int *EventCode, int modifier)
int PAPI_enum_cmp_event (int *EventCode, int modifier, int cidx)
int PAPI_create_eventset (int *EventSet)
int PAPI_assign_eventset_component (int EventSet, int cidx)
int PAPI_add_event (int EventSet, int EventCode)
int PAPI_remove_event (int EventSet, int EventCode)
int PAPI_add_named_event (int EventSet, char *EventName)
int PAPI_remove_named_event (int EventSet, char *EventName)
int PAPI_destroy_eventset (int *EventSet)
int PAPI_start (int EventSet)
int PAPI_stop (int EventSet, long long *values)
int PAPI_reset (int EventSet)
int PAPI_read (int EventSet, long long *values)
int PAPI_read_ts (int EventSet, long long *values, long long *cycles)
int PAPI_accum (int EventSet, long long *values)
int PAPI_write (int EventSet, long long *values)
int PAPI_cleanup_eventset (int EventSet)
int PAPI_multiplex_init (void)
int PAPI_state (int EventSet, int *status)
int PAPI_set_debug (int level)
static int _papi_set_attach (int option, int EventSet, unsigned long tid)
int PAPI_attach (int EventSet, unsigned long tid)
int PAPI_detach (int EventSet)
int PAPI_set_multiplex (int EventSet)
int PAPI_set_opt (int option, PAPI_option_t *ptr)
int PAPI_num_hwctrs (void)
int PAPI_num_cmp_hwctrs (int cidx)
int PAPI_get_multiplex (int EventSet)
int PAPI_get_opt (int option, PAPI_option_t *ptr)
int PAPI_get_cmp_opt (int option, PAPI_option_t *ptr, int cidx)
int PAPI_num_components (void)
int PAPI_num_events (int EventSet)
void PAPI_shutdown (void)
char * PAPI_strerror (int errorCode)
void PAPI_perror (char *msg)
int PAPI_overflow (int EventSet, int EventCode, int threshold, int flags, PAPI_overflow_handler_t handler)
int PAPI_sprofil (PAPI_sprofil_t *prof, int profcnt, int EventSet, int EventCode, int threshold, int flags)
int PAPI_profil (void *buf, unsigned bufsiz, caddr_t offset, unsigned scale, int EventSet, int EventCode, int threshold, int flags)
int PAPI_set_granularity (int granularity)
int PAPI_set_cmp_granularity (int granularity, int cidx)
int PAPI_set_domain (int domain)
int PAPI_set_cmp_domain (int domain, int cidx)
int PAPI_add_events (int EventSet, int *Events, int number)
int PAPI_remove_events (int EventSet, int *Events, int number)
int PAPI_list_events (int EventSet, int *Events, int *number)
int PAPI_get_dmem_info (PAPI_dmem_info_t *dest)
const PAPI_exe_info_tPAPI_get_executable_info (void)
const PAPI_shlib_info_tPAPI_get_shared_lib_info (void)
const PAPI_hw_info_tPAPI_get_hardware_info (void)
long long PAPI_get_real_cyc (void)
long long PAPI_get_real_nsec (void)
long long PAPI_get_real_usec (void)
long long PAPI_get_virt_cyc (void)
long long PAPI_get_virt_nsec (void)
long long PAPI_get_virt_usec (void)
int PAPI_lock (int lck)
int PAPI_unlock (int lck)
int PAPI_is_initialized (void)
int PAPI_get_overflow_event_index (int EventSet, long long overflow_vector, int *array, int *number)
int PAPI_get_event_component (int EventCode)
int PAPI_get_component_index (char *name)
int PAPI_disable_component (int cidx)
int PAPI_disable_component_by_name (char *name)

Variables

static int init_retval = 0xdedbeef

Detailed Description

Author:
: Philip Mucci mucci@cs.utk.edu
dan terpstra terpstra@cs.utk.edu
Min Zhou min@cs.utk.edu
Kevin London london@cs.utk.edu
Per Ekman pek@pdc.kth.se Mods: Gary Mohr gary.mohr@bull.com

Definition in file papi.c.


Define Documentation

#define papi_return (   a)
Value:
do { \
    int b = a; \
    if (b != PAPI_OK) {\
        _papi_hwi_errno = b;\
    } \
    return(b);\
} while(0)

Definition at line 54 of file papi.c.


Function Documentation

static int _papi_set_attach ( int  option,
int  EventSet,
unsigned long  tid 
) [inline, static]

Definition at line 3013 of file papi.c.

{
    PAPI_option_t attach;

    memset( &attach, 0x0, sizeof ( attach ) );
    attach.attach.eventset = EventSet;
    attach.attach.tid = tid;
    return ( PAPI_set_opt( option, &attach ) );
}

Here is the call graph for this function:

Here is the caller graph for this function:

int PAPI_num_hwctrs ( void  )

return the number of hardware counters for the cpu. for backward compatibility. Don't use!

Definition at line 3783 of file papi.c.

{
    return ( PAPI_num_cmp_hwctrs( 0 ) );
}

Here is the call graph for this function:

Here is the caller graph for this function:

int PAPI_thread_init ( unsigned long int(*)(void)  id_fn)

< PAPI hasn't been initialized yet

< No error

< No error

< No error

< No error

Definition at line 117 of file papi.c.

{
    /* Thread support not implemented on Alpha/OSF because the OSF pfm
     * counter device driver does not support per-thread counters.
     * When this is updated, we can remove this if statement
     */
    if ( init_level == PAPI_NOT_INITED )
        papi_return( PAPI_ENOINIT );

    if ( ( init_level & PAPI_THREAD_LEVEL_INITED ) )
        papi_return( PAPI_OK );

    init_level |= PAPI_THREAD_LEVEL_INITED;
    papi_return( _papi_hwi_set_thread_id_fn( id_fn ) );
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int valid_component ( int  cidx) [inline, static]

< Component Index isn't set

Definition at line 80 of file papi.c.

{
    if ( _papi_hwi_invalid_cmp( cidx ) )
        return ( PAPI_ENOCMP );
    return ( cidx );
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int valid_ESI_component ( EventSetInfo_t ESI) [inline, static]

Definition at line 88 of file papi.c.

{
    return ( valid_component( ESI->CmpIdx ) );
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

int init_retval = 0xdedbeef [static]

Definition at line 77 of file papi.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines