Return trace file after successful trace completion
This PR changes the start_trace function to return the trace file after it has been successfully retrieved. This provides an option to customize the retrieved trace file, such as sharing or automatically uploading the trace file.
Test:
run the script: ./gen_amalgamated_python_tools to generate the record_android_trace
run ./tools/record_android_trace 10s sched with an Android device trace, all works as expected
Change-Id: I789f20704f199d480aac7ef00a3a04ea6a51d8e8
diff --git a/python/tools/record_android_trace.py b/python/tools/record_android_trace.py
index 1213296..2d4a189 100755
--- a/python/tools/record_android_trace.py
+++ b/python/tools/record_android_trace.py
@@ -409,6 +409,8 @@
open_browser = not args.no_open_browser
open_trace_in_browser(host_file, open_browser, args.origin)
+ return host_file
+
def main():
args = setup_arguments()
diff --git a/tools/record_android_trace b/tools/record_android_trace
index ce34db6..471fbe5 100755
--- a/tools/record_android_trace
+++ b/tools/record_android_trace
@@ -699,6 +699,8 @@
open_browser = not args.no_open_browser
open_trace_in_browser(host_file, open_browser, args.origin)
+ return host_file
+
def main():
args = setup_arguments()