Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/papi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ PAPI_event_code_to_name( int EventCode, char *out )
return PAPI_ENOEVNT;
}
if ( _papi_hwd[compIdx]->cmp_info.disabled == PAPI_EDELAY_INIT ) {
int junk;
unsigned int junk;
_papi_hwd[compIdx]->ntv_enum_events(&junk, PAPI_ENUM_FIRST);
}

Expand Down Expand Up @@ -1631,7 +1631,7 @@ PAPI_event_name_to_code( const char *in, int *out )
*out = ( int ) ( (i + _papi_hwi_start_idx[cmpnt]) | PAPI_PRESET_MASK );

if ( _papi_hwd[cmpnt]->cmp_info.disabled == PAPI_EDELAY_INIT ) {
int junk;
unsigned int junk;
_papi_hwd[cmpnt]->ntv_enum_events(&junk, PAPI_ENUM_FIRST);
}

Expand Down Expand Up @@ -1819,7 +1819,7 @@ PAPI_enum_event( int *EventCode, int modifier )
if (cidx < 0) return PAPI_ENOCMP;
if ( _papi_hwd[cidx]->cmp_info.disabled == PAPI_EDELAY_INIT ) {
APIDBG("Triggered forced initialization of component ID=%d.\n", cidx);
int junk;
unsigned int junk;
_papi_hwd[cidx]->ntv_enum_events(&junk, PAPI_ENUM_FIRST);
}

Expand Down Expand Up @@ -1854,7 +1854,7 @@ PAPI_enum_event( int *EventCode, int modifier )
}

if ( _papi_hwd[first_comp_with_presets]->cmp_info.disabled == PAPI_EDELAY_INIT ) {
int junk;
unsigned int junk;
_papi_hwd[first_comp_with_presets]->ntv_enum_events(&junk, PAPI_ENUM_FIRST);
}

Expand Down Expand Up @@ -2071,7 +2071,7 @@ PAPI_enum_cmp_event( int *EventCode, int modifier, int cidx )
if ( IS_PRESET(i) ) {

if ( _papi_hwd[cidx]->cmp_info.disabled == PAPI_EDELAY_INIT ) {
int junk;
unsigned int junk;
_papi_hwd[cidx]->ntv_enum_events(&junk, PAPI_ENUM_FIRST);
}

Expand Down
20 changes: 9 additions & 11 deletions src/papi_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ PAPIWARN( char *format, ... )
int
construct_qualified_event(hwi_presets_t *prstPtr) {

int j;
unsigned int j;
for(j = 0; j < prstPtr->count; j++ ) {
/* Construct event with all qualifiers. */
int k, strLenSum = 0, baseLen = 1+strlen(prstPtr->base_name[j]);
Expand Down Expand Up @@ -685,7 +685,8 @@ construct_qualified_event(hwi_presets_t *prstPtr) {
prstPtr->name[j] = strdup(tmpEvent);

/* Set the corresponding new code. */
status = _papi_hwi_native_name_to_code( tmpEvent, &(prstPtr->code[j]) );
int code_converted = (int) prstPtr->code[j];
status = _papi_hwi_native_name_to_code( tmpEvent, &code_converted );
if( PAPI_OK != status ) {
PAPIERROR("Failed to get code for native event %s used in derived event %s\n",
tmpEvent, prstPtr->symbol);
Expand Down Expand Up @@ -724,7 +725,7 @@ overwrite_qualifiers(hwi_presets_t *prstPtr, const char *in, int is_preset) {
while( qualName != NULL ) {
size_t qualLen = 1+strlen(qualDelim)+strlen(qualName);
int status = snprintf(providedQuals[k], qualLen, "%s%s", qualDelim, qualName);
if( status < 0 || status >= qualLen ) {
if( status < 0 || (size_t) status >= qualLen ) {
PAPIERROR("Failed to make copy of qualifier %s", qualName);
return PAPI_ENOMEM;
}
Expand Down Expand Up @@ -788,9 +789,9 @@ get_first_cmp_preset_idx( void ) {

/* Return index of component containing preset with given index. */
int
get_preset_cmp( unsigned int *index ) {
get_preset_cmp( int *index ) {

unsigned int sum = 0;
int sum = 0;
if(pe_disabled) {
sum += PAPI_MAX_PRESET_EVENTS;
if(*index < sum) {
Expand All @@ -814,7 +815,7 @@ get_preset_cmp( unsigned int *index ) {
/* Return a pointer to preset which has given event code. */
hwi_presets_t*
get_preset( int event_code ) {
unsigned int preset_index = ( event_code & PAPI_PRESET_AND_MASK );
int preset_index = ( event_code & PAPI_PRESET_AND_MASK );
hwi_presets_t *_papi_hwi_list;

int i = get_preset_cmp(&preset_index);
Expand Down Expand Up @@ -2195,7 +2196,7 @@ _papi_hwi_init_global( int PE_OR_PEU )
int
_papi_hwi_init_global_presets( void )
{
int retval = PAPI_OK, is_pe, i = 0;
int retval = PAPI_OK, i = 0;

/* Determine whether or not perf_event is available. */
while ( _papi_hwd[i] ) {
Expand All @@ -2212,10 +2213,7 @@ _papi_hwi_init_global_presets( void )

i = 0;
while ( _papi_hwd[i] ) {
is_pe = 0;
if (strcmp(_papi_hwd[i]->cmp_info.name, "perf_event") == 0) {
is_pe = 1;
} else {
if (strcmp(_papi_hwd[i]->cmp_info.name, "perf_event") != 0) {
/* Only set the first non-perf_event component with presets once. */
if ( -1 == first_comp_with_presets && _papi_hwi_max_presets[i] > 0 ) {
first_comp_with_presets = i;
Expand Down
2 changes: 1 addition & 1 deletion src/papi_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ int _papi_hwi_get_dev_attr(void *handle, int id, PAPI_dev_attr_e attr, void *val
int construct_qualified_event(hwi_presets_t *prstPtr);
int overwrite_qualifiers(hwi_presets_t *prstPtr, const char *in, int is_preset);
int get_first_cmp_preset_idx( void );
int get_preset_cmp( unsigned int *index );
int get_preset_cmp( int *index );
hwi_presets_t* get_preset( int event_code );

#endif /* PAPI_INTERNAL_H */
18 changes: 9 additions & 9 deletions src/papi_preset.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ int
_papi_hwi_cleanup_all_presets( void )
{
int preset_index,cidx;
unsigned int j;
hwi_presets_t *_papi_hwi_list;

for(cidx=0;cidx<papi_num_components;cidx++) {
Expand All @@ -137,12 +136,14 @@ _papi_hwi_cleanup_all_presets( void )
_papi_hwi_list[preset_index].note = NULL;
}
/* Free the event names used to define the preset. */
for(j=0; j<_papi_hwi_list[preset_index].count;j++) {
free(_papi_hwi_list[preset_index].name[j]);
free(_papi_hwi_list[preset_index].base_name[j]);
free(_papi_hwi_list[preset_index].default_name[j]);
unsigned int i;
for(i=0; i<_papi_hwi_list[preset_index].count;i++) {
free(_papi_hwi_list[preset_index].name[i]);
free(_papi_hwi_list[preset_index].base_name[i]);
free(_papi_hwi_list[preset_index].default_name[i]);
}
/* Free the qualifier names and descriptions. */
int j;
for(j=0; j<_papi_hwi_list[preset_index].num_quals;j++) {
free(_papi_hwi_list[preset_index].quals[j]);
free(_papi_hwi_list[preset_index].quals_descrs[j]);
Expand Down Expand Up @@ -1434,7 +1435,6 @@ papi_load_derived_events_component (char *comp_str, char *arch_str, int cidx) {
}

if (strcasecmp(t, arch_name) == 0) {
int type;

breakAfter = 1;

Expand Down Expand Up @@ -1552,7 +1552,7 @@ papi_load_derived_events_component (char *comp_str, char *arch_str, int cidx) {
// this also clears any values left over from a previous call
_papi_hwi_set_papi_event_code(-1, -1);

unsigned int eventCode;
int eventCode;
char *tmpEvent, *tmpQuals;
char *qualDelim = ":";
PAPI_event_info_t eventInfo;
Expand Down Expand Up @@ -1594,7 +1594,7 @@ papi_load_derived_events_component (char *comp_str, char *arch_str, int cidx) {
prstPtr->quals[prstPtr->num_quals] = (char*)malloc(qualLen*sizeof(char));
if( NULL != prstPtr->quals[prstPtr->num_quals] ) {
status = snprintf(prstPtr->quals[prstPtr->num_quals], qualLen, "%s%s", qualDelim, qualPtr);
if( status < 0 || status >= qualLen ) {
if( status < 0 || (size_t) status >= qualLen ) {
invalid_event = 1;
PAPIERROR("Failed to store qualifier for native event %s,",
" used in derived event %s",
Expand Down Expand Up @@ -1623,7 +1623,7 @@ papi_load_derived_events_component (char *comp_str, char *arch_str, int cidx) {
prstPtr->quals_descrs[count] = (char*)malloc(descLen*sizeof(char));
if( NULL != prstPtr->quals_descrs[count] ) {
status = snprintf(prstPtr->quals_descrs[count], descLen, "%s", descPtr);
if( status < 0 || status >= descLen ) {
if( status < 0 || (size_t) status >= descLen ) {
invalid_event = 1;
PAPIERROR("Failed to store qualifier description for native event %s,",
" used in derived event %s",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/papi_hardware_avail.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ main( int argc, char **argv )
#define MAX_NUMA_NODES (16)
#define MAX_CPU_THREADS (512)
unsigned int j;
unsigned int affinity[MAX_CPU_THREADS];
int affinity[MAX_CPU_THREADS];
unsigned int numa_threads_count[MAX_NUMA_NODES] = { 0 };
unsigned int numa_threads[MAX_NUMA_NODES][MAX_CPU_THREADS];
for (j = 0; j < threads; ++j) {
Expand Down
2 changes: 2 additions & 0 deletions src/validation_tests/load_store_testcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ int execute_stores(int n) {
return 0;

#endif
(void) n;
return CODE_UNIMPLEMENTED;

}
Expand Down Expand Up @@ -52,6 +53,7 @@ int execute_loads(int n) {
return 0;

#endif
(void) n;
return CODE_UNIMPLEMENTED;

}