int retval;
/* Initialize the library */
retval = PAPI_library_init(PAPI_VER_CURRENT);
if (retval > 0 && retval != PAPI_VER_CURRENT) {
fprintf(stderr,"PAPI library version mismatch!0);
exit(1); }
if (retval < 0)
handle_error(retval);
if ((retval = PAPI_set_domain(PAPI_DOM_KERNEL)) != PAPI_OK)
handle_error(retval);
if ((retval = PAPI_create_eventset(&EventSet)) != PAPI_OK)
handle_error(retval);