Go to the source code of this file.
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 56 of file papi_command_line.c.
68 printf(
"\nThis utility lets you add events from the command line " 69 "interface to see if they work.\n\n" );
73 fprintf(stderr,
"Error! PAPI_library_init\n");
79 fprintf(stderr,
"Error! PAPI_create_eventset\n");
84 (
long long * ) malloc(
sizeof (
long long ) * (
size_t ) argc );
85 success = (
char * ) malloc( (
size_t ) argc );
87 if ( success == NULL ||
values == NULL ) {
88 fprintf(stderr,
"Error allocating memory!\n");
93 if ( !strcmp( argv[
i],
"-h" ) ) {
96 }
else if ( !strcmp( argv[
i],
"-u" ) ) {
98 }
else if ( !strcmp( argv[
i],
"-x" ) ) {
102 printf(
"Failed adding: %s\nbecause: %s\n", argv[
i],
106 printf(
"Successfully added: %s\n", argv[
i] );
113 printf(
"No events specified!\n");
114 printf(
"Try running something like: %s PAPI_TOT_CYC\n\n",
127 fprintf(stderr,
"Error! PAPI_start\n");
136 fprintf(stderr,
"Error! PAPI_stop\n");
142 if (! (u_format || hex_format) ) {
151 printf(
"%s : \t%llu(u)", argv[
i], (
unsigned long long)
values[j] );
154 printf(
"%s : \t%0.3f", argv[
i], *((
double *)(&
values[j])) );
157 printf(
"%s : \t%#llX", argv[
i],
values[j] );
161 printf(
"%s : \t%lld", argv[
i],
values[j] );
167 if (u_format) printf(
"%s : \t%llu(u)\n", argv[
i], (
unsigned long long)
values[j] );
168 if (hex_format) printf(
"%s : \t%#llX\n", argv[
i],
values[j] );
171 printf(
"\n----------------------------------\n" );
int PAPI_stop(int EventSet, long long *values)
char units[PAPI_MIN_STR_LEN]
int PAPI_event_name_to_code(const char *in, int *out)
static void print_help(char **argv)
int PAPI_get_event_info(int EventCode, PAPI_event_info_t *info)
int PAPI_add_named_event(int EventSet, const char *EventName)
int PAPI_library_init(int version)
void do_misses(int n, int bytes)
int PAPI_create_eventset(int *EventSet)
char * PAPI_strerror(int errorCode)
int data_type[MAX_EVENTS]
int PAPI_start(int EventSet)
#define L1_MISS_BUFFER_SIZE_INTS
static long long values[NUM_EVENTS]
◆ print_help()
| static void print_help |
( |
char ** |
argv | ) |
|
|
static |
Definition at line 40 of file papi_command_line.c.
42 printf(
"Usage: %s [options] [EVENTNAMEs]\n", argv[0] );
43 printf(
"Options:\n\n" );
44 printf(
"General command options:\n" );
45 printf(
"\t-u Display output values as unsigned integers\n" );
46 printf(
"\t-x Display output values as hexadecimal\n" );
47 printf(
"\t-h Print this help message\n" );
48 printf(
"\tEVENTNAMEs Specify one or more preset or native events\n" );
50 printf(
"This utility performs work while measuring the specified events.\n" );
51 printf(
"It can be useful for sanity checks on given events and sets of events.\n" );