I want to get the L1 cache load miss of some code. But the code is too short(written in assembly) to get a stable and precise values.
And i calculate the l1 cache load miss when nothing to do between the PAPI_start and PAPI_read, the result is 1~12. So how can get a precise value of PAPI event?
My code is like this:
in a for loop:
/* Start counting events in the Event Set */
if (PAPI_reset(EventSet) != PAPI_OK) {
printf("PAPI reset failed. \n");
return -1;//handle_error(1);
}
//some code
.....
/* Read the counting events in the Event Set */
if (PAPI_read(EventSet, values) != PAPI_OK) {
printf("PAPI read failed. \n");
return -1;
}
get the values and store.