Created
November 11, 2014 23:35
-
-
Save goyalankit/35915da583c84927f403 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <papi.h> | |
#include <stdio.h> | |
main() | |
{ | |
int EventCode, retval; | |
char EventCodeStr[PAPI_MAX_STR_LEN]; | |
/* Initialize the library */ | |
retval = PAPI_library_init(PAPI_VER_CURRENT); | |
if (retval != PAPI_VER_CURRENT) { | |
fprintf(stderr, "PAPI library init error!\n"); | |
exit(1); | |
} | |
EventCode = 0 | PAPI_NATIVE_MASK; | |
do { | |
/* Translate the integer code to a string */ | |
if (PAPI_event_code_to_name(EventCode, EventCodeStr) == PAPI_OK) | |
/* Print all the native events for this platform */ | |
printf("Name: %s\nCode: %x\n", EventCodeStr, EventCode); | |
} while (PAPI_enum_event(&EventCode, 0) == PAPI_OK); | |
int ECode = 0 | PAPI_NATIVE_MASK; | |
PAPI_event_name_to_code("BR_INST_EXEC.TAKEN_INDIRECT_NEAR_RETURN", &ECode); | |
printf("Name: %s\nCode: %x\n", "BR_INST_EXEC.TAKEN_INDIRECT_NEAR_RETURN", ECode); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment