diff --git a/.gitignore b/.gitignore index 8e6f33d..20482c4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ papi-4.1.0.tar.gz /papi-4.1.3.tar.gz /papi-4.2.0.tar.gz /papi-4.2.1.tar.gz +/papi-4.4.0.tar.gz diff --git a/papi-bz797692.patch b/papi-bz797692.patch deleted file mode 100644 index c908dcd..0000000 --- a/papi-bz797692.patch +++ /dev/null @@ -1,203 +0,0 @@ -diff -up papi-4.2.1/src/components/lmsensors/linux-lmsensors.c.bz papi-4.2.1/src/components/lmsensors/linux-lmsensors.c ---- papi-4.2.1/src/components/lmsensors/linux-lmsensors.c.bz 2012-02-10 14:58:08.000000000 -0500 -+++ papi-4.2.1/src/components/lmsensors/linux-lmsensors.c 2012-03-09 16:23:20.139608076 -0500 -@@ -4,11 +4,11 @@ - #include "papi_memory.h" - #include "linux-lmsensors.h" - -+papi_vector_t _lmsensors_vector; - -- --/******************************************************************************* -- ******** BEGIN FUNCTIONS USED INTERNALLY SPECIFIC TO THIS COMPONENT ********* -- ******************************************************************************/ -+/****************************************************************************** -+ ******** BEGIN FUNCTIONS USED INTERNALLY SPECIFIC TO THIS COMPONENT ******** -+ *****************************************************************************/ - /* - * Counts number of events available in this system - */ -@@ -50,72 +50,69 @@ createNativeEvents( void ) - int chip_nr = 0; - const sensors_chip_name *chip_name; - -- cmp_id_t component; -- - /* component name and description */ -- strcpy( component.name, "LM_SENSORS" ); -- strcpy( component.descr, -- "lm-sensors provides tools for monitoring the hardware health" ); -+ strcpy( _lmsensors_vector.cmp_info.name, "LM_SENSORS" ); -+ // strcpy( _lmsensors_vector.cmp_info.descr, -+ // "lm-sensors provides tools for monitoring the hardware health" ); - - - /* Loop through all the chips found */ - while ( ( chip_name = - sensors_get_detected_chips( NULL, &chip_nr ) ) != NULL ) { -- int a, b; -- const sensors_feature *feature; -- const sensors_subfeature *sub; -- char chipnamestring[PAPI_MIN_STR_LEN]; -+ int a, b; -+ const sensors_feature *feature; -+ const sensors_subfeature *sub; -+ char chipnamestring[PAPI_MIN_STR_LEN]; - -- lm_sensors_native_table[id].count = 0; -+ // lm_sensors_native_table[id].count = 0; - - /* get chip name from its internal representation */ -- sensors_snprintf_chip_name( chipnamestring, -- PAPI_MIN_STR_LEN, chip_name ); -+ sensors_snprintf_chip_name( chipnamestring, -+ PAPI_MIN_STR_LEN, chip_name ); - -- a = 0; -- /* Loop through all the features found */ -- while ( ( feature = sensors_get_features( chip_name, &a ) ) ) { -- char *featurelabel; -+ a = 0; -+ -+ /* Loop through all the features found */ -+ while ( ( feature = sensors_get_features( chip_name, &a ) ) ) { -+ char *featurelabel; - -- if ( !( featurelabel = sensors_get_label( chip_name, feature ) ) ) { -- fprintf( stderr, "ERROR: Can't get label of feature %s!\n", -+ if ( !( featurelabel = sensors_get_label( chip_name, feature ))) { -+ fprintf( stderr, "ERROR: Can't get label of feature %s!\n", - feature->name ); -- continue; -- } -+ continue; -+ } - -- b = 0; -+ b = 0; - -- /* Loop through all the subfeatures found */ -- while ( ( sub = -- sensors_get_all_subfeatures( chip_name, feature, -- &b ) ) ) { -- count = 0; -+ /* Loop through all the subfeatures found */ -+ while ((sub=sensors_get_all_subfeatures(chip_name,feature,&b))) { - -- /* Save native event data */ -- sprintf( lm_sensors_native_table[id].name, -- "%s.%s.%s.%s", -- component.name, -- chipnamestring, featurelabel, sub->name ); -+ count = 0; - -- strncpy( lm_sensors_native_table[id].description, -- lm_sensors_native_table[id].name, PAPI_MAX_STR_LEN ); -+ /* Save native event data */ -+ sprintf( lm_sensors_native_table[id].name, "%s.%s.%s.%s", -+ _lmsensors_vector.cmp_info.name, -+ chipnamestring, featurelabel, sub->name ); - -- /* The selector has to be !=0 . Starts with 1 */ -- lm_sensors_native_table[id].resources.selector = id + 1; -+ strncpy( lm_sensors_native_table[id].description, -+ lm_sensors_native_table[id].name, PAPI_MAX_STR_LEN ); - -- /* Save the actual references to this event */ -- lm_sensors_native_table[id].resources.name = chip_name; -- lm_sensors_native_table[id].resources.subfeat_nr = sub->number; -+ /* The selector has to be !=0 . Starts with 1 */ -+ lm_sensors_native_table[id].resources.selector = id + 1; - -- count = sub->number; -+ /* Save the actual references to this event */ -+ lm_sensors_native_table[id].resources.name = chip_name; -+ lm_sensors_native_table[id].resources.subfeat_nr = sub->number; - -- /* increment the table index counter */ -- id++; -- } -+ count = sub->number; - -- lm_sensors_native_table[id].count = count + 1; -- free( featurelabel ); -- } -+ /* increment the table index counter */ -+ id++; -+ } -+ -+ // lm_sensors_native_table[id].count = count + 1; -+ free( featurelabel ); -+ } - } - - /* Return the number of events created */ -@@ -179,6 +176,7 @@ LM_SENSORS_init_substrate( ) - - /* Create dyanmic events table */ - NUM_EVENTS = detectSensors( ); -+ //printf("Found %d sensors\n",NUM_EVENTS); - - if ( ( lm_sensors_native_table = - ( LM_SENSORS_native_event_entry_t * ) -@@ -193,7 +191,7 @@ LM_SENSORS_init_substrate( ) - return EXIT_FAILURE; - } - -- return ( PAPI_OK ); -+ return PAPI_OK; - } - - -@@ -224,7 +222,8 @@ LM_SENSORS_start( hwd_context_t * ctx, h - { - ( void ) ctx; - ( void ) ctrl; -- return ( PAPI_OK ); -+ -+ return PAPI_OK; - } - - -@@ -235,8 +234,9 @@ int - LM_SENSORS_stop( hwd_context_t * ctx, hwd_control_state_t * ctrl ) - { - ( void ) ctx; -- ( void ) ctrl; -- return ( PAPI_OK ); -+ ( void ) ctrl; -+ -+ return PAPI_OK; - } - - -@@ -444,9 +444,8 @@ LM_SENSORS_ntv_code_to_bits( unsigned in - papi_vector_t _lmsensors_vector = { - .cmp_info = { - /* default component information (unspecified values are initialized to 0) */ -- .name = -- "$Id: linux-lmsensors.c,v 1.6 2012/02/10 19:58:08 terpstra Exp $", -- .version = "$Revision: 1.6 $", -+ .name = "linux-lmsensors.c", -+ .version = "4.2.1", - .num_mpx_cntrs = PAPI_MPX_DEF_DEG, - .num_cntrs = LM_SENSORS_MAX_COUNTERS, - .default_domain = PAPI_DOM_USER, -@@ -489,5 +488,4 @@ papi_vector_t _lmsensors_vector = { - .ntv_enum_events = LM_SENSORS_ntv_enum_events, - .ntv_code_to_name = LM_SENSORS_ntv_code_to_name, - .ntv_code_to_bits = LM_SENSORS_ntv_code_to_bits, -- .ntv_bits_to_info = NULL, - }; -diff -up papi-4.2.1/src/components/lmsensors/linux-lmsensors.h.bz papi-4.2.1/src/components/lmsensors/linux-lmsensors.h ---- papi-4.2.1/src/components/lmsensors/linux-lmsensors.h.bz 2012-02-09 10:02:53.000000000 -0500 -+++ papi-4.2.1/src/components/lmsensors/linux-lmsensors.h 2012-03-09 15:57:31.393736053 -0500 -@@ -4,7 +4,7 @@ - - /** - * @file linux-lmsensors.h -- * CVS: $Id: linux-lmsensors.h,v 1.5 2012/02/09 15:02:53 jagode Exp $ -+ * CVS: $Id$ - * @author Daniel Lucio - * @author Joachim Protze - * @author Heike Jagode diff --git a/papi-coretemp.patch b/papi-coretemp.patch deleted file mode 100644 index d31ffa7..0000000 --- a/papi-coretemp.patch +++ /dev/null @@ -1,269 +0,0 @@ -diff -up papi-4.2.0/src/components/coretemp/linux-coretemp.c.orig papi-4.2.0/src/components/coretemp/linux-coretemp.c ---- papi-4.2.0/src/components/coretemp/linux-coretemp.c.orig 2011-10-31 11:14:17.986533514 -0400 -+++ papi-4.2.0/src/components/coretemp/linux-coretemp.c 2011-10-31 11:15:40.593663642 -0400 -@@ -13,6 +13,8 @@ - - #define INVALID_RESULT -1000000L - -+papi_vector_t _coretemp_vector; -+ - /* temporary event */ - struct temp_event { - char name[PAPI_MAX_STR_LEN]; -@@ -23,8 +25,8 @@ struct temp_event { - }; - - static struct temp_event* root = NULL; --static CORETEMP_native_enent_entry_t * _coretemp_native_events; --static int NUM_EVENTS = 0; -+static CORETEMP_native_event_entry_t * _coretemp_native_events; -+static int num_events = 0; - static int is_initialized = 0; - - /******************************************************************************* -@@ -146,17 +148,17 @@ int coretemp_init_substrate( ) - is_initialized = 1; - /* This is the prefered method, all coretemp sensors are symlinked here - * see $(kernel_src)/Documentation/hwmon/sysfs-interface */ -- NUM_EVENTS = generateEventList("/sys/class/hwmon"); -+ num_events = generateEventList("/sys/class/hwmon"); - -- if ( NUM_EVENTS < 0 ) -- return ( NUM_EVENTS ); -+ if ( num_events < 0 ) -+ return ( num_events ); - -- if ( NUM_EVENTS == 0 ) -+ if ( num_events == 0 ) - return ( PAPI_OK ); - - t = root; -- _coretemp_native_events = (CORETEMP_native_enent_entry_t*) -- papi_malloc(sizeof(CORETEMP_native_enent_entry_t) * NUM_EVENTS); -+ _coretemp_native_events = (CORETEMP_native_event_entry_t*) -+ papi_malloc(sizeof(CORETEMP_native_event_entry_t) * num_events); - - do { - strncpy(_coretemp_native_events[i].name,t->name,PAPI_MAX_STR_LEN); -@@ -169,7 +171,10 @@ int coretemp_init_substrate( ) - i++; - } while (t != NULL); - root = NULL; -- return (PAPI_OK); -+ -+ _coretemp_vector.cmp_info.num_native_events = num_events; -+ -+ return PAPI_OK; - } - - -@@ -206,7 +211,7 @@ int coretemp_init_control_state( hwd_con - { - int i; - -- for ( i=0; i < NUM_EVENTS; i++ ) -+ for ( i=0; i < num_events; i++ ) - ( ( CORETEMP_control_state_t *) ctl )->counts[i] = getEventValue(i); - - ( ( CORETEMP_control_state_t *) ctl)->lastupdate = PAPI_get_real_usec(); -@@ -233,7 +238,7 @@ int coretemp_read( hwd_context_t *ctx, h - int i; - - if ( now - control->lastupdate > REFRESH_LAT ) { -- for ( i = 0; i < NUM_EVENTS; i++ ) { -+ for ( i = 0; i < num_events; i++ ) { - control->counts[i] = getEventValue( i ); - } - control->lastupdate = now; -@@ -250,7 +255,7 @@ int coretemp_stop( hwd_context_t *ctx, h - CORETEMP_control_state_t* control = (CORETEMP_control_state_t*) ctl; - int i; - -- for ( i = 0; i < NUM_EVENTS; i++ ) { -+ for ( i = 0; i < num_events; i++ ) { - control->counts[i] = getEventValue( i ); - } - -@@ -376,27 +381,31 @@ coretemp_ntv_enum_events( unsigned int * - - switch ( modifier ) { - case PAPI_ENUM_FIRST: -+ -+ if (num_events==0) { -+ return PAPI_ENOEVNT; -+ } - *EventCode = PAPI_NATIVE_MASK | PAPI_COMPONENT_MASK( cidx ); - -- return ( PAPI_OK ); -+ return PAPI_OK; - break; - - case PAPI_ENUM_EVENTS: - { - int index = *EventCode & PAPI_NATIVE_AND_MASK & PAPI_COMPONENT_AND_MASK; - -- if ( index < NUM_EVENTS - 1 ) { -+ if ( index < num_events - 1 ) { - *EventCode = *EventCode + 1; -- return ( PAPI_OK ); -+ return PAPI_OK; - } else -- return ( PAPI_ENOEVNT ); -+ return PAPI_ENOEVNT; - - break; - } - default: -- return ( PAPI_EINVAL ); -+ return PAPI_EINVAL; - } -- return ( PAPI_EINVAL ); -+ return PAPI_EINVAL; - } - - /* -@@ -407,7 +416,7 @@ coretemp_ntv_code_to_name( unsigned int - { - int index = EventCode & PAPI_NATIVE_AND_MASK & PAPI_COMPONENT_AND_MASK; - -- if ( index >= 0 && index < NUM_EVENTS ) { -+ if ( index >= 0 && index < num_events ) { - strncpy( name, _coretemp_native_events[index].name, len ); - return ( PAPI_OK ); - } -@@ -422,7 +431,7 @@ coretemp_ntv_code_to_descr( unsigned int - { - int index = EventCode & PAPI_NATIVE_AND_MASK & PAPI_COMPONENT_AND_MASK; - -- if ( index >= 0 && index < NUM_EVENTS ) { -+ if ( index >= 0 && index < num_events ) { - - strncpy( name, _coretemp_native_events[index].description, len ); - } -@@ -437,7 +446,7 @@ coretemp_ntv_code_to_bits( unsigned int - { - int index = EventCode & PAPI_NATIVE_AND_MASK & PAPI_COMPONENT_AND_MASK; - -- if ( 0 > index || NUM_EVENTS <= index ) -+ if ( 0 > index || num_events <= index ) - return ( PAPI_ENOEVNT ); - memcpy( ( CORETEMP_register_t * ) bits, - &( _coretemp_native_events[index].resources ), -@@ -454,8 +463,8 @@ papi_vector_t _coretemp_vector = { - .cmp_info = { - /* default component information (unspecified values are initialized to 0) */ - .name = -- "$Id: linux-coretemp.c,v 1.13 2011/10/25 15:20:41 vweaver1 Exp $", -- .version = "$Revision: 1.13 $", -+ "$Id: linux-coretemp.c,v 1.16 2011/10/28 16:03:51 vweaver1 Exp $", -+ .version = "$Revision: 1.16 $", - .num_mpx_cntrs = PAPI_MPX_DEF_DEG, - .num_cntrs = CORETEMP_MAX_COUNTERS, - .default_domain = PAPI_DOM_USER, -diff -up papi-4.2.0/src/components/coretemp/linux-coretemp.h.orig papi-4.2.0/src/components/coretemp/linux-coretemp.h ---- papi-4.2.0/src/components/coretemp/linux-coretemp.h.orig 2011-10-31 11:14:25.471534638 -0400 -+++ papi-4.2.0/src/components/coretemp/linux-coretemp.h 2011-10-31 11:15:40.620534716 -0400 -@@ -4,7 +4,7 @@ - - /** - * @file linux-coretemp.h -- * CVS: $Id: linux-coretemp.h,v 1.1 2010/08/31 20:54:23 ralph Exp $ -+ * CVS: $Id: linux-coretemp.h,v 1.2 2011/10/28 15:55:56 vweaver1 Exp $ - * @author James Ralph - * ralph@eecs.utk.edu - * -@@ -20,8 +20,8 @@ - * - Based heavily upon the lm-sensors component by Heike Jagode. - */ - --#ifndef _PAPI_LMSENSORS_H --#define _PAPI_LMSENSORS_H -+#ifndef _PAPI_CORETEMP_H -+#define _PAPI_CORETEMP_H - - #include - #include -@@ -53,14 +53,13 @@ typedef struct CORETEMP_register - /** This structure is used to build the table of events */ - typedef struct CORETEMP_native_event_entry - { -- /*LM_SENSORS_register_t resources; */ - char name[PAPI_MAX_STR_LEN]; - char description[PAPI_MAX_STR_LEN]; - char path[PATH_MAX]; - int stone; /* some counters are set in stone, a max temperature is just that... */ - long value; - CORETEMP_register_t resources; --} CORETEMP_native_enent_entry_t; -+} CORETEMP_native_event_entry_t; - - typedef struct CORETEMP_reg_alloc - { -@@ -86,4 +85,4 @@ typedef struct CORETEMP_context - *******************************************************************************/ - - --#endif /* _PAPI_LMSENSORS_H */ -+#endif /* _PAPI_CORETEMP_H */ -diff -up papi-4.2.0/src/components/coretemp/Rules.coretemp.orig papi-4.2.0/src/components/coretemp/Rules.coretemp -diff -up papi-4.2.0/src/components/coretemp/tests/coretemp_basic.c.orig papi-4.2.0/src/components/coretemp/tests/coretemp_basic.c ---- papi-4.2.0/src/components/coretemp/tests/coretemp_basic.c.orig 2011-10-31 11:14:52.345550487 -0400 -+++ papi-4.2.0/src/components/coretemp/tests/coretemp_basic.c 2011-10-31 11:15:40.621532177 -0400 -@@ -27,7 +27,8 @@ int main (int argc, char **argv) - int code; - char event_name[PAPI_MAX_STR_LEN]; - int total_events=0; -- -+ int r; -+ const PAPI_component_info_t *cmpinfo = NULL; - - /* Set TESTS_QUIET variable */ - tests_quiet( argc, argv ); -@@ -46,14 +47,21 @@ int main (int argc, char **argv) - - for(cid=0; cidname); -+ } - - code = PAPI_NATIVE_MASK | PAPI_COMPONENT_MASK(cid); -- PAPI_enum_event( &code, PAPI_ENUM_FIRST ); - -- while ( PAPI_enum_event( &code, PAPI_ENUM_EVENTS ) == PAPI_OK ) { -+ r = PAPI_enum_event( &code, PAPI_ENUM_FIRST ); -+ -+ while ( r == PAPI_OK ) { - retval = PAPI_event_code_to_name( code, event_name ); - if ( retval != PAPI_OK ) { -+ printf("Error translating %x\n",code); - test_fail( __FILE__, __LINE__, - "PAPI_event_code_to_name", retval ); - } -@@ -101,6 +109,7 @@ int main (int argc, char **argv) - - total_events++; - } -+ r = PAPI_enum_event( &code, PAPI_ENUM_EVENTS ); - } - } - -diff -up papi-4.2.0/src/components/coretemp/tests/Makefile.orig papi-4.2.0/src/components/coretemp/tests/Makefile ---- papi-4.2.0/src/components/coretemp/tests/Makefile.orig 2011-10-31 11:15:01.175663133 -0400 -+++ papi-4.2.0/src/components/coretemp/tests/Makefile 2011-10-31 11:15:40.621532177 -0400 -@@ -5,9 +5,9 @@ include ../../Makefile_comp_tests - - TESTS = coretemp_basic - --example_tests: $(TESTS) -+coretemp_tests: $(TESTS) - --coretemp_basic: coretemp_basic.o -+coretemp_basic: coretemp_basic.o $(UTILOBJS) $(PAPILIB) - $(CC) $(CFLAGS) $(INCLUDE) -o coretemp_basic coretemp_basic.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS) - - diff --git a/papi.spec b/papi.spec index df7395f..c16ac71 100644 --- a/papi.spec +++ b/papi.spec @@ -1,12 +1,11 @@ Summary: Performance Application Programming Interface Name: papi -Version: 4.2.1 -Release: 2%{?dist} +Version: 4.4.0 +Release: 1%{?dist} License: BSD Group: Development/System URL: http://icl.cs.utk.edu/papi/ Source0: http://icl.cs.utk.edu/projects/papi/downloads/%{name}-%{version}.tar.gz -Patch1: papi-bz797692.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: ncurses-devel BuildRequires: gcc-gfortran @@ -43,7 +42,6 @@ the PAPI userspace libraries and interfaces. %prep %setup -q -%patch1 -p1 -b .bz %build cd src @@ -102,6 +100,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/*.a %changelog +* Fri Apr 20 2012 William Cohen - 4.4.0-1 +- Rebase to 4.4.0. + * Fri Mar 9 2012 William Cohen - 4.2.1-2 - Fix overrun in lmsensor component. (rhbz797692) diff --git a/sources b/sources index 83828f7..6c598dc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4c588a91b47b9d19f28056e9d5691aa1 papi-4.2.1.tar.gz +2844448db0b53441a55487881b955ea5 papi-4.4.0.tar.gz