PAPI  5.0.1.0
linux-bgq-common.c File Reference

This file is part of the source code for a component that enables PAPI-C to access hardware monitoring counters for BG/Q through the bgpm library. More...

Include dependency graph for linux-bgq-common.c:

Go to the source code of this file.

Functions

void _check_BGPM_error (int err, char *bgpmfunc)
long long _common_getEventValue (unsigned event_id, int EventGroup)
void _common_deleteRecreate (int *EventGroup_ptr)
void _common_rebuildEventgroup (int count, int *EventGroup_local, int *EventGroup_ptr)

Detailed Description

CVS: $Id$

Author:
Heike Jagode jagode@eecs.utk.edu Mods: <your name="" here>=""> <your email="" address>=""> BGPM component

Tested version of bgpm (early access)

Definition in file linux-bgq-common.c.


Function Documentation

void _check_BGPM_error ( int  err,
char *  bgpmfunc 
)

Definition at line 28 of file linux-bgq-common.c.

{
    if ( err < 0 ) {
#ifdef DEBUG_BGPM
        printf ( "Error: ret value is %d for BGPM API function '%s'.\n",
                 err, bgpmfunc);
#endif
    }
}
void _common_deleteRecreate ( int *  EventGroup_ptr)

Definition at line 59 of file linux-bgq-common.c.

{
#ifdef DEBUG_BGQ
    printf( _AT_ " _common_deleteRecreate: *EventGroup_ptr=%d\n", *EventGroup_ptr);
#endif
    int retval;
    
    // delete previous bgpm eventset
    retval = Bgpm_DeleteEventSet( *EventGroup_ptr );
    CHECK_BGPM_ERROR( retval, "Bgpm_DeleteEventSet" );
    
    // create a new empty bgpm eventset
    *EventGroup_ptr = Bgpm_CreateEventSet();
    CHECK_BGPM_ERROR( *EventGroup_ptr, "Bgpm_CreateEventSet" );

#ifdef DEBUG_BGQ
    printf( _AT_ " _common_deleteRecreate: *EventGroup_ptr=%d\n", *EventGroup_ptr);
#endif  
}

Here is the caller graph for this function:

long long _common_getEventValue ( unsigned  event_id,
int  EventGroup 
)

Definition at line 43 of file linux-bgq-common.c.

{   
    uint64_t value;
    int retval;
    
    retval = Bgpm_ReadEvent( EventGroup, event_id, &value );
    CHECK_BGPM_ERROR( retval, "Bgpm_ReadEvent" );
    
    return ( ( long_long ) value ); 
}

Here is the caller graph for this function:

void _common_rebuildEventgroup ( int  count,
int *  EventGroup_local,
int *  EventGroup_ptr 
)

Definition at line 84 of file linux-bgq-common.c.

{
#ifdef DEBUG_BGQ
    printf( "_common_rebuildEventgroup\n" );
#endif  
    int i, retval;
    
    // rebuild BGPM EventGroup
    for ( i = 0; i < count; i++ ) {
        retval = Bgpm_AddEvent( *EventGroup_ptr, EventGroup_local[i] );
        CHECK_BGPM_ERROR( retval, "Bgpm_AddEvent" );
    
#ifdef DEBUG_BGQ
        printf( "_common_rebuildEventgroup: After emptying EventGroup, event re-added: %d\n",
                EventGroup_local[i] );
#endif
    }
}

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines