コード例 #1
0
ファイル: upload_binaries.py プロジェクト: nellyv/mojo
def upload_symbols(config, build_dir, breakpad_upload_urls, dry_run):
    dump_syms_exe = os.path.join(Paths().src_root, "mojo", "tools", "linux64",
                                 "dump_syms")
    symupload_exe = os.path.join(Paths().src_root, "mojo", "tools", "linux64",
                                 "symupload")
    dest_dir = "gs://mojo/symbols/"
    symbols_dir = os.path.join(build_dir, "symbols")
    with open(os.devnull, "w") as devnull:
        for name in os.listdir(symbols_dir):
            path = os.path.join(symbols_dir, name)
            with open(path) as f:
                signature = signatures.get_signature(f, elffile)
                if signature is not None:
                    dest = dest_dir + signature
                    upload(config, path, dest, dry_run)
            if breakpad_upload_urls:
                with tempfile.NamedTemporaryFile() as temp:
                    check_call([dump_syms_exe, path],
                               dry_run,
                               stdout=temp,
                               stderr=devnull)
                    temp.flush()
                    for upload_url in breakpad_upload_urls:
                        check_call([symupload_exe, temp.name, upload_url],
                                   dry_run)
コード例 #2
0
ファイル: upload_binaries.py プロジェクト: nadava/mojo
def upload_symbols(config, build_dir, dry_run):
    dest_dir = "gs://mojo/symbols/"
    symbols_dir = os.path.join(build_dir, "symbols")
    for name in os.listdir(symbols_dir):
        path = os.path.join(symbols_dir, name)
        with open(path) as f:
            signature = signatures.get_signature(f, elffile)
            if signature is not None:
                dest = dest_dir + signature
                upload(config, path, dest, dry_run)
コード例 #3
0
ファイル: session.py プロジェクト: hackerkevin/sky_engine
 def _find_libraries(self, lib_dir):
     """Finds all libraries in |lib_dir| and key them by their signatures.
 """
     res = {}
     for fn in glob.glob("%s/*.so" % lib_dir):
         with open(fn, "r") as f:
             s = get_signature(f, self._elffile_module)
             if s is not None:
                 res[s] = fn
     return res
コード例 #4
0
def upload_symbols(config, build_dir, dry_run):
    dest_dir = "gs://mojo/symbols/"
    symbols_dir = os.path.join(build_dir, "symbols")
    for name in os.listdir(symbols_dir):
        path = os.path.join(symbols_dir, name)
        with open(path) as f:
            signature = signatures.get_signature(f, elffile)
            if signature is not None:
                dest = dest_dir + signature
                upload(config, path, dest, dry_run)
コード例 #5
0
ファイル: session.py プロジェクト: jianglu/mojo
 def _find_libraries(self, lib_dir):
     """Finds all libraries in |lib_dir| and key them by their signatures.
 """
     res = {}
     for fn in glob.glob('%s/*.so' % lib_dir):
         with open(fn, 'r') as f:
             s = get_signature(f, self._elffile_module)
             if s is not None:
                 res[s] = fn
     return res
コード例 #6
0
ファイル: upload_binaries.py プロジェクト: krisgiesing/mojo
def upload_symbols(config, build_dir, breakpad_upload_urls, dry_run):
    dump_syms_exe = os.path.join(Paths().src_root, "mojo", "tools", "linux64", "dump_syms")
    symupload_exe = os.path.join(Paths().src_root, "mojo", "tools", "linux64", "symupload")
    dest_dir = config.values["upload_location"] + "symbols/"
    symbols_dir = os.path.join(build_dir, "symbols")
    with open(os.devnull, "w") as devnull:
        for name in os.listdir(symbols_dir):
            path = os.path.join(symbols_dir, name)
            with open(path) as f:
                signature = signatures.get_signature(f, elffile)
                if signature is not None:
                    dest = dest_dir + signature
                    upload(config, path, dest, dry_run)
            if breakpad_upload_urls:
                with tempfile.NamedTemporaryFile() as temp:
                    check_call([dump_syms_exe, path], dry_run, stdout=temp, stderr=devnull)
                    temp.flush()
                    for upload_url in breakpad_upload_urls:
                        check_call([symupload_exe, temp.name, upload_url], dry_run)
コード例 #7
0
ファイル: session.py プロジェクト: hackerkevin/sky_engine
 def _try_to_map(self, mapping):
     remote_file = mapping[0].filename
     if remote_file in self._done_mapping:
         return False
     self._done_mapping.add(remote_file)
     self._rfc.open(remote_file)
     signature = get_signature(self._rfc, self._elffile_module)
     if signature is not None:
         if signature in self._libraries:
             self._associate_symbols(mapping, self._libraries[signature])
         else:
             # This library file is not known locally. Download it from the device or
             # the cloud and put it in cache so, if it got symbols, we can see them.
             local_file = os.path.join(self._remote_file_cache, signature)
             if not os.path.exists(local_file):
                 tmp_output = self._download_file(signature, remote_file)
                 shutil.move(tmp_output, local_file)
             self._associate_symbols(mapping, local_file)
         return True
     return False
コード例 #8
0
ファイル: session.py プロジェクト: jianglu/mojo
 def _try_to_map(self, mapping):
     remote_file = mapping[0].filename
     if remote_file in self._done_mapping:
         return False
     self._done_mapping.add(remote_file)
     self._rfc.open(remote_file)
     signature = get_signature(self._rfc, self._elffile_module)
     if signature is not None:
         if signature in self._libraries:
             self._associate_symbols(mapping, self._libraries[signature])
         else:
             # This library file is not known locally. Download it from the device or
             # the cloud and put it in cache so, if it got symbols, we can see them.
             local_file = os.path.join(self._remote_file_cache, signature)
             if not os.path.exists(local_file):
                 tmp_output = self._download_file(signature, remote_file)
                 shutil.move(tmp_output, local_file)
             self._associate_symbols(mapping, local_file)
         return True
     return False