int EventSet = PAPI_NULL;
unsigned int native = 0x0;
long_long values[1];
if (PAPI_create_eventset(&EventSet) != PAPI_OK)
handle_error(1);
/* Add Total Instructions Executed to our EventSet */
if (PAPI_add_event(EventSet, PAPI_TOT_INS) != PAPI_OK)
handle_error(1);
/* Start counting */
if (PAPI_start(EventSet) != PAPI_OK)
handle_error(1);
poorly_tuned_function();
if (PAPI_stop(EventSet, values) != PAPI_OK)
handle_error(1);
printf("%lld\n",values[0]);
if (PAPI_reset(EventSet) != PAPI_OK)
handle_error(1);