Rebase on papi-5.2.0.tar.gz

This commit is contained in:
William Cohen 2013-08-07 15:01:58 -04:00
parent 1a94b3f853
commit 582d467479
8 changed files with 10 additions and 1400 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ papi-4.1.0.tar.gz
/papi-5.0.1.tar.gz
/papi-5.1.0.2.tar.gz
/papi-5.1.1.tar.gz
/papi-5.2.0.tar.gz

View File

@ -1,302 +0,0 @@
commit f10342a88c4b591b80444b5e2ff8ec063ef58fa4
Author: William Cohen <wcohen@redhat.com>
Date: Mon Jul 1 16:12:23 2013 -0400
Clean up option handling in papi_cost
The papi_cost used strstr to seach for the substring that matched the
option. this is pretty inexact. Made sure that the options matched
exactly and the option argments for -b and -t were greater than 0.
Also make papi_cost print out the help if there was an option that it
didn't understand.
Signed-off-by: William Cohen <wcohen@redhat.com>
diff --git a/src/utils/cost.c b/src/utils/cost.c
index 44b338d..5f7aa54 100644
--- a/src/utils/cost.c
+++ b/src/utils/cost.c
@@ -182,35 +182,34 @@ main( int argc, char **argv )
tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
- for ( i = 0; i < argc; i++ ) {
- if ( argv[i] ) {
- if ( strstr( argv[i], "-b" ) ) {
- bins = atoi( argv[i + 1] );
- if ( bins )
- i++;
- else {
- printf( "-b requires a bin count!\n" );
- exit( 1 );
- }
- }
- if ( strstr( argv[i], "-d" ) )
- show_dist = 1;
- if ( strstr( argv[i], "-h" ) ) {
- print_help( );
+ for ( i = 1; i < argc; i++ ) {
+ if ( !strcmp( argv[i], "-b" ) ) {
+ i++;
+ if ( i >= argc || (bins = atoi( argv[i] ) > 0 ) ) {
+ printf( "-b requires a positive bin count!\n" );
exit( 1 );
}
- if ( strstr( argv[i], "-s" ) )
- show_std_dev = 1;
- if ( strstr( argv[i], "-t" ) ) {
- num_iters = ( int ) atol( argv[i + 1] );
- if ( num_iters )
- i++;
- else {
- printf( "-t requires a threshold value!\n" );
- exit( 1 );
- }
+ }
+ else if ( !strcmp( argv[i], "-d" ) )
+ show_dist = 1;
+ else if ( !strcmp( argv[i], "-h" ) ) {
+ print_help( );
+ exit( 1 );
+ }
+ else if ( !strcmp( argv[i], "-s" ) )
+ show_std_dev = 1;
+ else if ( !strcmp( argv[i], "-t" ) ) {
+ i++;
+ if ( i >= argc || (num_iters = ( int ) atol( argv[i] ) > 0) ) {
+ printf( "-t requires a positive threshold value!\n" );
+ exit( 1 );
}
}
+ else {
+ /* If not a valid option, print out some help information */
+ print_help( );
+ exit( 1 );
+ }
}
printf( "Cost of execution for PAPI start/stop, read and accum.\n" );
commit b5adc5614855fbd024fc5d5cd73a0305c87af5aa
Author: William Cohen <wcohen@redhat.com>
Date: Mon Jul 1 16:12:25 2013 -0400
Clean up option handling for papi_native_avail
Corrected the help to reflect the name of the option "--noumasks".
Print error message if the "-i", "-e", and "-x" option arguments are invalid.
Avoid using strstr() for "-h", use strcmp instead.
Also check for "--help" option.
Signed-off-by: William Cohen <wcohen@redhat.com>
diff --git a/src/utils/native_avail.c b/src/utils/native_avail.c
index 5c303da..dcd4d99 100644
--- a/src/utils/native_avail.c
+++ b/src/utils/native_avail.c
@@ -23,7 +23,7 @@
* <li>-e EVENTNAME display detailed information about named native event
* <li>-i EVENTSTR include only event names that contain EVENTSTR
* <li>-x EVENTSTR exclude any event names that contain EVENTSTR
- * <li>--nomasks suppress display of Unit Mask information
+ * <li>--noumasks suppress display of Unit Mask information
* </ul>
*
* Processor-specific options
@@ -75,7 +75,7 @@ print_help( char **argv )
printf( " -e EVENTNAME display detailed information about named native event\n" );
printf( " -i EVENTSTR include only event names that contain EVENTSTR\n" );
printf( " -x EVENTSTR exclude any event names that contain EVENTSTR\n" );
- printf( " --nomasks suppress display of Unit Mask information\n" );
+ printf( " --noumasks suppress display of Unit Mask information\n" );
printf( "\nProcessor-specific options\n");
printf( " --darr display events supporting Data Address Range Restriction\n" );
printf( " --dear display Data Event Address Register events only\n" );
@@ -122,20 +122,29 @@ parse_args( int argc, char **argv, command_flags_t * f )
f->details = 1;
else if ( !strcmp( argv[i], "-e" ) ) {
f->named = 1;
- f->name = argv[i + 1];
- if ( no_str_arg( f->name ) ) f->help = 1;
i++;
+ f->name = argv[i];
+ if ( i >= argc || no_str_arg( f->name ) ) {
+ printf( "Invalid argument for -e\n");
+ exit(1);
+ }
} else if ( !strcmp( argv[i], "-i" ) ) {
f->include = 1;
- f->istr = argv[i + 1];
- if ( no_str_arg( f->istr ) ) f->help = 1;
i++;
+ f->istr = argv[i];
+ if ( i >= argc || no_str_arg( f->istr ) ) {
+ printf( "Invalid argument for -i\n");
+ exit(1);
+ }
} else if ( !strcmp( argv[i], "-x" ) ) {
f->xclude = 1;
- f->xstr = argv[i + 1];
- if ( no_str_arg( f->xstr ) ) f->help = 1;
i++;
- } else if ( strstr( argv[i], "-h" ) )
+ f->xstr = argv[i];
+ if ( i >= argc || no_str_arg( f->xstr ) ) {
+ printf( "Invalid argument for -x\n");
+ exit(1);
+ }
+ } else if ( !strcmp( argv[i], "-h" ) || !strcmp( argv[i], "--help" ) )
f->help = 1;
else {
printf( "%s is not supported\n", argv[i] );
commit 8933be9b144bba5e98be892452c7eb44cedbf2af
Author: William Cohen <wcohen@redhat.com>
Date: Mon Jul 1 16:12:24 2013 -0400
Clean up option handling in papi_decode
papi_decode used strstr() to match options; this can lead to inexact
matchs. The code should used strcmp instead. Make sure command name
is not processed as an option. Also print help iformation is some
argument is not understood.
Signed-off-by: William Cohen <wcohen@redhat.com>
diff --git a/src/utils/decode.c b/src/utils/decode.c
index 3ab7607..ce7cef8 100644
--- a/src/utils/decode.c
+++ b/src/utils/decode.c
@@ -66,11 +66,14 @@ main( int argc, char **argv )
PAPI_event_info_t info;
tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
- for ( i = 0; i < argc; i++ )
+ for ( i = 1; i < argc; i++ )
if ( argv[i] ) {
- if ( strstr( argv[i], "-a" ) )
+ if ( !strcmp( argv[i], "-a" ) )
print_avail_only = PAPI_PRESET_ENUM_AVAIL;
- if ( strstr( argv[i], "-h" ) ) {
+ else if ( !strcmp( argv[i], "-h" ) ) {
+ print_help( );
+ exit( 1 );
+ } else {
print_help( );
exit( 1 );
}
commit d94ac43aee03c03abf143bdc0f62f704e2c26f99
Author: William Cohen <wcohen@redhat.com>
Date: Mon Jul 1 16:12:22 2013 -0400
Improve option matching in papi_component and add "--help" option
Signed-off-by: William Cohen <wcohen@redhat.com>
diff --git a/src/utils/component.c b/src/utils/component.c
index 6eb6a11..e69872b 100644
--- a/src/utils/component.c
+++ b/src/utils/component.c
@@ -55,7 +55,7 @@ parse_args( int argc, char **argv, command_flags_t * f )
for ( i = 1; i < argc; i++ ) {
if ( !strcmp( argv[i], "-d" ) ) {
f->details = 1;
- } else if ( strstr( argv[i], "-h" ) )
+ } else if ( !strcmp( argv[i], "-h" ) || !strcmp( argv[i], "--help" ) )
f->help = 1;
else
printf( "%s is not supported\n", argv[i] );
commit bb63fe5c270fc970d4fc1a592369472b03d1a928
Author: William Cohen <wcohen@redhat.com>
Date: Mon Jul 1 16:12:21 2013 -0400
Add options to papi_command_line man page and improve opt handling
Add options mention in the -h to the man page. Also improve the matching
of the options.
Signed-off-by: William Cohen <wcohen@redhat.com>
diff --git a/src/utils/command_line.c b/src/utils/command_line.c
index 8eb995a..7fecc07 100644
--- a/src/utils/command_line.c
+++ b/src/utils/command_line.c
@@ -17,7 +17,11 @@
* and if they give reasonable results for known work.
*
* @section Options
- * This utility has no command line options.
+ * <ul>
+ * <li>-u Display output values as unsigned integers
+ * <li>-x Display output values as hexadecimal
+ * <li>-h Display help information about this utility.
+ * </ul>
*
* @section Bugs
* There are no known bugs in this utility.
@@ -78,12 +82,12 @@ main( int argc, char **argv )
test_fail_exit( __FILE__, __LINE__, "malloc", PAPI_ESYS );
for ( num_events = 0, i = 1; i < argc; i++ ) {
- if ( strstr( argv[i], "-h" ) ) {
+ if ( !strcmp( argv[i], "-h" ) ) {
print_help( argv );
exit( 1 );
- } else if ( strstr( argv[i], "-u" ) ) {
+ } else if ( !strcmp( argv[i], "-u" ) ) {
u_format = 1;
- } else if ( strstr( argv[i], "-x" ) ) {
+ } else if ( !strcmp( argv[i], "-x" ) ) {
hex_format = 1;
} else {
if ( ( retval = PAPI_add_named_event( EventSet, argv[i] ) ) != PAPI_OK ) {
commit 09059c8223e43c2aaa13aafda094d30a8b220321
Author: William Cohen <wcohen@redhat.com>
Date: Mon Jul 1 16:12:20 2013 -0400
Add information for papi_version to be complete
Signed-off-by: William Cohen <wcohen@redhat.com>
diff --git a/doc/Makefile b/doc/Makefile
index 98d1733..7b52a23 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -11,7 +11,7 @@ man: man/man1 man/man3
man/man3: ../src/papi.h
doxygen Doxyfile-man3
-man/man1: ../src/utils/avail.c ../src/utils/clockres.c ../src/utils/command_line.c ../src/utils/component.c ../src/utils/cost.c ../src/utils/decode.c ../src/utils/error_codes.c ../src/utils/event_chooser.c ../src/utils/event_info.c ../src/utils/mem_info.c ../src/utils/multiplex_cost.c ../src/utils/native_avail.c
+man/man1: ../src/utils/avail.c ../src/utils/clockres.c ../src/utils/command_line.c ../src/utils/component.c ../src/utils/cost.c ../src/utils/decode.c ../src/utils/error_codes.c ../src/utils/event_chooser.c ../src/utils/event_info.c ../src/utils/mem_info.c ../src/utils/multiplex_cost.c ../src/utils/native_avail.c ../src/utils/version.c
doxygen Doxyfile-man1
clean:
diff --git a/src/utils/version.c b/src/utils/version.c
index 231f1cc..43932fb 100644
--- a/src/utils/version.c
+++ b/src/utils/version.c
@@ -1,3 +1,21 @@
+/**
+ * file version.c
+ * @brief papi_version utility.
+ * @page papi_version
+ * @section Name
+ * papi_version - provides version information for papi.
+ *
+ * @section Synopsis
+ * papi_version
+ *
+ * @section Description
+ * papi_version is a PAPI utility program that reports version
+ * information about the current PAPI installation.
+ *
+ * @section Bugs
+ * There are no known bugs in this utility.
+ * If you find a bug, it should be reported to the PAPI Mailing List at <ptools-perfapi@ptools.org>.
+ */
/* This utility displays the current PAPI version number */
#include <stdlib.h>

View File

@ -1,238 +0,0 @@
commit 2e6bcb2a4291f9ae66a4cd44ddec2375723fb1b8
Author: Dan Terpstra <terpstra@eecs.utk.edu>
Date: Thu May 2 14:19:43 2013 -0400
Add two command line switches:
-i EVENTSTR includes only events whose names contain EVENTSTR;
-x EVENTSTR excludes all events whose names contain EVENTSTR.
These two switches can be combined, but only one string per switch can be used.
This allows you to, for example, filter events by component name, or eliminate all uncore events on Sandy Bridge…
diff --git a/src/utils/native_avail.c b/src/utils/native_avail.c
index 1c16d73..825bd19 100644
--- a/src/utils/native_avail.c
+++ b/src/utils/native_avail.c
@@ -18,10 +18,12 @@
*
* @section Options
* <ul>
- * <li>--help, -h print this help message
- * <li>-d display detailed information about native events
- * <li>-e EVENTNAME display detail information about named native event
- * <li>--nomasks suppress display of Unit Mask information
+ * <li>--help, -h print this help message
+ * <li>-d display detailed information about native events
+ * <li>-e EVENTNAME display detailed information about named native event
+ * <li>-i EVENTSTR include only event names that contain EVENTSTR
+ * <li>-x EVENTSTR exclude any event names that contain EVENTSTR
+ * <li>--nomasks suppress display of Unit Mask information
* </ul>
*
* Processor-specific options
@@ -49,7 +51,9 @@ typedef struct command_flags
int help;
int details;
int named;
- char *name;
+ int include;
+ int xclude;
+ char *name, *istr, *xstr;
int darr;
int dear;
int iarr;
@@ -60,7 +64,7 @@ typedef struct command_flags
} command_flags_t;
static void
-print_help( char **argv)
+print_help( char **argv )
{
printf( "This is the PAPI native avail program.\n" );
printf( "It provides availability and detail information for PAPI native events.\n" );
@@ -68,18 +72,26 @@ print_help( char **argv)
printf( "\nOptions:\n" );
printf( " --help, -h print this help message\n" );
printf( " -d display detailed information about native events\n" );
- printf( " -e EVENTNAME display detail information about named native event\n" );
+ printf( " -e EVENTNAME display detailed information about named native event\n" );
+ printf( " -i EVENTSTR include only event names that contain EVENTSTR\n" );
+ printf( " -x EVENTSTR exclude any event names that contain EVENTSTR\n" );
printf( " --nomasks suppress display of Unit Mask information\n" );
printf( "\nProcessor-specific options\n");
printf( " --darr display events supporting Data Address Range Restriction\n" );
printf( " --dear display Data Event Address Register events only\n" );
printf( " --iarr display events supporting Instruction Address Range Restriction\n" );
printf( " --iear display Instruction Event Address Register events only\n" );
- printf( " --opcm display events supporting OpCode Matching\n" );
+ printf( " --opcm display events supporting OpCode Matching\n" );
printf( " --nogroups suppress display of Event grouping information\n" );
printf( "\n" );
}
+static int
+no_str_arg( char *arg )
+{
+ return ( ( arg == NULL ) || ( strlen( arg ) == 0 ) || ( arg[0] == '-' ) );
+}
+
static void
parse_args( int argc, char **argv, command_flags_t * f )
{
@@ -111,8 +123,17 @@ parse_args( int argc, char **argv, command_flags_t * f )
else if ( !strcmp( argv[i], "-e" ) ) {
f->named = 1;
f->name = argv[i + 1];
- if ( ( f->name == NULL ) || ( strlen( f->name ) == 0 ) || ( f->name[0] == '-' ) )
- f->help = 1;
+ if ( no_str_arg( f->name ) ) f->help = 1;
+ i++;
+ } else if ( !strcmp( argv[i], "-i" ) ) {
+ f->include = 1;
+ f->istr = argv[i + 1];
+ if ( no_str_arg( f->istr ) ) f->help = 1;
+ i++;
+ } else if ( !strcmp( argv[i], "-x" ) ) {
+ f->xclude = 1;
+ f->xstr = argv[i + 1];
+ if ( no_str_arg( f->xstr ) ) f->help = 1;
i++;
} else if ( strstr( argv[i], "-h" ) )
f->help = 1;
@@ -243,7 +264,7 @@ main( int argc, char **argv )
}
- /* Do this code if an event name was specified on the commandline */
+ /* Do this code if the event name option was specified on the commandline */
if ( flags.named ) {
if ( PAPI_event_name_to_code( flags.name, &i ) == PAPI_OK ) {
if ( PAPI_get_event_info( i, &info ) == PAPI_OK ) {
@@ -274,11 +295,10 @@ main( int argc, char **argv )
exit( 1 );
}
}
- else {
+ else {
/* Print *ALL* available events */
-
numcmp = PAPI_num_components( );
j = 0;
@@ -302,24 +322,35 @@ main( int argc, char **argv )
retval=PAPI_enum_cmp_event( &i, PAPI_ENUM_FIRST, cid );
do {
- memset( &info, 0, sizeof ( info ) );
- retval = PAPI_get_event_info( i, &info );
+ memset( &info, 0, sizeof ( info ) );
+ retval = PAPI_get_event_info( i, &info );
- /* This event may not exist */
- if ( retval != PAPI_OK )
- continue;
+ /* This event may not exist */
+ if ( retval != PAPI_OK )
+ continue;
- /* count only events that as supported by host cpu */
- j++;
+ /* Bail if event name doesn't contain include string */
+ if ( flags.include ) {
+ if ( !strstr( info.symbol, flags.istr ) ) {
+ continue;
+ }
+ }
- print_event( &info, 0 );
+ /* Bail if event name does contain exclude string */
+ if ( flags.xclude ) {
+ if ( strstr( info.symbol, flags.xstr ) )
+ continue;
+ }
+
+ /* count only events that are actually processed */
+ j++;
- if (flags.details) {
- if (info.units[0]) printf( "| Units: %-67s|\n",
- info.units );
- }
-
+ print_event( &info, 0 );
+ if (flags.details) {
+ if (info.units[0]) printf( "| Units: %-67s|\n",
+ info.units );
+ }
/* modifier = PAPI_NTV_ENUM_GROUPS returns event codes with a
groups id for each group in which this
@@ -327,36 +358,36 @@ main( int argc, char **argv )
terminating with PAPI_ENOEVNT at the end of the list.
*/
- /* This is an IBM Power issue */
- if ( flags.groups ) {
- k = i;
- if ( PAPI_enum_cmp_event( &k, PAPI_NTV_ENUM_GROUPS, cid ) == PAPI_OK ) {
- printf( "Groups: " );
- do {
- printf( "%4d", ( ( k & PAPI_NTV_GROUP_AND_MASK ) >>
- PAPI_NTV_GROUP_SHIFT ) - 1 );
- } while ( PAPI_enum_cmp_event( &k, PAPI_NTV_ENUM_GROUPS, cid ) ==PAPI_OK );
- printf( "\n" );
- }
- }
-
- /* Print umasks */
- /* components that don't have them can just ignore */
-
- if ( flags.umask ) {
- k = i;
- if ( PAPI_enum_cmp_event( &k, PAPI_NTV_ENUM_UMASKS, cid ) == PAPI_OK ) {
- do {
- retval = PAPI_get_event_info( k, &info );
- if ( retval == PAPI_OK ) {
- if ( parse_unit_masks( &info ) )
- print_event( &info, 2 );
- }
- } while ( PAPI_enum_cmp_event( &k, PAPI_NTV_ENUM_UMASKS, cid ) == PAPI_OK );
- }
+ /* This is an IBM Power issue */
+ if ( flags.groups ) {
+ k = i;
+ if ( PAPI_enum_cmp_event( &k, PAPI_NTV_ENUM_GROUPS, cid ) == PAPI_OK ) {
+ printf( "Groups: " );
+ do {
+ printf( "%4d", ( ( k & PAPI_NTV_GROUP_AND_MASK ) >>
+ PAPI_NTV_GROUP_SHIFT ) - 1 );
+ } while ( PAPI_enum_cmp_event( &k, PAPI_NTV_ENUM_GROUPS, cid ) ==PAPI_OK );
+ printf( "\n" );
+ }
+ }
+
+ /* Print umasks */
+ /* components that don't have them can just ignore */
+
+ if ( flags.umask ) {
+ k = i;
+ if ( PAPI_enum_cmp_event( &k, PAPI_NTV_ENUM_UMASKS, cid ) == PAPI_OK ) {
+ do {
+ retval = PAPI_get_event_info( k, &info );
+ if ( retval == PAPI_OK ) {
+ if ( parse_unit_masks( &info ) )
+ print_event( &info, 2 );
+ }
+ } while ( PAPI_enum_cmp_event( &k, PAPI_NTV_ENUM_UMASKS, cid ) == PAPI_OK );
+ }
- }
- printf( "--------------------------------------------------------------------------------\n" );
+ }
+ printf( "--------------------------------------------------------------------------------\n" );
} while (PAPI_enum_cmp_event( &i, enum_modifier, cid ) == PAPI_OK );
}

View File

@ -1,180 +0,0 @@
commit c0c4caf4c1095fc6428d6773eea1f24ec496384a
Author: Maynard Johnson <maynardj@us.ibm.com>
Date: Tue Jul 23 15:44:52 2013 -0500
Add initial support for IBM POWER8 processor
Add initial support for IBM POWER8 processor
The IBM POWER8 processor (to be publicly announced at some
future date) has some preliminary support in libpfm with
a subset of native events. These POWER8-related libpfm
changes were pulled into PAPI on July 3, so further updates
in PAPI were required to support this new processor. This
patch adds that required support. NOTE: Due to the fact
that only a subset of native events have been publicised
at this point (and pushed into libpfm), not all of the
usual PAPI preset events have corresponding native events.
The rest of the POWER8 native events will be pushed
upstream once they are verified, and then we can flesh out
the PAPI preset events.
With this initial POWER8 support patch, 5 of the ctests
and ftests fail, compared to 3 when PAPI is run on a POWER7.
At least one of the failing testcases is due to testing
being done on an early POWER8 processor with some known
hardware problems. We presume the number of failing tests
will decrease once we have GA-level hardware to test on.
Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
diff --git a/src/linux-memory.c b/src/linux-memory.c
index 4a30da9..6c69fbd 100644
--- a/src/linux-memory.c
+++ b/src/linux-memory.c
@@ -486,7 +486,7 @@ PAPI_mh_info_t sys_mem_info[4] = {
,
.cache = {
[0] = { .type = PAPI_MH_TYPE_UNIFIED | PAPI_MH_TYPE_PSEUDO_LRU,
- .size = 262144, .line_size = 128, .num_lines = 256,
+ .size = 524288, .line_size = 128, .num_lines = 256,
.associativity = 8 }
,
[1] = { .type = PAPI_MH_TYPE_EMPTY, .size = -1, .line_size = -1,
@@ -514,7 +514,74 @@ PAPI_mh_info_t sys_mem_info[4] = {
}
,
}
- } // POWER7 end
+ }, // POWER7 end
+ {3,
+ {
+ [0] = { // level 1 begins
+ .tlb = {
+ /// POWER8 has an ERAT (Effective to Real Address
+ /// Translation) instead of a TLB. For the purposes of this
+ /// data, we will treat it like a TLB.
+ [0] = { .type = PAPI_MH_TYPE_INST,
+ .num_entries = 72, .page_size = 0,
+ .associativity = SHRT_MAX }
+ ,
+ [1] = { .type = PAPI_MH_TYPE_DATA,
+ .num_entries = 48, .page_size = 0,
+ .associativity = SHRT_MAX }
+ }
+ ,
+ .cache = { // level 1 caches begin
+ [0] = { .type = PAPI_MH_TYPE_INST | PAPI_MH_TYPE_PSEUDO_LRU,
+ .size = 32768, .line_size = 128, .num_lines = 64,
+ .associativity = 8 }
+ ,
+ [1] = { .type = PAPI_MH_TYPE_DATA | PAPI_MH_TYPE_WT | PAPI_MH_TYPE_LRU,
+ .size = 65536, .line_size = 128, .num_lines = 512,
+ .associativity = 8 }
+ }
+ }
+ ,
+ [1] = { // level 2 begins
+ .tlb = {
+ [0] = { .type = PAPI_MH_TYPE_UNIFIED, .num_entries = 2048,
+ .page_size = 0, .associativity = 4 }
+ ,
+ [1] = { .type = PAPI_MH_TYPE_EMPTY, .num_entries = -1,
+ .page_size = -1, .associativity = -1 }
+ }
+ ,
+ .cache = {
+ [0] = { .type = PAPI_MH_TYPE_UNIFIED | PAPI_MH_TYPE_PSEUDO_LRU,
+ .size = 262144, .line_size = 128, .num_lines = 256,
+ .associativity = 8 }
+ ,
+ [1] = { .type = PAPI_MH_TYPE_EMPTY, .size = -1, .line_size = -1,
+ .num_lines = -1, .associativity = -1 }
+ }
+ }
+ ,
+ [2] = { // level 3 begins
+ .tlb = {
+ [0] = { .type = PAPI_MH_TYPE_EMPTY, .num_entries = -1,
+ .page_size = -1, .associativity = -1 }
+ ,
+ [1] = { .type = PAPI_MH_TYPE_EMPTY, .num_entries = -1,
+ .page_size = -1, .associativity = -1 }
+ }
+ ,
+ .cache = {
+ [0] = { .type = PAPI_MH_TYPE_UNIFIED | PAPI_MH_TYPE_PSEUDO_LRU,
+ .size = 8388608, .line_size = 128, .num_lines = 65536,
+ .associativity = 8 }
+ ,
+ [1] = { .type = PAPI_MH_TYPE_EMPTY, .size = -1, .line_size = -1,
+ .num_lines = -1, .associativity = -1 }
+ }
+ }
+ ,
+ }
+ } // POWER8 end
};
#define SPRN_PVR 0x11F /* Processor Version Register */
@@ -552,6 +619,9 @@ ppc64_get_memory_info( PAPI_hw_info_t * hw_info )
case 0x3F: /* POWER7 */
index = 3;
break;
+ case 0x4b: /*POWER8*/
+ index = 4;
+ break;
default:
index = -1;
break;
diff --git a/src/papi_events.csv b/src/papi_events.csv
index 58d3e68..2e0da80 100644
--- a/src/papi_events.csv
+++ b/src/papi_events.csv
@@ -1241,6 +1241,46 @@ PRESET,PAPI_BR_MSP,NOT_DERIVED,PM_BR_MPRED
PRESET,PAPI_BR_PRC,NOT_DERIVED,PM_BR_PRED
PRESET,PAPI_FXU_IDL,NOT_DERIVED,PM_FXU_IDLE
#
+CPU,POWER8
+CPU,power8
+#
+PRESET,PAPI_L1_DCM,DERIVED_ADD,PM_LD_MISS_L1,PM_ST_MISS_L1
+PRESET,PAPI_L1_LDM,NOT_DERIVED,PM_LD_MISS_L1
+PRESET,PAPI_L1_STM,NOT_DERIVED,PM_ST_MISS_L1
+PRESET,PAPI_L1_DCW,DERIVED_POSTFIX,N0|N1|-|,PM_ST_FIN,PM_ST_MISS_L1
+#n/aPRESET,PAPI_L1_DCA,DERIVED_POSTFIX,N0|N1|-|N2|+|,PM_ST_FIN,PM_ST_MISS_L1,PM_LD_REF_L1
+#n/aPRESET,PAPI_L1_DCR,DERIVED_ADD,PM_LD_REF_L1_LSU0,PM_LD_REF_L1_LSU1
+PRESET,PAPI_L2_DCM,NOT_DERIVED,PM_DATA_FROM_L2MISS
+#n/aPRESET,PAPI_L2_LDM,NOT_DERIVED,PM_L2_LD_MISS
+#n/aPRESET,PAPI_L2_STM,NOT_DERIVED,PM_L2_ST_MISS
+PRESET,PAPI_L3_DCR,NOT_DERIVED,PM_DATA_FROM_L2MISS
+#n/aPRESET,PAPI_L3_DCM,DERIVED_ADD,PM_DATA_FROM_LMEM,PM_DATA_FROM_RMEM
+#n/aPRESET,PAPI_L3_LDM,DERIVED_ADD,PM_DATA_FROM_LMEM,PM_DATA_FROM_RMEM
+#n/aPRESET,PAPI_L1_ICH,NOT_DERIVED,PM_INST_FROM_L1
+PRESET,PAPI_L1_ICM,NOT_DERIVED,PM_L1_ICACHE_MISS
+#n/aPRESET,PAPI_L2_ICM,NOT_DERIVED,PM_L2_INST_MISS
+#n/aPRESET,PAPI_L2_ICH,NOT_DERIVED,PM_INST_FROM_L2
+#n/aPRESET,PAPI_L3_ICA,NOT_DERIVED,PM_INST_FROM_L2MISS
+#n/aPRESET,PAPI_L3_ICH,NOT_DERIVED,PM_INST_FROM_L3
+PRESET,PAPI_L3_ICM,NOT_DERIVED,PM_INST_FROM_L3MISS
+#n/aPRESET,PAPI_FMA_INS,NOT_DERIVED,PM_VSU_FMA
+PRESET,PAPI_TOT_IIS,NOT_DERIVED,PM_INST_DISP
+PRESET,PAPI_TOT_INS,NOT_DERIVED,PM_INST_CMPL
+#n/aPRESET,PAPI_INT_INS,DERIVED_ADD,PM_FXU0_FIN,PM_FXU1_FIN
+PRESET,PAPI_FP_OPS,NOT_DERIVED,PM_FLOP
+PRESET,PAPI_FP_INS,NOT_DERIVED,PM_FLOP
+PRESET,PAPI_TOT_CYC,NOT_DERIVED,PM_RUN_CYC
+PRESET,PAPI_HW_INT,NOT_DERIVED,PM_EXT_INT
+PRESET,PAPI_STL_ICY,DERIVED_POSTFIX,N0|N1|-|,PM_RUN_CYC,PM_1PLUS_PPC_DISP
+PRESET,PAPI_SR_INS,NOT_DERIVED,PM_ST_FIN
+#n/aPRESET,PAPI_LD_INS,DERIVED_ADD,PM_LD_REF_L1,PM_LD_MISS_L1
+#/naPRESET,PAPI_LST_INS,NOT_DERIVED,PM_LSU_FIN
+#PRESET,PAPI_LST_INS,DERIVED_ADD,PM_LD_REF_L1,PM_LD_MISS_L1,PM_ST_FIN
+#n/aPRESET,PAPI_BR_INS,NOT_DERIVED,PM_BRU_FIN
+#n/aPRESET,PAPI_BR_MSP,NOT_DERIVED,PM_BR_MPRED
+#n/aPRESET,PAPI_BR_PRC,NOT_DERIVED,PM_BR_PRED
+#n/aPRESET,PAPI_FXU_IDL,NOT_DERIVED,PM_FXU_IDLE
+#
CPU,ultra12
#
PRESET,PAPI_TOT_CYC,NOT_DERIVED,CYCLE_CNT

View File

@ -1,46 +0,0 @@
commit f4ec143eef7b714718b766bdc641af7856a950af
Author: William Cohen <wcohen@redhat.com>
Date: Mon Jul 22 12:26:02 2013 -0400
Correct versioning of libpapi.so
The configure for linux always set the soname to libpapi.so. This
causes problems when /sbin/ldconfig tries to update the library
information on linux. The shared library is installed as
/lib{64}/libpapi.so.$VERSION, but the shared library has the soname of
libpapi.so. ldconfig makes a symbolic link from /lib/libpapi.so to
the actual versioned shared library, /lib/{64}/libpapi.so$VERSION.
The configure should get the soname correct to avoid creating this
symbolic link.
This patch only addresses the issues for some of the possible
platforms and similar patches may be needed for other platforms.
Signed-off-by: William Cohen <wcohen@redhat.com>
diff --git a/src/configure.in b/src/configure.in
index 4bee24d..b5a6c80 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1234,10 +1234,10 @@ CTEST_TARGETS="papi_api serial forkexec_tests overflow_tests profile_tests attac
FTEST_TARGETS="all"
UTIL_TARGETS="papi_avail papi_mem_info papi_cost papi_clockres papi_native_avail papi_command_line papi_event_chooser papi_decode papi_xml_event_info papi_version papi_multiplex_cost papi_component_avail papi_error_codes"
LIBRARY=libpapi.a
-SHLIB='libpapi.so.$(PAPIVER)'
+SHLIB='libpapi.so.AC_PACKAGE_VERSION'
OMPCFLGS=-fopenmp
CC_R='$(CC) -pthread'
-CC_SHR='$(CC) -fPIC -DPIC -shared -Wl,-soname -Wl,libpapi.so -Xlinker "-rpath" -Xlinker "$(LIBDIR)"'
+CC_SHR='$(CC) -fPIC -DPIC -shared -Wl,-soname -Wl,$(SHLIB) -Xlinker "-rpath" -Xlinker "$(LIBDIR)"'
if test "$CC_COMMON_NAME" = "gcc"; then
if test "$bitmode" = "32"; then
BITFLAGS=-m32
@@ -1383,7 +1383,7 @@ elif test "$MAKEVER" = "bgp"; then
SHLIB=libpapi.so
DESCR="Linux for BlueGene/P"
LIBS=static
- CC_SHR='$(CC) -shared -Xlinker "-soname" -Xlinker "libpapi.so" -Xlinker "-rpath" -Xlinker "$(LIBDIR)"'
+ CC_SHR='$(CC) -shared -Xlinker "-soname" -Xlinker "$(SHLIB)" -Xlinker "-rpath" -Xlinker "$(LIBDIR)"'
OMPCFLGS=""
elif test "$MAKEVER" = "bgq"; then

View File

@ -1,618 +0,0 @@
commit 395b7bc70846e666552c81fb7a1aa596eb26612b
Author: James Ralph <ralph@icl.utk.edu>
Date: Thu Feb 14 10:17:40 2013 -0500
Add component tests' to the install-[all|tests] target.
Thanks to Gary Mohr.
-------------------
This makes a fairly small change to src/Makefile.inc to add logic that adds a
new install-comp_tests target which calls the install target for each component
being built.
This new target is listed as a dependency on the install-tests target so it
will happen when the 'install-all', 'install-tests', or 'install-comp_tests'
targets are used.
A note about this change, I am not real familiar with the auto make and auto
conf tools. This change was enough to make it work for me but if there is
another file that should also be changed for this modification, please help me
out here.
The patch also adds install targets to the Makefiles for all of the components
which have 'tests' directories and updates the README file which talks about
how to create component tests.
Another note, I only compile with a couple of components
(ours, rapl, and example) so if I fat fingered something in one of the other
components Makefiles I would not have noticed.
Please keep me honest and make sure you compile with them all enabled.
Thanks for adding this capability for us.
Gary
---------------------------
Makefile.inc: Add run_tests and friends to install-tests target.
Component test Makefiles' get their install location to mirror what runtests expects.
diff --git a/src/Makefile.inc b/src/Makefile.inc
index 02d5b13..e0f99c3 100644
--- a/src/Makefile.inc
+++ b/src/Makefile.inc
@@ -316,9 +316,25 @@ install-man:
install-utils:
$(SETPATH) cd utils; $(MAKE) BINDIR="$(DESTDIR)$(BINDIR)" CC="$(CC)" CC_R="$(CC_R)" CFLAGS="-I.. $(CFLAGS)" TOPTFLAGS="$(TOPTFLAGS)" SMPCFLGS="$(SMPCFLGS)" OMPCFLGS="$(OMPCFLGS)" NOOPT="$(NOOPT)" LDFLAGS="$(LDFLAGS) $(STATIC)" LIBRARY=$(LINKLIB) install
-install-tests:
+install-tests: install-comp_tests
+ $(SETPATH) cd testlib; $(MAKE) DATADIR="$(DESTDIR)$(DATADIR)" CC="$(CC)" CC_R="$(CC_R)" CFLAGS="-I.. $(CFLAGS)" TOPTFLAGS="$(TOPTFLAGS)" SMPCFLGS="$(SMPCFLGS)" OMPCFLGS="$(OMPCFLGS)" NOOPT="$(NOOPT)" LDFLAGS="$(LDFLAGS) $(STATIC)" LIBRARY=$(LINKLIB) install
$(SETPATH) cd ctests; $(MAKE) DATADIR="$(DESTDIR)$(DATADIR)" CC="$(CC)" CC_R="$(CC_R)" CFLAGS="-I.. $(CFLAGS)" TOPTFLAGS="$(TOPTFLAGS)" SMPCFLGS="$(SMPCFLGS)" OMPCFLGS="$(OMPCFLGS)" NOOPT="$(NOOPT)" LDFLAGS="$(LDFLAGS) $(STATIC)" LIBRARY=$(LINKLIB) install
$(SETPATH) cd ftests; $(MAKE) DATADIR="$(DESTDIR)$(DATADIR)" CC="$(CC)" CC_R="$(CC_R)" F77="$(F77)" CFLAGS="-I.. $(CFLAGS)" TOPTFLAGS="$(TOPTFLAGS)" SMPCFLGS="$(SMPCFLGS)" OMPCFLGS="$(OMPCFLGS)" FFLAGS="-I.. $(FFLAGS)" NOOPT="$(NOOPT)" LDFLAGS="$(LDFLAGS) $(STATIC)" LIBRARY=$(LINKLIB) install
+ -cp run_tests.sh $(DESTDIR)$(DATADIR)
+ -cp run_tests_exclude_cuda.txt $(DESTDIR)$(DATADIR)
+ -cp run_tests_exclude.txt $(DESTDIR)$(DATADIR)
+ -chmod go+rx $(DESTDIR)$(DATADIR)/run_tests.sh
+ -chmod go+r $(DESTDIR)$(DATADIR)/run_tests_exclude_cuda.txt $(DESTDIR)$(DATADIR)/run_tests_exclude.txt
+
+# Component tests installing
+install-comp_tests:
+ifneq (${COMPONENTS},)
+ @for comp in ${COMPONENTS} ; do \
+ cd components/$$comp/tests ; \
+ $(MAKE) DATADIR="$(DESTDIR)$(DATADIR)/components" install ; \
+ cd ../../.. ; \
+ done
+endif
#
# Dummy targets for configurations that do not also include a Rules file with targets
diff --git a/src/components/README b/src/components/README
index 8962a7b..59c60ec 100644
--- a/src/components/README
+++ b/src/components/README
@@ -24,7 +24,7 @@ There is one final very important naming convention that applies to components.
Adding tests to the components:
-------------------------------
-In order to add tests to a component that will be compiled together with PAPI when typing 'make' (as well as cleaned up when 'make clean' or 'make clobber' is typed), the following steps need to be carried out:
+In order to add tests to a component that will be compiled together with PAPI when typing 'make' (as well as cleaned up when 'make clean' or 'make clobber' is typed and installed when 'make install-all' or 'make install-tests' is called), the following steps need to be carried out:
1. create a directory with name 'tests' in the specific component directory
2. add your test files and a Makefile to the 'tests' directory (see the example test and Makefile in components/example/tests)
@@ -33,6 +33,7 @@ In order to add tests to a component that will be compiled together with PAPI wh
example_tests: $(TESTS)
4. Include components/Makefile_comp_tests to your component test Makefile
(see components/example/tests/Makefile for more details)
+ 5. You may also define 'clean' and/or 'install' targets (as shown in the example) which will be called during those parts of the build. If these targets are missing it will just print a message reporting the missing target and continue.
NOTE: there is no need to modify any PAPI code other than adding your tests and a Makefile to your component and follow step 1 to 4 listed above.
diff --git a/src/components/appio/tests/Makefile b/src/components/appio/tests/Makefile
index 1381d55..8fde722 100644
--- a/src/components/appio/tests/Makefile
+++ b/src/components/appio/tests/Makefile
@@ -62,6 +62,15 @@ init_fini.o: init_fini.c
appio_test_iozone: iozone/iozone_linux$(ARCH_SUFFIX).o iozone/libasync.o iozone/libbif.o init_fini.o $(UTILOBJS) $(PAPILIB)
$(CC) -g -O2 -o $@ $(LDFLAGS) $^ -lpthread -lrt
+install:
+ @echo "APPIO tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/appio/tests
+ -chmod go+rx $(DATADIR)/
+ -chmod go+rx $(DATADIR)/appio/tests
+ -cp $(ALL_TESTS) $(DATADIR)/appio/tests
+ -chmod go+rx $(DATADIR)/appio/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/appio/tests \;
+
clean:
rm -f $(ALL_TESTS) appio_test_iozone *.o
diff --git a/src/components/coretemp/tests/Makefile b/src/components/coretemp/tests/Makefile
index feb095c..deed359 100644
--- a/src/components/coretemp/tests/Makefile
+++ b/src/components/coretemp/tests/Makefile
@@ -13,6 +13,14 @@ coretemp_basic: coretemp_basic.o $(UTILOBJS) $(PAPILIB)
coretemp_pretty: coretemp_pretty.o $(UTILOBJS) $(PAPILIB)
$(CC) $(CFLAGS) $(INCLUDE) -o coretemp_pretty coretemp_pretty.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS)
+install:
+ @echo "CORETEMP tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/coretemp/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/coretemp/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/coretemp/tests \;
+ -chmod go+rx $(DATADIR)/coretemp/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/coretemp/tests \;
clean:
rm -f $(TESTS) *.o
diff --git a/src/components/cuda/tests/Makefile b/src/components/cuda/tests/Makefile
index 0d2a1fc..46b15f8 100644
--- a/src/components/cuda/tests/Makefile
+++ b/src/components/cuda/tests/Makefile
@@ -13,6 +13,15 @@ cuda_tests: $(TESTS)
HelloWorld: HelloWorld.o $(UTILOBJS) $(PAPILIB)
$(NVCC) $(INCLUDE) $(NVCFLAGS) -o HelloWorld HelloWorld.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS)
+install:
+ @echo "CUDA tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/cuda/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/cuda/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/cuda/tests \;
+ -chmod go+rx $(DATADIR)/cuda/tests/*
+ -find . -name "*.cu" -type f -exec cp {} $(DATADIR)/cuda/tests \;
+
clean:
rm -f $(TESTS) *.o
diff --git a/src/components/example/tests/Makefile b/src/components/example/tests/Makefile
index 516285a..35baca0 100644
--- a/src/components/example/tests/Makefile
+++ b/src/components/example/tests/Makefile
@@ -13,6 +13,14 @@ example_basic: example_basic.o $(UTILOBJS) $(PAPILIB)
example_multiple_components: example_multiple_components.o $(UTILOBJS) $(PAPILIB)
$(CC) $(CFLAGS) $(INCLUDE) -o example_multiple_components example_multiple_components.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS)
+install:
+ @echo "EXAMPLE tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/example/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/example/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/example/tests \;
+ -chmod go+rx $(DATADIR)/example/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/example/tests \;
clean:
rm -f $(TESTS) *.o
diff --git a/src/components/infiniband/tests/Makefile b/src/components/infiniband/tests/Makefile
new file mode 100644
index 0000000..1be407f
--- /dev/null
+++ b/src/components/infiniband/tests/Makefile
@@ -0,0 +1,28 @@
+include ../../Makefile_comp_tests
+
+TESTS = infiniband_list_events infiniband_values_by_code
+
+infiniband_tests: $(TESTS)
+
+
+%.o:%.c
+ $(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $<
+
+infiniband_list_events: infiniband_list_events.o $(UTILOBJS) $(PAPILIB)
+ $(CC) $(CFLAGS) $(INCLUDE) -o $@ $^ $(LDFLAGS)
+
+infiniband_values_by_code: infiniband_values_by_code.o $(UTILOBJS) $(PAPILIB)
+ $(CC) $(CFLAGS) $(INCLUDE) -o $@ $^ $(LDFLAGS)
+
+install:
+ @echo "Infiniband tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/infiniband/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/infiniband/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/infiniband/tests \;
+ -chmod go+rx $(DATADIR)/infiniband/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/infiniband/tests \;
+
+clean:
+ rm -f $(TESTS) *.o
+
diff --git a/src/components/infiniband/tests/infiniband_list_events.c b/src/components/infiniband/tests/infiniband_list_events.c
new file mode 100644
index 0000000..ff2b98b
--- /dev/null
+++ b/src/components/infiniband/tests/infiniband_list_events.c
@@ -0,0 +1,89 @@
+/****************************/
+/* THIS IS OPEN SOURCE CODE */
+/****************************/
+
+/**
+ * @author Jose Pedro Oliveira
+ *
+ * test case for the linux-infiniband component
+ * Adapted from its counterpart in the net component.
+ *
+ * @brief
+ * List all net events codes and names
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "papi_test.h"
+
+int main (int argc, char **argv)
+{
+ int retval,cid,numcmp;
+ int total_events=0;
+ int code;
+ char event_name[PAPI_MAX_STR_LEN];
+ int r;
+ const PAPI_component_info_t *cmpinfo = NULL;
+
+ /* Set TESTS_QUIET variable */
+ tests_quiet( argc, argv );
+
+ /* PAPI Initialization */
+ retval = PAPI_library_init( PAPI_VER_CURRENT );
+ if ( retval != PAPI_VER_CURRENT ) {
+ test_fail(__FILE__, __LINE__,"PAPI_library_init failed\n",retval);
+ }
+
+ if (!TESTS_QUIET) {
+ printf("Listing all net events\n");
+ }
+
+ numcmp = PAPI_num_components();
+
+ for(cid=0; cid<numcmp; cid++) {
+
+ if ( (cmpinfo = PAPI_get_component_info(cid)) == NULL) {
+ test_fail(__FILE__, __LINE__,"PAPI_get_component_info failed\n",-1);
+ }
+
+ if ( strstr(cmpinfo->name, "infiniband") == NULL) {
+ continue;
+ }
+
+ if (!TESTS_QUIET) {
+ printf("Component %d (%d) - %d events - %s\n",
+ cid, cmpinfo->CmpIdx,
+ cmpinfo->num_native_events, cmpinfo->name);
+ }
+
+ code = PAPI_NATIVE_MASK;
+
+ r = PAPI_enum_cmp_event( &code, PAPI_ENUM_FIRST, cid );
+ while ( r == PAPI_OK ) {
+
+ retval = PAPI_event_code_to_name( code, event_name );
+ if ( retval != PAPI_OK ) {
+ test_fail( __FILE__, __LINE__, "PAPI_event_code_to_name", retval );
+ }
+
+ if (!TESTS_QUIET) {
+ printf("0x%x %s\n", code, event_name);
+ }
+
+ total_events++;
+
+ r = PAPI_enum_cmp_event( &code, PAPI_ENUM_EVENTS, cid );
+ }
+
+ }
+
+ if (total_events==0) {
+ test_skip(__FILE__,__LINE__,"No net events found", 0);
+ }
+
+ test_pass( __FILE__, NULL, 0 );
+
+ return 0;
+}
+
+// vim:set ai ts=4 sw=4 sts=4 et:
diff --git a/src/components/infiniband/tests/infiniband_values_by_code.c b/src/components/infiniband/tests/infiniband_values_by_code.c
new file mode 100644
index 0000000..cb64b36
--- /dev/null
+++ b/src/components/infiniband/tests/infiniband_values_by_code.c
@@ -0,0 +1,137 @@
+/****************************/
+/* THIS IS OPEN SOURCE CODE */
+/****************************/
+
+/**
+ * @author Jose Pedro Oliveira
+ *
+ * test case for the linux-infiniband component
+ * Adapted from its counterpart in the net component.
+ *
+ * @brief
+ * Prints the value of every net event (by code)
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "papi_test.h"
+
+#define PINGADDR "127.0.0.1"
+
+int main (int argc, char **argv)
+{
+ int retval,cid,numcmp;
+ int EventSet = PAPI_NULL;
+ long long value;
+ 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 );
+
+ /* PAPI Initialization */
+ retval = PAPI_library_init( PAPI_VER_CURRENT );
+ if ( retval != PAPI_VER_CURRENT ) {
+ test_fail(__FILE__, __LINE__,"PAPI_library_init failed\n",retval);
+ }
+
+ if (!TESTS_QUIET) {
+ printf("Trying all net events\n");
+ }
+
+ numcmp = PAPI_num_components();
+
+ for(cid=0; cid<numcmp; cid++) {
+
+ if ( (cmpinfo = PAPI_get_component_info(cid)) == NULL) {
+ test_fail(__FILE__, __LINE__,"PAPI_get_component_info failed\n",-1);
+ }
+
+ if (!TESTS_QUIET) {
+ printf("Component %d - %d events - %s\n", cid,
+ cmpinfo->num_native_events, cmpinfo->name);
+ }
+
+ if ( strstr(cmpinfo->name, "infiniband") == NULL) {
+ continue;
+ }
+
+ code = PAPI_NATIVE_MASK;
+
+ r = PAPI_enum_cmp_event( &code, PAPI_ENUM_FIRST, cid );
+ while ( r == PAPI_OK ) {
+
+ retval = PAPI_event_code_to_name( code, event_name );
+ if ( retval != PAPI_OK ) {
+ test_fail( __FILE__, __LINE__, "PAPI_event_code_to_name", retval );
+ }
+
+ if (!TESTS_QUIET) {
+ printf("0x%x %-24s = ", code, event_name);
+ }
+
+ EventSet = PAPI_NULL;
+
+ retval = PAPI_create_eventset( &EventSet );
+ if (retval != PAPI_OK) {
+ test_fail(__FILE__, __LINE__, "PAPI_create_eventset()", retval);
+ }
+
+ retval = PAPI_add_event( EventSet, code );
+ if (retval != PAPI_OK) {
+ test_fail(__FILE__, __LINE__, "PAPI_add_event()", retval);
+ }
+
+ retval = PAPI_start( EventSet );
+ if (retval != PAPI_OK) {
+ test_fail(__FILE__, __LINE__, "PAPI_start()", retval);
+ }
+
+ if (strcmp(event_name, "_recv") == 0) {
+ /* XXX figure out a general method to generate some traffic
+ * for infiniband
+ * the operation should take more than one second in order
+ * to guarantee that the network counters are updated */
+ retval = system("ping -c 4 " PINGADDR " > /dev/null");
+ if (retval < 0) {
+ test_fail(__FILE__, __LINE__, "Unable to start ping", retval);
+ }
+ }
+
+ retval = PAPI_stop( EventSet, &value );
+ if (retval != PAPI_OK) {
+ test_fail(__FILE__, __LINE__, "PAPI_stop()", retval);
+ }
+
+ if (!TESTS_QUIET) printf("%lld\n", value);
+
+ retval = PAPI_cleanup_eventset( EventSet );
+ if (retval != PAPI_OK) {
+ test_fail(__FILE__, __LINE__, "PAPI_cleanup_eventset()", retval);
+ }
+
+ retval = PAPI_destroy_eventset( &EventSet );
+ if (retval != PAPI_OK) {
+ test_fail(__FILE__, __LINE__, "PAPI_destroy_eventset()", retval);
+ }
+
+ total_events++;
+
+ r = PAPI_enum_cmp_event( &code, PAPI_ENUM_EVENTS, cid );
+ }
+
+ }
+
+ if (total_events==0) {
+ test_skip(__FILE__,__LINE__,"No net events found", 0);
+ }
+
+ test_pass( __FILE__, NULL, 0 );
+
+ return 0;
+}
+
+// vim:set ai ts=4 sw=4 sts=4 et:
diff --git a/src/components/lustre/tests/Makefile b/src/components/lustre/tests/Makefile
index 4f2fee6..1cd905f 100644
--- a/src/components/lustre/tests/Makefile
+++ b/src/components/lustre/tests/Makefile
@@ -10,6 +10,15 @@ lustre_tests: $(TESTS)
lustre_basic: lustre_basic.o $(UTILOBJS) $(PAPILIB)
$(CC) $(CFLAGS) $(INCLUDE) -o lustre_basic lustre_basic.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS)
+install:
+ @echo "LUSTRE tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/lustre/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/lustre/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/lustre/tests \;
+ -chmod go+rx $(DATADIR)/lustre/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/lustre/tests \;
+
clean:
rm -f $(TESTS) *.o
diff --git a/src/components/micpower/tests/Makefile b/src/components/micpower/tests/Makefile
index 47e87d2..604d467 100644
--- a/src/components/micpower/tests/Makefile
+++ b/src/components/micpower/tests/Makefile
@@ -10,6 +10,14 @@ micpower_tests: $(TESTS)
micpower_basic: micpower_basic.o $(UTILOBJS) $(PAPILIB)
$(CC) $(CFLAGS) $(INCLUDE) -o micpower_basic micpower_basic.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS)
+install:
+ @echo "MICPOWER tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/micpower/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/micpower/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/micpower/tests \;
+ -chmod go+rx $(DATADIR)/micpower/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/micpower/tests \;
clean:
rm -f $(TESTS) *.o
diff --git a/src/components/mx/tests/Makefile b/src/components/mx/tests/Makefile
index 8e4c758..842987e 100644
--- a/src/components/mx/tests/Makefile
+++ b/src/components/mx/tests/Makefile
@@ -14,6 +14,15 @@ mx_basic: mx_basic.o $(UTILOBJS) $(PAPILIB)
mx_elapsed: mx_elapsed.o $(UTILOBJS) $(PAPILIB)
$(CC) $(CFLAGS) $(INCLUDE) -o mx_elapsed mx_elapsed.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS)
+install:
+ @echo "MX tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/mx/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/mx/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/mx/tests \;
+ -chmod go+rx $(DATADIR)/mx/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/mx/tests \;
+
clean:
rm -f $(TESTS) *.o
diff --git a/src/components/net/tests/Makefile b/src/components/net/tests/Makefile
index ca1b463..a104347 100644
--- a/src/components/net/tests/Makefile
+++ b/src/components/net/tests/Makefile
@@ -17,6 +17,14 @@ net_values_by_code: net_values_by_code.o $(UTILOBJS) $(PAPILIB)
net_values_by_name: net_values_by_name.o $(UTILOBJS) $(PAPILIB)
$(CC) $(CFLAGS) $(INCLUDE) -o $@ net_values_by_name.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS)
+install:
+ @echo "NET tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/net/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/net/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/net/tests \;
+ -chmod go+rx $(DATADIR)/net/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/net/tests \;
clean:
rm -f $(TESTS) *.o
diff --git a/src/components/nvml/tests/Makefile b/src/components/nvml/tests/Makefile
index 991ae7c..4edec7b 100644
--- a/src/components/nvml/tests/Makefile
+++ b/src/components/nvml/tests/Makefile
@@ -13,6 +13,15 @@ nvml_tests: $(TESTS)
HelloWorld: HelloWorld.o $(UTILOBJS) $(PAPILIB)
$(NVCC) $(INCLUDE) $(NVCFLAGS) -o HelloWorld HelloWorld.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS)
+install:
+ @echo "NVML tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/nvml/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/nvml/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/nvml/tests \;
+ -chmod go+rx $(DATADIR)/nvml/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/nvml/tests \;
+
clean:
rm -f $(TESTS) *.o
diff --git a/src/components/rapl/tests/Makefile b/src/components/rapl/tests/Makefile
index a60be32..983ffb8 100644
--- a/src/components/rapl/tests/Makefile
+++ b/src/components/rapl/tests/Makefile
@@ -22,6 +22,15 @@ rapl_basic: rapl_basic.o $(UTILOBJS) $(PAPILIB)
rapl_busy: rapl_busy.o $(UTILOBJS) $(PAPILIB)
$(CC) $(CFLAGS) $(INCLUDE) -o rapl_busy rapl_busy.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS)
+install:
+ @echo "RAPL tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/rapl/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/rapl/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/rapl/tests \;
+ -chmod go+rx $(DATADIR)/rapl/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/rapl/tests \;
+
clean:
rm -f $(TESTS) *.o *~
diff --git a/src/components/stealtime/tests/Makefile b/src/components/stealtime/tests/Makefile
index 1415477..20cb8e8 100644
--- a/src/components/stealtime/tests/Makefile
+++ b/src/components/stealtime/tests/Makefile
@@ -5,11 +5,20 @@ include ../../Makefile_comp_tests
TESTS = stealtime_basic
-lustre_tests: $(TESTS)
+stealtime_tests: $(TESTS)
stealtime_basic: stealtime_basic.o $(UTILOBJS) $(PAPILIB)
$(CC) $(CFLAGS) $(INCLUDE) -o stealtime_basic stealtime_basic.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS)
+install:
+ @echo "STEALTIME tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/stealtime/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/stealtime/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/stealtime/tests \;
+ -chmod go+rx $(DATADIR)/stealtime/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/stealtime/tests \;
+
clean:
rm -f $(TESTS) *.o
diff --git a/src/components/vmware/tests/Makefile b/src/components/vmware/tests/Makefile
index ee1f90e..c2a02f5 100644
--- a/src/components/vmware/tests/Makefile
+++ b/src/components/vmware/tests/Makefile
@@ -10,6 +10,15 @@ vmware_tests: $(TESTS)
vmware_basic: vmware_basic.o $(UTILOBJS) $(PAPILIB)
$(CC) $(CFLAGS) $(INCLUDE) -o vmware_basic vmware_basic.o $(UTILOBJS) $(PAPILIB) $(LDFLAGS)
+install:
+ @echo "VMWARE tests (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/vmware/tests
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/vmware/tests
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/vmware/tests \;
+ -chmod go+rx $(DATADIR)/vmware/tests/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/vmware/tests \;
+
clean:
rm -f $(TESTS) *.o
diff --git a/src/testlib/Makefile b/src/testlib/Makefile
index f080d23..8b39528 100644
--- a/src/testlib/Makefile
+++ b/src/testlib/Makefile
@@ -25,3 +25,11 @@ clean:
rm -f *.o *.stderr *.stdout core *~ $(ALL)
install:
+ @echo "Papi testlib (DATADIR) being installed in: \"$(DATADIR)\"";
+ -mkdir -p $(DATADIR)/testlib
+ -chmod go+rx $(DATADIR)
+ -chmod go+rx $(DATADIR)/testlib
+ -find . -perm -100 -type f -exec cp {} $(DATADIR)/testlib \;
+ -chmod go+rx $(DATADIR)/testlib/*
+ -find . -name "*.[ch]" -type f -exec cp {} $(DATADIR)/testlib \;
+

View File

@ -1,17 +1,12 @@
%bcond_with bundled_libpfm
Summary: Performance Application Programming Interface
Name: papi
Version: 5.1.1
Release: 8%{?dist}
Version: 5.2.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
Patch200: papi-testsuite1.patch
Patch210: papi-native-option.patch
Patch211: papi-man.patch
Patch212: papi-shlib.patch
Patch213: papi-power8.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: autoconf
BuildRequires: doxygen
@ -63,12 +58,6 @@ the PAPI user-space libraries and interfaces.
%prep
%setup -q
%patch200 -p1
%patch210 -p1
%patch211 -p1
%patch212 -p1 -b .shlib
%patch213 -p1 -b .power8
%build
%if %{without bundled_libpfm}
# Build our own copy of libpfm.
@ -80,12 +69,13 @@ autoconf
%configure --with-perf-events \
%{?libpfm_config} \
--with-static-lib=yes --with-shared-lib=yes --with-shlib \
--with-components="appio coretemp example lmsensors lustre mx net rapl stealtime"
--with-components="appio coretemp example lmsensors lustre micpower mx net rapl"
#components currently left out because of build configure/build issues
#--with-components="appio cuda vmware"
#--with-components="appio cuda host_micpower nvml perf_event perf_event_uncore stealtime vmware"
pushd components
#pushd cuda; ./configure; popd
#pushd host_micpower; ./configure; popd
pushd infiniband; %configure; popd
pushd lmsensors; \
%configure --with-sensors_incdir=/usr/include/sensors \
@ -147,6 +137,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/*.a
%changelog
* Wed Aug 07 2013 William Cohen <wcohen@redhat.com> - 5.2.0-1
- Rebase to 5.2.0
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

View File

@ -1 +1 @@
055c5b3d7f5223ab46fd720f1c3e0749 papi-5.1.1.tar.gz
579e2bd5f29f7a28a4c9f30241107f0b papi-5.2.0.tar.gz