48main(
int argc,
char ** argv) {
59 printf(
"usage: %s -d <duration> [ -l <loops>][-s][-m metric[:device=0][:tile=0]]\n", argv[0]);
63 retVal = putenv(
"ZET_ENABLE_API_TRACING_EXP=0");
66 printf(
"Invalid input parameters.\n");
67 printf(
"usage: %s -d <duration> [ -l <loops>][-s][-m metric[:device=0][:tile=0]]\n", argv[0]);
81 fprintf(
stderr,
"Error on enum_cmp_event for component[ %s ], abort.\n",
COMP_NAME);
87 memset( &info, 0,
sizeof ( info ) );
96 fprintf(
stderr,
"Error on enum_cmp_event, abort.\n");
100 retVal =
initMetricSet(metric_names, num_metrics, &event_set);
105 long long *
metric_values = (
long long *)calloc(num_metrics,
sizeof(
long long));
107 fprintf(
stderr,
"Memory allocation failed, abort.\n");
113 fprintf(
stderr,
"Error on PAPI_start, retVal %d\n", retVal);
121 for (uint32_t
i=0;
i<param.
loops;
i++) {
123 for (
int j=0; j<num_metrics; j++) {
124 printf(
"%-50s ...... %llu\n", metric_names[j],
metric_values[j]);
135 fprintf(
stderr,
"Error on PAPI_stop, retVal %d\n", retVal);
140 for (
int i=0;
i<num_metrics;
i++) {
Enumerate PAPI preset or native events for a given component.
Get the event's name and description info.
Read hardware counters from an event set.
Reset the hardware event counts in an event set.
Finish using PAPI and free all related resources.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
int parseInputParam(int argc, char **argv, InParams *param)
int initMetricSet(char **metric_names, int num_metrics, int *eventSet)
long long metric_values[MAX_NUM_METRICS]
Return codes and api definitions.