code: def perfcounters(infile):
      
      measurements = []
      with open(infile, 'r') as in_file:
          read_struct(in_file)
          for region_struct in read_structs(in_file):
              region = region_struct["1"][1]
              core_info = region_struct["Region Info"]
              measurements += \
                  get_measurements(region, core_info, region_struct)
  
              for table_struct in read_tables(in_file):
                  core_info = None
                  if "Event" in table_struct:
                      offset = 1
                      core_info = table_struct["Event"][offset:]
                      measurements += get_measurements(region, core_info,
                                                       table_struct, offset)
                  elif "Metric" in table_struct:
                      core_info = table_struct["Metric"]
                      measurements += get_measurements(region, core_info,
                                                       table_struct)
      return measurements
docs: Get a complete list of all measurements.
  
      Args:
          infile: The filestream containing all likwid output.
  
      Returns:
          A list of all measurements extracted from likwid's file stream.