Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: tools/upload_service.py

Issue 1230973004: Upload symbols when uploading artifacts. (Closed) Base URL: https://github.com/domokit/monet.git@add_tracing
Patch Set: Use devtools for signature Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/network/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/upload_service.py
diff --git a/tools/upload_service.py b/tools/upload_service.py
index 84aa0d27bd92e433cb3b9e119b27c4cf4381369b..91ab49bb1d453e3655a424c99a669a17ee2b9d5e 100755
--- a/tools/upload_service.py
+++ b/tools/upload_service.py
@@ -4,7 +4,9 @@
# found in the LICENSE file.
import argparse
+import glob
import imp
+import itertools
import os
import subprocess
import sys
@@ -12,6 +14,14 @@ import tempfile
import time
import zipfile
+sys.path.append(os.path.join(os.path.dirname(__file__),
+ os.pardir, 'third_party', 'pyelftools'))
+import elftools.elf.elffile as elffile
+
+sys.path.append(os.path.join(os.path.dirname(__file__),
+ os.pardir, 'third_party', 'mojo_devtools'))
+import android_gdb.signatures as signatures
+
SERVICES = ["network_service", "network_service_apptests"]
# A service does not need to expose interfaces. Those that do expose interfaces
@@ -86,6 +96,17 @@ def upload_mojoms(version_name, service, absolute_mojom_directory_path,
gsutil_cp(mojom_zip_file.name, dest, dry_run)
+def upload_symbols(binary_dir, dry_run):
+ dest_dir = "gs://mojo/symbols/"
+ symbols_dir = os.path.join(binary_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
+ gsutil_cp(path, dest, dry_run)
+
def upload_binary(version_name, service, binary_dir, platform, dry_run):
dest_dir = "gs://mojo/" + service + "/" + version_name + "/" + platform + "/"
should_zip = service in SERVICES_WITH_ZIPPED_BINARIES
@@ -140,6 +161,9 @@ def main():
help="Indicates that this is a build with change that is not committed. "
"The change must be uploaded to Rietveld. The script needs to be "
"run from the branch associated with the change.")
+ parser.add_argument(
+ "--upload-symbols", action="store_true",
+ help="Indicates that this should also upload all symbols.")
args = parser.parse_args()
if args.service not in SERVICES:
@@ -164,10 +188,14 @@ def main():
if args.linux_x64_binary_dir:
upload_binary(version_name, args.service, args.linux_x64_binary_dir,
"linux-x64", args.dry_run)
+ if args.upload_symbols:
+ upload_symbols(args.linux_x64_binary_dir, args.dry_run)
if args.android_arm_binary_dir:
upload_binary(version_name, args.service, args.android_arm_binary_dir,
"android-arm", args.dry_run)
+ if args.upload_symbols:
+ upload_symbols(args.android_arm_binary_dir, args.dry_run)
if not args.dry_run:
print "Uploaded artifacts for version %s" % (version_name, )
« no previous file with comments | « mojo/services/network/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698