PAPI  5.3.2.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 1342 of file pe_libpfm4_events.c.

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

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

1108 {
1109 
1110 
1111  struct native_event_t *our_event;
1112 
1113  SUBDBG("ENTER %#x\n",EventCode);
1114 
1115  our_event=find_existing_event_by_number(EventCode,event_table);
1116  if (our_event==NULL) {
1117  return PAPI_ENOEVNT;
1118  }
1119 
1120  strncpy(info->symbol, our_event->allocated_name, sizeof(info->symbol));
1121 
1122  if (strlen(our_event->allocated_name) > sizeof(info->symbol)) {
1123  return PAPI_EBUF;
1124  }
1125 
1126  _pe_libpfm4_ntv_code_to_descr(EventCode,info->long_descr,
1127  sizeof(info->long_descr),event_table);
1128 
1129  return PAPI_OK;
1130 }
#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 854 of file pe_libpfm4_events.c.

857 {
858 
859  struct native_event_t *our_event;
860 
861  SUBDBG("ENTER %#x\n",EventCode);
862 
863  our_event=find_existing_event_by_number(EventCode,event_table);
864  if (our_event==NULL) {
865  return PAPI_ENOEVNT;
866  }
867 
868  strncpy(ntv_name,our_event->allocated_name,len);
869 
870  if (strlen(our_event->allocated_name) > (unsigned)len) {
871  return PAPI_EBUF;
872  }
873 
874  return PAPI_OK;
875 }
#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 1151 of file pe_libpfm4_events.c.

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

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

1454  {
1455 
1456  struct native_event_t *our_event;
1457 
1458  our_event=find_existing_event_by_number(event,event_table);
1459  if (our_event==NULL) {
1460  return PAPI_ENOEVNT;
1461  }
1462 
1463  attr->config=our_event->config;
1464  attr->config1=our_event->config1;
1465  attr->config2=our_event->config2;
1466  attr->type=our_event->type;
1467 
1468  SUBDBG( "pe_event: config %#lx config1 %#lx type %#x\n",
1469  attr->config,
1470  attr->config1,
1471  attr->type);
1472 
1473 
1474  return PAPI_OK;
1475 }
#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 1301 of file pe_libpfm4_events.c.

1301  {
1302 
1303  int i;
1304 
1305  APIDBG("Entry\n");
1306 
1307  /* clean out and free the native events structure */
1309 
1310  /* free memory allocate with strdup */
1311  for( i=0; i<event_table->num_native_events; i++) {
1312  free(event_table->native_events[i].base_name);
1313  free(event_table->native_events[i].pmu_plus_name);
1314  free(event_table->native_events[i].pmu);
1315  free(event_table->native_events[i].allocated_name);
1316  }
1317 
1318  memset(event_table->native_events,0,
1319  sizeof(struct native_event_t)*event_table->allocated_native_events);
1320  event_table->num_native_events=0;
1321  event_table->allocated_native_events=0;
1322  free(event_table->native_events);
1323 
1325 
1326  return PAPI_OK;
1327 }
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: