PAPI  5.3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pe_libpfm4_events.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int _pe_libpfm4_setup_presets (char *name, int type, int cidx)
 
int _pe_libpfm4_ntv_enum_events (unsigned int *EventCode, int modifier, struct native_event_table_t *event_table)
 
int _pe_libpfm4_ntv_name_to_code (char *ntv_name, unsigned int *EventCode, struct native_event_table_t *event_table)
 
int _pe_libpfm4_ntv_code_to_name (unsigned int EventCode, char *name, int len, struct native_event_table_t *event_table)
 
int _pe_libpfm4_ntv_code_to_descr (unsigned int EventCode, char *name, int len, struct native_event_table_t *event_table)
 
int _pe_libpfm4_shutdown (struct native_event_table_t *event_table)
 
int _pe_libpfm4_init (papi_vector_t *my_vector, int cidx, struct native_event_table_t *event_table, int pmu_type)
 
int _pe_libpfm4_ntv_code_to_info (unsigned int EventCode, PAPI_event_info_t *info, struct native_event_table_t *event_table)
 
int _pe_libpfm4_setup_counters (struct perf_event_attr *attr, int event, struct native_event_table_t *event_table)
 

Function Documentation

int _pe_libpfm4_init ( papi_vector_t my_vector,
int  cidx,
struct native_event_table_t event_table,
int  pmu_type 
)

Definition at line 1343 of file pe_libpfm4_events.c.

1345  {
1346 
1347  int detected_pmus=0, found_default=0;
1348  int i;
1349  pfm_err_t retval = PFM_SUCCESS;
1350  unsigned int ncnt;
1351  pfm_pmu_info_t pinfo;
1352 
1353  /* allocate the native event structure */
1354 
1355  event_table->num_native_events=0;
1356  event_table->pmu_type=pmu_type;
1357 
1358  event_table->native_events=calloc(NATIVE_EVENT_CHUNK,
1359  sizeof(struct native_event_t));
1360  if (event_table->native_events==NULL) {
1361  return PAPI_ENOMEM;
1362  }
1364 
1365  /* Count number of present PMUs */
1366  detected_pmus=0;
1367  ncnt=0;
1368 
1369  /* need to init pinfo or pfmlib might complain */
1370  memset(&(event_table->default_pmu), 0, sizeof(pfm_pmu_info_t));
1371  /* init default pmu */
1372  retval=pfm_get_pmu_info(0, &(event_table->default_pmu));
1373 
1374  SUBDBG("Detected pmus:\n");
1375  for(i=0;i<PFM_PMU_MAX;i++) {
1376  memset(&pinfo,0,sizeof(pfm_pmu_info_t));
1377  retval=pfm_get_pmu_info(i, &pinfo);
1378  if (retval!=PFM_SUCCESS) {
1379  continue;
1380  }
1381 
1382  if (pmu_is_present_and_right_type(&pinfo,pmu_type)) {
1383  SUBDBG("\t%d %s %s %d\n",i,pinfo.name,pinfo.desc,pinfo.type);
1384 
1385  detected_pmus++;
1386  ncnt+=pinfo.nevents;
1387 
1388  if (pmu_type&PMU_TYPE_CORE) {
1389 
1390  /* Hack to have "default" PMU */
1391  if ( (pinfo.type==PFM_PMU_TYPE_CORE) &&
1392  strcmp(pinfo.name,"ix86arch")) {
1393 
1394  SUBDBG("\t %s is default\n",pinfo.name);
1395  memcpy(&(event_table->default_pmu),
1396  &pinfo,sizeof(pfm_pmu_info_t));
1397  found_default++;
1398  }
1399  }
1400  if (pmu_type==PMU_TYPE_UNCORE) {
1401  /* To avoid confusion, no "default" CPU for uncore */
1402  found_default=1;
1403  }
1404  }
1405  }
1406  SUBDBG("%d native events detected on %d pmus\n",ncnt,detected_pmus);
1407 
1408  if (!found_default) {
1409  SUBDBG("Could not find default PMU\n");
1410  return PAPI_ECMP;
1411  }
1412 
1413  if (found_default>1) {
1414  PAPIERROR("Found too many default PMUs!\n");
1415  return PAPI_ECMP;
1416  }
1417 
1418  my_vector->cmp_info.num_native_events = ncnt;
1419 
1420  my_vector->cmp_info.num_cntrs = event_table->default_pmu.num_cntrs+
1421  event_table->default_pmu.num_fixed_cntrs;
1422 
1423  SUBDBG( "num_counters: %d\n", my_vector->cmp_info.num_cntrs );
1424 
1425  /* Setup presets, only if Component 0 */
1426  if (cidx==0) {
1427  retval = _papi_load_preset_table( (char *)event_table->default_pmu.name,
1428  event_table->default_pmu.pmu, cidx );
1429  if ( retval ) {
1430  return retval;
1431  }
1432  }
1433 
1434  return PAPI_OK;
1435 }
memset(eventId, 0, size)
#define PAPI_ENOMEM
Definition: fpapi.h:107
struct native_event_t * native_events
#define NATIVE_EVENT_CHUNK
return PAPI_OK
Definition: linux-nvml.c:458
PAPI_component_info_t cmp_info
Definition: papi_vector.h:20
int i
Definition: fileop.c:140
static int cidx
Definition: event_info.c:40
#define PAPI_ECMP
Definition: fpapi.h:109
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
void PAPIERROR(char *format,...)
#define PMU_TYPE_CORE
int _papi_load_preset_table(char *pmu_str, int pmu_type, int cidx)
Definition: papi_preset.c:299
static int pmu_is_present_and_right_type(pfm_pmu_info_t *pinfo, int type)
#define PMU_TYPE_UNCORE
pfm_pmu_info_t default_pmu
ssize_t retval
Definition: libasync.c:338

Here is the call graph for this function:

Here is the caller graph for this function:

int _pe_libpfm4_ntv_code_to_descr ( unsigned int  EventCode,
char *  name,
int  len,
struct native_event_table_t event_table 
)

Definition at line 902 of file pe_libpfm4_events.c.

905 {
906  int ret,a,first_mask=1;
907  char *eventd, *tmp=NULL;
908  pfm_event_info_t gete;
909 
910  pfm_event_attr_info_t ainfo;
911  char *b;
912  char event_string[BUFSIZ],*ptr;
913  char temp_string[BUFSIZ];
914 
915  struct native_event_t *our_event;
916 
917  SUBDBG("ENTER %#x\n",EventCode);
918 
919  our_event=find_existing_event_by_number(EventCode,event_table);
920  if (our_event==NULL) {
921  return PAPI_ENOEVNT;
922  }
923 
924  SUBDBG("Getting info on %#x\n",our_event->libpfm4_idx);
925 
926  /* libpfm requires the structure be zeroed */
927  memset( &gete, 0, sizeof ( gete ) );
928 
929  ret=pfm_get_event_info(our_event->libpfm4_idx, PFM_OS_PERF_EVENT, &gete);
930  if (ret<0) {
931  SUBDBG("Return=%d\n",ret);
932  return _papi_libpfm4_error(ret);
933  }
934 
935  eventd=strdup(gete.desc);
936 
937  tmp = ( char * ) malloc( strlen( eventd ) + 1 );
938  if ( tmp == NULL ) {
939  free( eventd );
940  return PAPI_ENOMEM;
941  }
942 
943  tmp[0] = '\0';
944  strcat( tmp, eventd );
945  free( eventd );
946 
947  /* Handle Umasks */
948 
949  /* attributes concactinated onto end of descr separated by ", masks" */
950  /* then comma separated */
951 
952  strcpy(event_string,our_event->allocated_name);
953 
954  /* Point to first umask */
955 
956  /* Skip the pmu name :: if one exists */
957  if (strstr(event_string,"::")) {
958  ptr=strstr(event_string,"::");
959  ptr+=2;
960  b=strtok(ptr,":");
961  }
962  else {
963  b=strtok(event_string,":");
964  }
965 
966  /* if no umask, then done */
967  if (!b) {
968  SUBDBG("No colon!\n"); /* no umask */
969  goto descr_in_tmp;
970  }
971 
972  /* skip first */
973  b=strtok(NULL,":");
974  if (!b) {
975  SUBDBG("Skipping first failed\n");
976  goto descr_in_tmp;
977  }
978 
979  /* loop through all umasks, seeing which match */
980  while(b) {
981  a=0;
982  while(1) {
983 
984  SUBDBG("get_event_attr %#x %p\n",our_event->libpfm4_idx,&ainfo);
985 
986  memset(&ainfo,0,sizeof(pfm_event_attr_info_t));
987 
988  ret = pfm_get_event_attr_info(our_event->libpfm4_idx, a,
989  PFM_OS_PERF_EVENT, &ainfo);
990  if (ret != PFM_SUCCESS) {
991  free( tmp );
992  SUBDBG("get_event_attr failed %s\n",pfm_strerror(ret));
993  return _papi_libpfm4_error(ret);
994  }
995 
996  /* Plain UMASK case */
997  if (ainfo.type == PFM_ATTR_UMASK) {
998 
999  SUBDBG("Trying %s with %s\n",ainfo.name,b);
1000 
1001  if (!strcasecmp(ainfo.name, b)) {
1002  int new_length;
1003 
1004  SUBDBG("Found %s\n",b);
1005  new_length=strlen(ainfo.desc);
1006 
1007  if (first_mask) {
1008  tmp=realloc(tmp,strlen(tmp)+new_length+1+strlen(", masks:"));
1009  strcat(tmp,", masks:");
1010  first_mask=0;
1011  }
1012  else {
1013  tmp=realloc(tmp,strlen(tmp)+new_length+1+strlen(","));
1014  strcat(tmp,",");
1015  }
1016  strcat(tmp,ainfo.desc);
1017 
1018  goto found_attr;
1019  }
1020  }
1021 
1022  /* Boolean Case */
1023  if (ainfo.type == PFM_ATTR_MOD_BOOL) {
1024 
1025  sprintf(temp_string,"%s=0",ainfo.name);
1026 
1027  SUBDBG("Trying %s with %s\n",temp_string,b);
1028 
1029  if (!strcasecmp(temp_string, b)) {
1030  int new_length;
1031 
1032  SUBDBG("Found %s\n",b);
1033  new_length=strlen(ainfo.desc);
1034 
1035  if (first_mask) {
1036  tmp=realloc(tmp,strlen(tmp)+new_length+1+strlen(", masks:"));
1037  strcat(tmp,", masks:");
1038  first_mask=0;
1039  }
1040  else {
1041  tmp=realloc(tmp,strlen(tmp)+new_length+1+strlen(","));
1042  strcat(tmp,",");
1043  }
1044  strcat(tmp,ainfo.desc);
1045 
1046  goto found_attr;
1047  }
1048  }
1049 
1050  /* Integer Case */
1051  if (ainfo.type == PFM_ATTR_MOD_INTEGER) {
1052 
1053  sprintf(temp_string,"%s=0",ainfo.name);
1054 
1055  SUBDBG("Trying %s with %s\n",temp_string,b);
1056 
1057  if (!strcasecmp(temp_string, b)) {
1058  int new_length;
1059 
1060  SUBDBG("Found %s\n",b);
1061  new_length=strlen(ainfo.desc);
1062 
1063  if (first_mask) {
1064  tmp=realloc(tmp,strlen(tmp)+new_length+1+strlen(", masks:"));
1065  strcat(tmp,", masks:");
1066  first_mask=0;
1067  }
1068  else {
1069  tmp=realloc(tmp,strlen(tmp)+new_length+1+strlen(","));
1070  strcat(tmp,",");
1071  }
1072  strcat(tmp,ainfo.desc);
1073 
1074  goto found_attr;
1075  }
1076  }
1077 
1078  a++;
1079  }
1080 
1081  SUBDBG("attr=%s not found for event %s\n", b, ainfo.name);
1082 
1083  return PAPI_EATTR;
1084 
1085 found_attr:
1086 
1087  b=strtok(NULL,":");
1088  }
1089 
1090  /* We are done and the description to copy is in tmp */
1091 descr_in_tmp:
1092  strncpy( ntv_descr, tmp, ( size_t ) len );
1093  if ( ( int ) strlen( tmp ) > len - 1 )
1094  ret = PAPI_EBUF;
1095  else
1096  ret = PAPI_OK;
1097  free( tmp );
1098 
1099  SUBDBG("PFM4 Code: %#x %s\n",EventCode,ntv_descr);
1100 
1101  return ret;
1102 }
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
memset(eventId, 0, size)
#define PAPI_ENOMEM
Definition: fpapi.h:107
#define PAPI_ENOEVNT
Definition: fpapi.h:112
#define PAPI_EATTR
Definition: fpapi.h:127
return PAPI_OK
Definition: linux-nvml.c:458
int _papi_libpfm4_error(int pfm_error)
static double a[MATRIX_SIZE][MATRIX_SIZE]
Definition: rapl_basic.c:37
long long ret
Definition: iozone.c:1346
static struct native_event_t * find_existing_event_by_number(int eventnum, struct native_event_table_t *event_table)
free(dummyfile[xx])
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
strcat(command, mountname)
strcpy(filename, default_filename)
static double b[MATRIX_SIZE][MATRIX_SIZE]
Definition: rapl_basic.c:38
#define PAPI_EBUF
Definition: fpapi.h:125
long long tmp
Definition: iozone.c:12031
char * ptr
Definition: iozone.c:23586

Here is the call graph for this function:

Here is the caller graph for this function:

int _pe_libpfm4_ntv_code_to_info ( unsigned int  EventCode,
PAPI_event_info_t info,
struct native_event_table_t event_table 
)

Definition at line 1106 of file pe_libpfm4_events.c.

1109 {
1110 
1111 
1112  struct native_event_t *our_event;
1113 
1114  SUBDBG("ENTER %#x\n",EventCode);
1115 
1116  our_event=find_existing_event_by_number(EventCode,event_table);
1117  if (our_event==NULL) {
1118  return PAPI_ENOEVNT;
1119  }
1120 
1121  strncpy(info->symbol, our_event->allocated_name, sizeof(info->symbol));
1122 
1123  if (strlen(our_event->allocated_name) > sizeof(info->symbol)) {
1124  return PAPI_EBUF;
1125  }
1126 
1127  _pe_libpfm4_ntv_code_to_descr(EventCode,info->long_descr,
1128  sizeof(info->long_descr),event_table);
1129 
1130  return PAPI_OK;
1131 }
#define PAPI_ENOEVNT
Definition: fpapi.h:112
char long_descr[PAPI_HUGE_STR_LEN]
Definition: papi.h:964
char symbol[PAPI_HUGE_STR_LEN]
Definition: papi.h:961
return PAPI_OK
Definition: linux-nvml.c:458
static struct native_event_t * find_existing_event_by_number(int eventnum, struct native_event_table_t *event_table)
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
int _pe_libpfm4_ntv_code_to_descr(unsigned int EventCode, char *ntv_descr, int len, struct native_event_table_t *event_table)
#define PAPI_EBUF
Definition: fpapi.h:125

Here is the call graph for this function:

Here is the caller graph for this function:

int _pe_libpfm4_ntv_code_to_name ( unsigned int  EventCode,
char *  name,
int  len,
struct native_event_table_t event_table 
)

Definition at line 855 of file pe_libpfm4_events.c.

858 {
859 
860  struct native_event_t *our_event;
861 
862  SUBDBG("ENTER %#x\n",EventCode);
863 
864  our_event=find_existing_event_by_number(EventCode,event_table);
865  if (our_event==NULL) {
866  return PAPI_ENOEVNT;
867  }
868 
869  strncpy(ntv_name,our_event->allocated_name,len);
870 
871  if (strlen(our_event->allocated_name) > (unsigned)len) {
872  return PAPI_EBUF;
873  }
874 
875  return PAPI_OK;
876 }
#define PAPI_ENOEVNT
Definition: fpapi.h:112
return PAPI_OK
Definition: linux-nvml.c:458
static struct native_event_t * find_existing_event_by_number(int eventnum, struct native_event_table_t *event_table)
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
#define PAPI_EBUF
Definition: fpapi.h:125

Here is the call graph for this function:

Here is the caller graph for this function:

int _pe_libpfm4_ntv_enum_events ( unsigned int EventCode,
int  modifier,
struct native_event_table_t event_table 
)

Definition at line 1152 of file pe_libpfm4_events.c.

1154  {
1155 
1156  int code,ret;
1157  struct native_event_t *current_event;
1158 
1159  SUBDBG("ENTER\n");
1160 
1161  /* return first event if so specified */
1162  if ( modifier == PAPI_ENUM_FIRST ) {
1163 
1164  unsigned int papi_event=0;
1165 
1166  SUBDBG("ENUM_FIRST\n");
1167 
1168  code=get_event_first_active(event_table->pmu_type);
1169  SUBDBG("ENUM_FIRST code: %d\n",code);
1170  if (code < 0 ) {
1171  return code;
1172  }
1173 
1174  /* convert the libpfm4 event to a PAPI event */
1175  ret=convert_pfmidx_to_native(code, &papi_event,event_table);
1176 
1177  *PapiEventCode=(unsigned int)papi_event;
1178 
1179  SUBDBG("FOUND %#x (from %#x) ret=%d\n",*PapiEventCode,code,ret);
1180 
1181  return ret;
1182  }
1183 
1184  /* If we get this far, we're looking for a */
1185  /* next-event. So gather info on the current one */
1186  current_event=find_existing_event_by_number(*PapiEventCode,
1187  event_table);
1188  if (current_event==NULL) {
1189  SUBDBG("EVENTS %#x not found\n",*PapiEventCode);
1190  return PAPI_ENOEVNT;
1191  }
1192 
1193 
1194  /* Handle looking for the next event */
1195 
1196  if ( modifier == PAPI_ENUM_EVENTS ) {
1197 
1198  unsigned int papi_event=0;
1199 
1200  SUBDBG("PAPI_ENUM_EVENTS %#x\n",*PapiEventCode);
1201 
1202  code=current_event->libpfm4_idx;
1203 
1204  ret=find_next_no_aliases(code,event_table->pmu_type);
1205  SUBDBG("find_next_no_aliases() Returned %#x\n",ret);
1206  if (ret<0) {
1207  return ret;
1208  }
1209 
1210  /* Convert libpfm4 event code to PAPI event code */
1211  ret=convert_pfmidx_to_native(ret, &papi_event, event_table);
1212  if (ret<0) {
1213  SUBDBG("Couldn't convert to native %d %s\n",
1214  ret,PAPI_strerror(ret));
1215  return ret;
1216  }
1217 
1218  *PapiEventCode=(unsigned int)papi_event;
1219 
1220  SUBDBG("Returning PAPI_OK\n");
1221 
1222  return ret;
1223  }
1224 
1225  /* We don't handle PAPI_NTV_ENUM_UMASK_COMBOS */
1226  if ( modifier == PAPI_NTV_ENUM_UMASK_COMBOS ) {
1227  return PAPI_ENOIMPL;
1228  }
1229 
1230  /* Enumerate PAPI_NTV_ENUM_UMASKS (umasks on an event) */
1231  if ( modifier == PAPI_NTV_ENUM_UMASKS ) {
1232 
1233  int max_umask,next_umask;
1234  char umask_string[BUFSIZ],new_name[BUFSIZ];
1235 
1236  SUBDBG("Finding maximum mask in event %s\n",
1237  current_event->allocated_name);
1238 
1239  max_umask=find_max_umask(current_event);
1240  SUBDBG("Found max %d\n",max_umask);
1241 
1242  if (max_umask<0) {
1243  if (max_umask==PFM_ERR_UMASK) {
1244  max_umask=-1; /* needed for find_next_umask() to work */
1245  /* indicates the event as passed had no */
1246  /* umask in it. */
1247  }
1248  else {
1249  return _papi_libpfm4_error(max_umask);
1250  }
1251  }
1252 
1253  next_umask=find_next_umask(current_event,max_umask,
1254  umask_string);
1255 
1256  SUBDBG("Found next %d\n",next_umask);
1257 
1258  if (next_umask>=0) {
1259 
1260  unsigned int papi_event;
1261 
1262  sprintf(new_name,"%s:%s",current_event->base_name,
1263  umask_string);
1264 
1265  SUBDBG("Found new name %s\n",new_name);
1266 
1267  ret=_pe_libpfm4_ntv_name_to_code(new_name,&papi_event,
1268  event_table);
1269  if (ret!=PAPI_OK) {
1270  return PAPI_ENOEVNT;
1271  }
1272 
1273  *PapiEventCode=(unsigned int)papi_event;
1274  SUBDBG("found code %#x\n",*PapiEventCode);
1275 
1276  return PAPI_OK;
1277  }
1278 
1279  SUBDBG("couldn't find umask\n");
1280 
1281  return _papi_libpfm4_error(next_umask);
1282 
1283  }
1284 
1285  /* An unknown enumeration method was indicated */
1286 
1287  return PAPI_ENOIMPL;
1288 }
sprintf(splash[splash_line++],"\tIozone: Performance Test of File I/O\n")
#define PAPI_ENOIMPL
Definition: fpapi.h:124
static int find_next_no_aliases(int code, int pmu_type)
int _pe_libpfm4_ntv_name_to_code(char *name, unsigned int *event_code, struct native_event_table_t *event_table)
#define PAPI_ENOEVNT
Definition: fpapi.h:112
return PAPI_OK
Definition: linux-nvml.c:458
int _papi_libpfm4_error(int pfm_error)
long long ret
Definition: iozone.c:1346
static int get_event_first_active(int pmu_type)
static struct native_event_t * find_existing_event_by_number(int eventnum, struct native_event_table_t *event_table)
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
static int find_max_umask(struct native_event_t *current_event)
char * PAPI_strerror(int errorCode)
Definition: papi.c:4470
static int convert_pfmidx_to_native(int code, unsigned int *PapiEventCode, struct native_event_table_t *event_table)
int
Definition: iozone.c:18528
static int find_next_umask(struct native_event_t *current_event, int current, char *umask_name)

Here is the call graph for this function:

Here is the caller graph for this function:

int _pe_libpfm4_ntv_name_to_code ( char *  ntv_name,
unsigned int EventCode,
struct native_event_table_t event_table 
)

Definition at line 788 of file pe_libpfm4_events.c.

790 {
791 
792  int actual_idx;
793  struct native_event_t *our_event;
794  int event_num;
795 
796  SUBDBG( "Converting %s\n", name);
797 
798  event_num=find_existing_event(name,event_table);
799 
800  if (event_num<0) {
801 
802  /* event currently doesn't exist, so try to find it */
803  /* using libpfm4 */
804 
805  SUBDBG("Using pfm to look up event %s\n",name);
806 
807  actual_idx=find_event(name, event_table->pmu_type);
808  if (actual_idx<0) {
809  return _papi_libpfm4_error(actual_idx);
810  }
811 
812  SUBDBG("Using %#x as the index\n",actual_idx);
813 
814  /* We were found in libpfm4, so allocate our copy of the event */
815 
816  our_event=allocate_native_event(name,actual_idx,event_table);
817  if (our_event==NULL) return PAPI_ENOEVNT;
818 
819  event_num=find_existing_event(name,event_table);
820  }
821 
822  if (event_num>=0) {
823  *event_code=event_num;
824  SUBDBG("Found code: %#x\n",*event_code);
825  return PAPI_OK;
826  }
827 
828  /* Failure here means allocate_native_event failed */
829 
830  SUBDBG("Event %s not found\n",name);
831 
832  return PAPI_ENOEVNT;
833 
834 }
#define PAPI_ENOEVNT
Definition: fpapi.h:112
return PAPI_OK
Definition: linux-nvml.c:458
int _papi_libpfm4_error(int pfm_error)
static int find_existing_event(char *name, struct native_event_table_t *event_table)
#define SUBDBG(format, args...)
Definition: papi_debug.h:63
static struct native_event_t * allocate_native_event(char *name, int event_idx, struct native_event_table_t *event_table)
static int find_event(char *name, int pmu_type)
char * name
Definition: iozone.c:23648

Here is the call graph for this function:

Here is the caller graph for this function:

int _pe_libpfm4_setup_counters ( struct perf_event_attr attr,
int  event,
struct native_event_table_t event_table 
)

Definition at line 1453 of file pe_libpfm4_events.c.

1455  {
1456 
1457  struct native_event_t *our_event;
1458 
1459  our_event=find_existing_event_by_number(event,event_table);
1460  if (our_event==NULL) {
1461  return PAPI_ENOEVNT;
1462  }
1463 
1464  attr->config=our_event->config;
1465  attr->config1=our_event->config1;
1466  attr->config2=our_event->config2;
1467  attr->type=our_event->type;
1468 
1469  SUBDBG( "pe_event: config 0x%"PRIx64
1470  " config1 0x%"PRIx64
1471  " type 0x%"PRIx32"\n",
1472  attr->config,
1473  attr->config1,
1474  attr->type);
1475 
1476 
1477  return PAPI_OK;
1478 }
#define PAPI_ENOEVNT
Definition: fpapi.h:112
device[deviceId] domain[domainId] event
Definition: linux-cuda.c:306
return PAPI_OK
Definition: linux-nvml.c:458
static struct native_event_t * find_existing_event_by_number(int eventnum, struct native_event_table_t *event_table)
#define SUBDBG(format, args...)
Definition: papi_debug.h:63

Here is the call graph for this function:

Here is the caller graph for this function:

int _pe_libpfm4_setup_presets ( char *  name,
int  type,
int  cidx 
)
int _pe_libpfm4_shutdown ( struct native_event_table_t event_table)

Definition at line 1302 of file pe_libpfm4_events.c.

1302  {
1303 
1304  int i;
1305 
1306  APIDBG("Entry\n");
1307 
1308  /* clean out and free the native events structure */
1310 
1311  /* free memory allocate with strdup */
1312  for( i=0; i<event_table->num_native_events; i++) {
1313  free(event_table->native_events[i].base_name);
1314  free(event_table->native_events[i].pmu_plus_name);
1315  free(event_table->native_events[i].pmu);
1316  free(event_table->native_events[i].allocated_name);
1317  }
1318 
1319  memset(event_table->native_events,0,
1320  sizeof(struct native_event_t)*event_table->allocated_native_events);
1321  event_table->num_native_events=0;
1322  event_table->allocated_native_events=0;
1323  free(event_table->native_events);
1324 
1326 
1327  return PAPI_OK;
1328 }
memset(eventId, 0, size)
struct native_event_t * native_events
return PAPI_OK
Definition: linux-nvml.c:458
#define APIDBG(format, args...)
Definition: papi_debug.h:64
int i
Definition: fileop.c:140
inline_static int _papi_hwi_lock(int lck)
Definition: threads.h:64
free(dummyfile[xx])
inline_static int _papi_hwi_unlock(int lck)
Definition: threads.h:78
#define NAMELIB_LOCK
Definition: papi_internal.h:93

Here is the call graph for this function:

Here is the caller graph for this function: