scripts/profile-symbolicate.py
def AddressesToSymbols(self, addresses_strs):
    """Converts multiple addresses into symbols."""
    if not self.located:
      self.Locate()
    if self.symbol_table:
      return self.LookupAddressesInSymbolTable(addresses_strs)
    if not self.host_name:
      unknown = "Unknown (in " + self.target_name + ")"
      return [unknown for i in range(len(addresses_strs))]
    if "TARGET_TOOLS_PREFIX" in os.environ:
      target_tools_prefix = os.environ["TARGET_TOOLS_PREFIX"]
    else:
      target_tools_prefix = "arm-eabi-"
    args = [target_tools_prefix + "addr2line", "-C", "-f", "-e", self.host_name]
    for address_str in addresses_strs:
      lib_address = int(address_str, 0) - self.start + self.offset
      if self.verbose:
        print "Address %s maps to library '%s' offset 0x%08x" % (address_str, self.host_name, lib_address)
      args.append("0x%08x" % lib_address)
    # Calling addr2line will return 2 lines for each address. The output will be something
    # like the following:
    #   PR_IntervalNow
    #   /home/work/B2G-profiler/mozilla-inbound/nsprpub/pr/src/misc/prinrval.c:43
    #   PR_Unlock
    #   /home/work/B2G-profiler/mozilla-inbound/nsprpub/pr/src/pthreads/ptsynch.c:191
    syms_and_lines = subprocess.check_output(args).split("\n")
    syms = []
    for i in range(len(addresses_strs)):
      syms.append(syms_and_lines[i*2] + " (in " + self.target_name + ")")
    return syms
Converts multiple addresses into symbols.
Converts multiple addresses into symbols.
Converts multiple addresses into symbols .
def AddressesToSymbols(self, addresses_strs):
    if not self.located:
      self.Locate()
    if self.symbol_table:
      return self.LookupAddressesInSymbolTable(addresses_strs)
    if not self.host_name:
      unknown = "Unknown (in " + self.target_name + ")"
      return [unknown for i in range(len(addresses_strs))]
    if "TARGET_TOOLS_PREFIX" in os.environ:
      target_tools_prefix = os.environ["TARGET_TOOLS_PREFIX"]
    else:
      target_tools_prefix = "arm-eabi-"
    args = [target_tools_prefix + "addr2line", "-C", "-f", "-e", self.host_name]
    for address_str in addresses_strs:
      lib_address = int(address_str, 0) - self.start + self.offset
      if self.verbose:
        print "Address %s maps to library '%s' offset 0x%08x" % (address_str, self.host_name, lib_address)
      args.append("0x%08x" % lib_address)
    syms_and_lines = subprocess.check_output(args).split("\n")
    syms = []
    for i in range(len(addresses_strs)):
      syms.append(syms_and_lines[i*2] + " (in " + self.target_name + ")")
    return syms
def AddressesToSymbols ( self , addresses_strs ) : if not self . located : self . Locate ( ) if self . symbol_table : return self . LookupAddressesInSymbolTable ( addresses_strs ) if not self . host_name : unknown = "Unknown (in " + self . target_name + ")" return [ unknown for i in range ( len ( addresses_strs ) ) ] if "TARGET_TOOLS_PREFIX" in os . environ : target_tools_prefix = os . environ [ "TARGET_TOOLS_PREFIX" ] else : target_tools_prefix = "arm-eabi-" args = [ target_tools_prefix + "addr2line" , "-C" , "-f" , "-e" , self . host_name ] for address_str in addresses_strs : lib_address = int ( address_str , 0 ) - self . start + self . offset if self . verbose : print "Address %s maps to library '%s' offset 0x%08x" % ( address_str , self . host_name , lib_address ) args . append ( "0x%08x" % lib_address ) syms_and_lines = subprocess . check_output ( args ) . split ( "\n" ) syms = [ ] for i in range ( len ( addresses_strs ) ) : syms . append ( syms_and_lines [ i * 2 ] + " (in " + self . target_name + ")" ) return syms
Converts multiple addresses into symbols.
Converts multiple addresses into symbols .
"""Converts multiple addresses into symbols.""" # Calling addr2line will return 2 lines for each address. The output will be something # like the following: #   PR_IntervalNow #   /home/work/B2G-profiler/mozilla-inbound/nsprpub/pr/src/misc/prinrval.c:43 #   PR_Unlock #   /home/work/B2G-profiler/mozilla-inbound/nsprpub/pr/src/pthreads/ptsynch.c:191
self
addresses_strs