13#include <sys/utsname.h>
20int main(
int argc,
char **argv ) {
29 struct utsname uname_info;
35 if (!
quiet) printf(
"Found Linux %s\n",uname_info.release);
45 if ( hwinfo == NULL ) {
46 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 0 );
50 if (!
quiet) printf(
"Test only for AMD machines\n");
51 test_skip(__FILE__,__LINE__,
"Test only for AMD processor",0);
55 if (!
quiet) printf(
"Test only for fam15h AMD machines\n");
56 test_skip(__FILE__,__LINE__,
"Test only for fam15h AMD processor",0);
59 if (!strcmp(uname_info.release,
"3.9")) {
61 if (!
quiet) printf(
"Detected 3.9 kernel, using perf_event\n");
68 test_skip(__FILE__,__LINE__,
"perf_event component not found",0);
72 strncpy(
event_name,
"DRAM_ACCESSES:ALL", BUFSIZ);
79 printf(
"Detected > 3.9 kernel, using perf_event_uncore\n");
85 test_skip(__FILE__,__LINE__,
"perf_event_uncore component not found",0);
90 strncpy(
event_name,
"DRAM_ACCESSES:ALL", BUFSIZ);
112 "this test; trying to PAPI_CPU_ATTACH; need to run as root",
127 "this test; trying to set PAPI_GRN_SYS",
142 "this test; trying to set PAPI_DOM_ALL; need to run as root",
172 printf(
"AMD fam15h Northbridge test:\n");
add PAPI preset or native hardware event by name to an EventSet
Assign a component index to an existing but empty EventSet.
Create a new empty PAPI EventSet.
returns the component index for the named component
get information about the system hardware
initialize the PAPI library.
Set PAPI library or event set options.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
char event_name[2][PAPI_MAX_STR_LEN]
static long long values[NUM_EVENTS]
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
A pointer to the following is passed to PAPI_set/get_opt()