diff -rupN papi400t/papi.spec papi400b/papi.spec --- papi400t/papi.spec 2010-01-13 16:00:42.000000000 -0500 +++ papi400b/papi.spec 2010-03-09 16:32:53.000000000 -0500 @@ -12,7 +12,7 @@ BuildRequires: gcc-gfortran BuildRequires: kernel-headers >= 2.6.31 BuildRequires: chrpath #Right now libpfm does not know anything about s390 and will fail -ExcludeArch: s390, s390x +ExcludeArch: s390 s390x %description PAPI provides a programmer interface to monitor the performance of diff -rupN papi400t/src/configure papi400b/src/configure --- papi400t/src/configure 2010-01-13 11:20:35.000000000 -0500 +++ papi400b/src/configure 2010-02-12 14:57:39.000000000 -0500 @@ -1981,6 +1981,7 @@ use_shared=yes use_static=yes use_static_tests=no use_x86_cache_info=no +distributed_build=no { $as_echo "$as_me:$LINENO: checking for architecture" >&5 $as_echo_n "checking for architecture... " >&6; } @@ -2093,6 +2094,10 @@ $as_echo_n "checking for CPU type... " > # Check whether --with-CPU was given. if test "${with_CPU+set}" = set; then withval=$with_CPU; CPU=$withval + case "$CPU" in + core | core2 | i7 | atom | p4 | p3 | opteron | athlon) + use_x86_cache_info=yes;; + esac else @@ -2113,7 +2118,6 @@ case "$OS" in made=GenuineIntel family="`cat /proc/cpuinfo | grep family | cut -d: -f2 | cut -d' ' -f2 | sed '2,$d'`" model="`cat /proc/cpuinfo | grep model | cut -d: -f2 | cut -d' ' -f2 | sed '2,$d'`" - # family 15 is always P4; model 1 is vanilla pre-HT, model 2 is vanilla; model 3 is em64t, 4 is Pentium D, 6 is Xeon D if test "$family" = "6"; then # model 14 is an ancient Core if test "$model" = "14"; then @@ -2125,8 +2129,9 @@ case "$OS" in CPU=core2 use_x86_cache_info=yes fi - # model 26 is Nehalem - if test "$model" = "26"; then + # models 26, 30, 37, 44, 46 are Nehalem variants + if (test "$model" = "26" || test "$model" = "30" || test "$model" = "37" || + test "$model" = "44" || test "$model" = "46"); then CPU=i7 use_x86_cache_info=yes fi @@ -2135,14 +2140,10 @@ case "$OS" in CPU=atom use_x86_cache_info=yes fi + # family 15 is always P4 elif test "$family" = "15"; then - if (test "$model" = "3" || test "$model" = "4" || test "$model" = "6"); then - CPU=em64t - use_x86_cache_info=yes - elif (test "$model" = "1" || test "$model" = "2"); then CPU=p4 use_x86_cache_info=yes - fi elif test "$family" = "32"; then CPU=montecito elif test "$family" = "31"; then @@ -2157,7 +2158,8 @@ case "$OS" in elif test "`cat /proc/cpuinfo | grep -i "Pentium III"`" != ""; then CPU=p3 use_x86_cache_info=yes - else CPU=p3 + else + CPU=p3 use_x86_cache_info=yes fi fi @@ -6615,6 +6617,7 @@ if test "x$perfctr" = "x"; then # Check whether --with-perfctr was given. if test "${with_perfctr+set}" = set; then withval=$with_perfctr; perfctr=$withval + distributed_build=yes else perfctr="no" if test "$cross_compiling" = "no" ; then @@ -6697,6 +6700,7 @@ esac # Check whether --with-perfctr_root was given. if test "${with_perfctr_root+set}" = set; then withval=$with_perfctr_root; perfctr_root=$withval + distributed_build=yes else perfctr_root="" @@ -6706,6 +6710,7 @@ fi # Check whether --with-perfctr_prefix was given. if test "${with_perfctr_prefix+set}" = set; then withval=$with_perfctr_prefix; perfctr_prefix=$withval + distributed_build=yes else perfctr_prefix="" @@ -6715,6 +6720,7 @@ fi # Check whether --with-perfctr_incdir was given. if test "${with_perfctr_incdir+set}" = set; then withval=$with_perfctr_incdir; perfctr_incdir=$withval + distributed_build=yes else perfctr_incdir="" @@ -6724,6 +6730,7 @@ fi # Check whether --with-perfctr_libdir was given. if test "${with_perfctr_libdir+set}" = set; then withval=$with_perfctr_libdir; perfctr_libdir=$withval + distributed_build=yes else perfctr_libdir="" @@ -6734,6 +6741,7 @@ fi # Check whether --with-perfmon was given. if test "${with_perfmon+set}" = set; then withval=$with_perfmon; perfmon=$withval + distributed_build=yes else perfmon=0 if test "$cross_compiling" = "no" ; then @@ -6819,6 +6827,7 @@ fi # Check whether --with-pfm_root was given. if test "${with_pfm_root+set}" = set; then withval=$with_pfm_root; pfm_root=$withval + distributed_build=yes else pfm_root="" @@ -6828,6 +6837,7 @@ fi # Check whether --with-pfm_prefix was given. if test "${with_pfm_prefix+set}" = set; then withval=$with_pfm_prefix; pfm_prefix=$withval + distributed_build=yes else pfm_prefix="" @@ -6837,6 +6847,7 @@ fi # Check whether --with-pfm_incdir was given. if test "${with_pfm_incdir+set}" = set; then withval=$with_pfm_incdir; pfm_incdir=$withval + distributed_build=yes else pfm_incdir="" @@ -6846,6 +6857,7 @@ fi # Check whether --with-pfm_libdir was given. if test "${with_pfm_libdir+set}" = set; then withval=$with_pfm_libdir; pfm_libdir=$withval + distributed_build=yes else pfm_libdir="" @@ -7019,7 +7031,7 @@ fi fi # Linux perf event end -if test "$perf_events" = "no" -a "$perfctr" = "no" -a "$perfmon" = "0"; then +if test "$distributed_build" = "no" -a "$perf_events" = "no" -a "$perfctr" = "no" -a "$perfmon" = "0"; then { { $as_echo "$as_me:$LINENO: error: No performance monitoring interface available" >&5 $as_echo "$as_me: error: No performance monitoring interface available" >&2;} { (exit 1); exit 1; }; } @@ -9033,7 +9045,7 @@ $as_echo "$as_me: error: The bitmode you else MAKEVER="$OS"-pfm-"$CPU" fi ;; - opteron|core|core2|i7|atom|em64t|p3) + opteron|core|core2|i7|atom|p3) if test "$arch" = "x86_64"; then MAKEVER="$OS"-perfctr-p3 else @@ -9099,7 +9111,6 @@ case "$MAKEVER" in linux-perfctr-athlon);; linux-perfctr-p3);; linux-perfctr-p4);; - linux-perfctr-em64t);; solaris-ultra);; solaris-ultra-64bit);; solaris-niagara2|solaris-niagara2-32bit);; diff -rupN papi400t/src/configure.in papi400b/src/configure.in --- papi400t/src/configure.in 2010-01-13 11:03:58.000000000 -0500 +++ papi400b/src/configure.in 2010-02-12 14:57:40.000000000 -0500 @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # File: configure.in -# CVS: $Id: configure.in,v 1.166 2010/01/13 16:03:58 sbk Exp $ +# CVS: $Id: configure.in,v 1.166.2.4 2010/02/12 19:57:40 bsheely Exp $ AC_PREREQ(2.61) @@ -88,6 +88,7 @@ use_shared=yes use_static=yes use_static_tests=no use_x86_cache_info=no +distributed_build=no AC_MSG_CHECKING(for architecture) AC_ARG_WITH(arch, [ --with-arch= Specify architecture (uname -m)], @@ -179,7 +180,11 @@ AC_MSG_RESULT($OSVER) AC_MSG_CHECKING(for CPU type) AC_ARG_WITH(CPU, [ --with-CPU= Specify CPU type], - [CPU=$withval], + [CPU=$withval + case "$CPU" in + core | core2 | i7 | atom | p4 | p3 | opteron | athlon) + use_x86_cache_info=yes;; + esac], [ #checking for CPU @@ -199,7 +204,6 @@ case "$OS" in made=GenuineIntel family="`cat /proc/cpuinfo | grep family | cut -d: -f2 | cut -d' ' -f2 | sed '2,$d'`" model="`cat /proc/cpuinfo | grep model | cut -d: -f2 | cut -d' ' -f2 | sed '2,$d'`" - # family 15 is always P4; model 1 is vanilla pre-HT, model 2 is vanilla; model 3 is em64t, 4 is Pentium D, 6 is Xeon D if test "$family" = "6"; then # model 14 is an ancient Core if test "$model" = "14"; then @@ -211,8 +215,9 @@ case "$OS" in CPU=core2 use_x86_cache_info=yes fi - # model 26 is Nehalem - if test "$model" = "26"; then + # models 26, 30, 37, 44, 46 are Nehalem variants + if (test "$model" = "26" || test "$model" = "30" || test "$model" = "37" || + test "$model" = "44" || test "$model" = "46"); then CPU=i7 use_x86_cache_info=yes fi @@ -221,14 +226,10 @@ case "$OS" in CPU=atom use_x86_cache_info=yes fi + # family 15 is always P4 elif test "$family" = "15"; then - if (test "$model" = "3" || test "$model" = "4" || test "$model" = "6"); then - CPU=em64t - use_x86_cache_info=yes - elif (test "$model" = "1" || test "$model" = "2"); then CPU=p4 use_x86_cache_info=yes - fi elif test "$family" = "32"; then CPU=montecito elif test "$family" = "31"; then @@ -243,7 +244,8 @@ case "$OS" in elif test "`cat /proc/cpuinfo | grep -i "Pentium III"`" != ""; then CPU=p3 use_x86_cache_info=yes - else CPU=p3 + else + CPU=p3 use_x86_cache_info=yes fi fi @@ -901,7 +903,8 @@ AC_MSG_RESULT($virtualtimer) if test "x$perfctr" = "x"; then AC_ARG_WITH(perfctr, [ --with-perfctr=<5,6,7> Specify perfctr version number ], - [perfctr=$withval], + [perfctr=$withval + distributed_build=yes], [perfctr="no" if test "$cross_compiling" = "no" ; then AC_CHECK_FILE(/sys/class/perfctr,[perfctr=7],[AC_CHECK_FILE(/dev/perfctr,[perfctr=6])]) @@ -933,28 +936,33 @@ esac AC_ARG_WITH(perfctr_root, [ --with-perfctr-root= Specify path to source tree (for use by developers only) ], - [perfctr_root=$withval], + [perfctr_root=$withval + distributed_build=yes], [perfctr_root=""] ) AC_ARG_WITH(perfctr_prefix, [ --with-perfctr-prefix= Specify prefix to installed perfctr distribution ], - [perfctr_prefix=$withval], + [perfctr_prefix=$withval + distributed_build=yes], [perfctr_prefix=""] ) AC_ARG_WITH(perfctr_incdir, [ --with-perfctr-incdir= Specify directory of perfctr header files in non-standard location ], - [perfctr_incdir=$withval], + [perfctr_incdir=$withval + distributed_build=yes], [perfctr_incdir=""] ) AC_ARG_WITH(perfctr_libdir, [ --with-perfctr-libdir= Specify directory of perfctr library in non-standard location ], - [perfctr_libdir=$withval], + [perfctr_libdir=$withval + distributed_build=yes], [perfctr_libdir=""] ) AC_ARG_WITH(perfmon, [ --with-perfmon= Specify perfmon version number ], - [perfmon=$withval], + [perfmon=$withval + distributed_build=yes], [perfmon=0 if test "$cross_compiling" = "no" ; then AC_CHECK_FILE(/sys/kernel/perfmon/version,[ @@ -987,22 +995,26 @@ fi AC_ARG_WITH(pfm_root, [ --with-pfm-root= Specify path to source tree (for use by developers only) ], - [pfm_root=$withval], + [pfm_root=$withval + distributed_build=yes], [pfm_root=""] ) AC_ARG_WITH(pfm_prefix, [ --with-pfm-prefix= Specify prefix to installed pfm distribution ], - [pfm_prefix=$withval], + [pfm_prefix=$withval + distributed_build=yes], [pfm_prefix=""] ) AC_ARG_WITH(pfm_incdir, [ --with-pfm-incdir= Specify directory of pfm header files in non-standard location ], - [pfm_incdir=$withval], + [pfm_incdir=$withval + distributed_build=yes], [pfm_incdir=""] ) AC_ARG_WITH(pfm_libdir, [ --with-pfm-libdir= Specify directory of pfm library in non-standard location ], - [pfm_libdir=$withval], + [pfm_libdir=$withval + distributed_build=yes], [pfm_libdir=""] ) @@ -1068,7 +1080,7 @@ fi fi # Linux perf event end -if test "$perf_events" = "no" -a "$perfctr" = "no" -a "$perfmon" = "0"; then +if test "$distributed_build" = "no" -a "$perf_events" = "no" -a "$perfctr" = "no" -a "$perfmon" = "0"; then AC_MSG_ERROR([No performance monitoring interface available]) fi @@ -1441,7 +1453,7 @@ case "$OS" in else MAKEVER="$OS"-pfm-"$CPU" fi ;; - opteron|core|core2|i7|atom|em64t|p3) + opteron|core|core2|i7|atom|p3) if test "$arch" = "x86_64"; then MAKEVER="$OS"-perfctr-p3 else @@ -1500,7 +1512,6 @@ case "$MAKEVER" in linux-perfctr-athlon);; linux-perfctr-p3);; linux-perfctr-p4);; - linux-perfctr-em64t);; solaris-ultra);; solaris-ultra-64bit);; solaris-niagara2|solaris-niagara2-32bit);; diff -rupN papi400t/src/ctests/shlib.c papi400b/src/ctests/shlib.c --- papi400t/src/ctests/shlib.c 2009-09-10 16:19:49.000000000 -0400 +++ papi400b/src/ctests/shlib.c 2010-01-26 19:27:26.000000000 -0500 @@ -1,6 +1,6 @@ /* * File: profile.c -* CVS: $Id: shlib.c,v 1.18 2009/09/10 20:19:49 terpstra Exp $ +* CVS: $Id: shlib.c,v 1.18.6.2 2010/01/27 00:27:26 jagode Exp $ * Author: Philip Mucci * mucci@cs.utk.edu * Mods: @@ -59,50 +59,26 @@ int main(int argc, char **argv) #ifndef NO_DLFCN { - char *libname = - "libpapi.so"; - char *libname2 = - "libpapi64.so"; - char *_libname; + char *_libname = + "libm.so"; void *handle ; -/* - void *handle = dlopen("libm.so", RTLD_LAZY); -*/ - int (*num_hwctrs)(void); + double (*pow)(double,double); int oldcount; - int my_dlerror = 0; - -RETRY: - if ( !my_dlerror ){ - printf("\nLoading %s with dlopen().\n",libname); - _libname = libname; - } - else{ - printf("\nLoading %s with dlopen().\n",libname2); - _libname = libname2; - } handle = dlopen (_libname, RTLD_NOW); if (!handle) { printf("dlopen: %s\n",dlerror()); - if ( !my_dlerror ){ - my_dlerror = 1; - printf("Trying again."); - goto RETRY; - } printf("Did you forget to set the environmental variable LIBPATH (in AIX) or LD_LIBRARY_PATH (in linux) ?\n"); test_fail(__FILE__, __LINE__, "dlopen", 1); } - printf("Looking up PAPI_num_counters() \n"); - num_hwctrs = ( int (*) (void)) dlsym(handle, "PAPI_num_counters"); - if (num_hwctrs == NULL) { - printf("dlsym: %s \n", dlerror()); - test_fail(__FILE__, __LINE__, "dlsym", 1); - } - - printf ("There are %d hardware counters \n", (*num_hwctrs)()); - + pow = (double(*)(double,double)) dlsym(handle, "pow"); + if (pow == NULL) { + printf("dlsym: %s\n", dlerror()); + test_fail(__FILE__,__LINE__,"dlsym",1); + } + printf("2^2 = %lf \n",(*pow)(2,2)); + oldcount = shinfo->count; if ((shinfo = PAPI_get_shared_lib_info()) == NULL) { diff -rupN papi400t/src/extras.c papi400b/src/extras.c --- papi400t/src/extras.c 2009-12-18 15:24:24.000000000 -0500 +++ papi400b/src/extras.c 2010-01-27 17:26:42.000000000 -0500 @@ -4,7 +4,7 @@ /* * File: extras.c -* CVS: $Id: extras.c,v 1.159 2009/12/18 20:24:24 terpstra Exp $ +* CVS: $Id: extras.c,v 1.159.2.2 2010/01/27 22:26:42 jagode Exp $ * Author: Philip Mucci * mucci@cs.utk.edu * Mods: dan terpstra @@ -562,34 +562,50 @@ int _papi_hwi_native_name_to_code(char * char name[PAPI_HUGE_STR_LEN]; /* make sure it's big enough */ unsigned int i, j; - for (j=0,i = 0 | PAPI_NATIVE_MASK;jntv_name_to_code, NULL) == NULL) - retval = _papi_hwd[j]->ntv_name_to_code(in, (unsigned *)out); - else { - _papi_hwd[j]->ntv_enum_events(&i, PAPI_ENUM_FIRST); - _papi_hwi_lock(INTERNAL_LOCK); - do { + if ( vector_find_dummy( ( void* ) _papi_hwd[j]->ntv_name_to_code, NULL ) == NULL ) + { + /* if ntv_name_to_code is set and != NULL */ + retval = _papi_hwd[j]->ntv_name_to_code( in, ( unsigned * ) out ); + } + else + { + _papi_hwd[j]->ntv_enum_events( &i, PAPI_ENUM_FIRST ); + _papi_hwi_lock( INTERNAL_LOCK ); + + do + { retval = _papi_hwd[j]->ntv_code_to_name(i, name, sizeof(name)); /* printf("name =|%s|\ninput=|%s|\n", name, in); */ - if (retval == PAPI_OK) { - if (strcasecmp(name, in) == 0) { + if (retval == PAPI_OK) + { + if (strcasecmp(name, in) == 0) + { *out = i | PAPI_COMPONENT_MASK(j);; break; - } else { + } + else retval = PAPI_ENOEVNT; - } - } else { + } + else + { *out = 0; retval = PAPI_ENOEVNT; break; } - } while ((_papi_hwd[j]->ntv_enum_events(&i, PAPI_ENUM_EVENTS) == PAPI_OK)); + } + while ( ( _papi_hwd[j]->ntv_enum_events( &i, PAPI_ENUM_EVENTS ) == PAPI_OK ) ); + _papi_hwi_unlock(INTERNAL_LOCK); - if (retval == PAPI_OK) return(retval); } + + if ( retval == PAPI_OK ) + return( retval ); } - return (retval); + return ( retval ); } diff -rupN papi400t/src/libpfm-3.y/lib/pfmlib_intel_nhm.c papi400b/src/libpfm-3.y/lib/pfmlib_intel_nhm.c --- papi400t/src/libpfm-3.y/lib/pfmlib_intel_nhm.c 2010-01-12 22:29:51.000000000 -0500 +++ papi400b/src/libpfm-3.y/lib/pfmlib_intel_nhm.c 2010-02-11 09:21:29.000000000 -0500 @@ -172,7 +172,10 @@ pfm_nhm_detect(void) switch(cpu_model) { case 26: /* Nehalem Core i7 */ case 30: /* Nehalem Core i5 */ - break; + case 37: + case 44: + case 46: + break; default: return PFMLIB_ERR_NOTSUPP; } @@ -238,6 +241,9 @@ pfm_nhm_init(void) switch(cpu_model) { case 26: case 30: + case 37: + case 44: + case 46: num_pe = PME_COREI7_EVENT_COUNT; num_unc_pe = PME_COREI7_UNC_EVENT_COUNT; pe = corei7_pe; diff -rupN papi400t/src/papi.c papi400b/src/papi.c --- papi400t/src/papi.c 2009-12-18 15:24:24.000000000 -0500 +++ papi400b/src/papi.c 2010-01-26 20:40:35.000000000 -0500 @@ -4,7 +4,7 @@ /* * File: papi.c -* CVS: $Id: papi.c,v 1.337 2009/12/18 20:24:24 terpstra Exp $ +* CVS: $Id: papi.c,v 1.337.2.1 2010/01/27 01:40:35 terpstra Exp $ * Author: Philip Mucci * mucci@cs.utk.edu * Mods: dan terpstra @@ -1349,13 +1349,10 @@ int PAPI_set_multiplex(int EventSet) if (ESI == NULL) papi_return(PAPI_ENOEVST); - /* if the eventset has no index and no events, return OK - otherwise return NOCMP */ + /* if the eventset has no index return NOCMP */ cidx = valid_ESI_component(ESI); - if (cidx < 0) { - if (ESI->NumberOfEvents) papi_return(cidx); - papi_return(PAPI_OK); - } + if (cidx < 0) papi_return(cidx); + if ((ret = mpx_check(EventSet)) != PAPI_OK) papi_return(ret); diff -rupN papi400t/src/papi.h papi400b/src/papi.h --- papi400t/src/papi.h 2010-01-13 10:40:49.000000000 -0500 +++ papi400b/src/papi.h 2010-03-08 17:14:00.000000000 -0500 @@ -4,7 +4,7 @@ /* * File: papi.h -* CVS: $Id: papi.h,v 1.193 2010/01/13 15:40:49 terpstra Exp $ +* CVS: $Id: papi.h,v 1.193.2.1 2010/03/08 22:14:00 terpstra Exp $ * Author: Philip Mucci * mucci@cs.utk.edu * Mods: dan terpstra @@ -36,8 +36,8 @@ #define PAPI_VERSION_INCREMENT(x)((x) & 0xff) /* This is the official PAPI version */ -/* Big increment for PAPI-C technology pre-release */ -#define PAPI_VERSION PAPI_VERSION_NUMBER(4,0,0,0) +/* The final digit represents the patch count */ +#define PAPI_VERSION PAPI_VERSION_NUMBER(4,0,0,2) #define PAPI_VER_CURRENT (PAPI_VERSION & 0xffff0000) #ifdef __cplusplus diff -rupN papi400t/src/papi_internal.c papi400b/src/papi_internal.c --- papi400t/src/papi_internal.c 2010-01-13 13:39:05.000000000 -0500 +++ papi400b/src/papi_internal.c 2010-03-08 17:08:09.000000000 -0500 @@ -4,7 +4,7 @@ /* * File: papi_internal.c -* CVS: $Id: papi_internal.c,v 1.138 2010/01/13 18:39:05 terpstra Exp $ +* CVS: $Id: papi_internal.c,v 1.138.2.1 2010/03/08 22:08:09 terpstra Exp $ * Author: Philip Mucci * mucci@cs.utk.edu * Mods: dan terpstra @@ -580,6 +580,22 @@ static int add_native_fail_clean(EventSe return -1; } +/* since update_control_state trashes overflow settings, this puts things + back into balance. */ +static int update_overflow(EventSetInfo_t * ESI) +{ + int i, retval = PAPI_OK; + + if (ESI->overflow.flags & PAPI_OVERFLOW_HARDWARE) { + for (i=0; ioverflow.event_counter; i++) { + retval = _papi_hwd[ESI->CmpIdx]->set_overflow(ESI, + ESI->overflow.EventIndex[i], ESI->overflow.threshold[i]); + if (retval != PAPI_OK) break; + } + } + return (retval); +} + /* this function is called by _papi_hwi_add_event when adding native events nix: pointer to array of native event table indexes from the preset entry size: number of native events to add @@ -771,6 +787,8 @@ int _papi_hwi_add_event(EventSetInfo_t * /* Bump the number of events */ ESI->NumberOfEvents++; + /* reinstate the overflows if any */ + update_overflow( ESI ); return (retval); } @@ -875,14 +893,14 @@ int remove_native_events(EventSetInfo_t /* If we removed any elements, clear the now empty slots, reinitialize the index, and update the count. Then send the info down to the substrate to update the hwd control structure. */ + retval = PAPI_OK; if (zero) { retval = _papi_hwd[ESI->CmpIdx]->update_control_state(ESI->ctl_state, native, ESI->NativeCount, ESI->master->context[ESI->CmpIdx]); - if (retval != PAPI_OK) - return (retval); + if (retval == PAPI_OK) + retval = update_overflow(ESI); } - - return (PAPI_OK); + return (retval); } int _papi_hwi_remove_event(EventSetInfo_t * ESI, int EventCode) diff -rupN papi400t/src/perf_events.c papi400b/src/perf_events.c --- papi400t/src/perf_events.c 2010-01-14 10:48:00.000000000 -0500 +++ papi400b/src/perf_events.c 2010-01-27 17:26:42.000000000 -0500 @@ -1,6 +1,6 @@ /* * File: perf_events.c -* CVS: $Id: perf_events.c,v 1.18 2010/01/14 15:48:00 terpstra Exp $ +* CVS: $Id: perf_events.c,v 1.18.2.1 2010/01/27 22:26:42 jagode Exp $ * Author: Corey Ashford * cjashfor@us.ibm.com * - based upon perfmon.c written by - @@ -76,6 +76,7 @@ extern papi_vector_t _papi_pe_vector; extern int _papi_pfm_setup_presets(char *name, int type); extern int _papi_pfm_ntv_enum_events(unsigned int *EventCode, int modifier); +extern int _papi_pfm_ntv_name_to_code(char *ntv_name, unsigned int *EventCode); extern int _papi_pfm_ntv_code_to_name(unsigned int EventCode, char *ntv_name, int len); extern int _papi_pfm_ntv_code_to_descr(unsigned int EventCode, char *ntv_descr, int len); extern int _papi_pfm_ntv_code_to_bits(unsigned int EventCode, hwd_register_t *bits); @@ -2014,8 +2015,8 @@ int _papi_pe_init_substrate (int cidx) } SUBDBG ("pfm_get_num_events: %d\n", ncnt); MY_VECTOR.cmp_info.num_native_events = ncnt; - strcpy (MY_VECTOR.cmp_info.name, "$Id: perf_events.c,v 1.18 2010/01/14 15:48:00 terpstra Exp $"); - strcpy (MY_VECTOR.cmp_info.version, "$Revision: 1.18 $"); + strcpy (MY_VECTOR.cmp_info.name, "$Id: perf_events.c,v 1.18.2.1 2010/01/27 22:26:42 jagode Exp $"); + strcpy (MY_VECTOR.cmp_info.version, "$Revision: 1.18.2.1 $"); sprintf (buf, "%08x", version); pfm_get_num_counters ((unsigned int *) &MY_VECTOR.cmp_info.num_cntrs); @@ -3383,6 +3384,7 @@ papi_vector_t _papi_pe_vector = { .allocate_registers = _papi_pe_allocate_registers, .write = _papi_pe_write, .ntv_enum_events = _papi_pfm_ntv_enum_events, + .ntv_name_to_code = _papi_pfm_ntv_name_to_code, .ntv_code_to_name = _papi_pfm_ntv_code_to_name, .ntv_code_to_descr = _papi_pfm_ntv_code_to_descr, .ntv_code_to_bits = _papi_pfm_ntv_code_to_bits, diff -rupN papi400t/src/perfmon.c papi400b/src/perfmon.c --- papi400t/src/perfmon.c 2009-11-17 23:37:42.000000000 -0500 +++ papi400b/src/perfmon.c 2010-01-27 17:26:42.000000000 -0500 @@ -1,6 +1,6 @@ /* * File: perfmon.c -* CVS: $Id: perfmon.c,v 1.97 2009/11/18 04:37:42 mucci Exp $ +* CVS: $Id: perfmon.c,v 1.97.4.1 2010/01/27 22:26:42 jagode Exp $ * Author: Philip Mucci * mucci@cs.utk.edu * Mods: Brian Sheely @@ -42,6 +42,7 @@ extern int get_cpu_info(PAPI_hw_info_t * extern papi_vector_t _papi_pfm_vector; extern int _papi_pfm_setup_presets(char *name, int type); extern int _papi_pfm_ntv_enum_events(unsigned int *EventCode, int modifier); +extern int _papi_pfm_ntv_name_to_code(char *ntv_name, unsigned int *EventCode); extern int _papi_pfm_ntv_code_to_name(unsigned int EventCode, char *ntv_name, int len); extern int _papi_pfm_ntv_code_to_descr(unsigned int EventCode, char *ntv_descr, int len); extern int _papi_pfm_ntv_code_to_bits(unsigned int EventCode, hwd_register_t *bits); @@ -2216,8 +2217,8 @@ int _papi_pfm_init_substrate(int cidx) } SUBDBG("pfm_get_num_events: %d\n", ncnt); MY_VECTOR.cmp_info.num_native_events = ncnt; - strcpy(MY_VECTOR.cmp_info.name, "$Id: perfmon.c,v 1.97 2009/11/18 04:37:42 mucci Exp $"); - strcpy(MY_VECTOR.cmp_info.version, "$Revision: 1.97 $"); + strcpy(MY_VECTOR.cmp_info.name, "$Id: perfmon.c,v 1.97.4.1 2010/01/27 22:26:42 jagode Exp $"); + strcpy(MY_VECTOR.cmp_info.version, "$Revision: 1.97.4.1 $"); sprintf(buf,"%08x",version); pfm_get_num_counters((unsigned int *)&MY_VECTOR.cmp_info.num_cntrs); @@ -3764,6 +3765,7 @@ papi_vector_t _papi_pfm_vector = { .allocate_registers = _papi_pfm_allocate_registers, .write = _papi_pfm_write, .ntv_enum_events = _papi_pfm_ntv_enum_events, + .ntv_name_to_code = _papi_pfm_ntv_name_to_code, .ntv_code_to_name = _papi_pfm_ntv_code_to_name, .ntv_code_to_descr = _papi_pfm_ntv_code_to_descr, .ntv_code_to_bits = _papi_pfm_ntv_code_to_bits,