Im trying to use PAPI_event_name_to_code function and I am having some problems.
This is the code I am using
- Code: Select all
int* counter_translated;
PAPI_event_name_to_code("PAPI_L2_TCM",counter_translated);
printf("code=%x\n", counter_translated);
PAPI_add_event(EventSet, *counter_translated);
The result is
- Code: Select all
code=0
Segmentation fault (core dumped)
I have been trying with other counters and I have the same problem. The pointer is pointing to null (=0) afther the execution.
Does anyone see anything wrong?
Thanks.
