Go to the source code of this file.
|
| int | main (int argc, char **argv) |
| |
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 20 of file perf_event_amd_northbridge.c.
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",
150 fprintf(stderr,
"Error trying to use event %s\n",
event_name);
172 printf(
"AMD fam15h Northbridge test:\n");
char event_name[2][PAPI_MAX_STR_LEN]
int PAPI_stop(int EventSet, long long *values)
void test_pass(const char *filename)
A pointer to the following is passed to PAPI_set/get_opt()
int PAPI_set_opt(int option, PAPI_option_t *ptr)
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_add_named_event(int EventSet, const char *EventName)
int PAPI_library_init(int version)
int PAPI_get_component_index(const char *name)
int PAPI_assign_eventset_component(int EventSet, int cidx)
int PAPI_create_eventset(int *EventSet)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_start(int EventSet)
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
static long long values[NUM_EVENTS]