mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-03 14:09:33 +03:00
Ensure settings get cleaned up on exceptions
Before this change, Ctrl-C or another exception leaves settings behind Bug: b/284462263 Change-Id: I5694cbb2ca7d43a4173099d126e6695e07ec9d2a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685238 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
This commit is contained in:
committed by
Angle LUCI CQ
parent
d6dc46dbd9
commit
c5b7fc3655
@@ -620,6 +620,20 @@ def main():
|
||||
|
||||
logging.basicConfig(level=args.log.upper())
|
||||
|
||||
run_adb_command('root')
|
||||
|
||||
try:
|
||||
run_traces(args)
|
||||
finally:
|
||||
# Clean up settings, including in case of exceptions (including Ctrl-C)
|
||||
run_adb_command('shell settings delete global angle_debug_package')
|
||||
run_adb_command('shell settings delete global angle_gl_driver_selection_pkgs')
|
||||
run_adb_command('shell settings delete global angle_gl_driver_selection_values')
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def run_traces(args):
|
||||
# Load trace names
|
||||
with open(os.path.join(DEFAULT_TEST_DIR, DEFAULT_TEST_JSON)) as f:
|
||||
traces = json.loads(f.read())
|
||||
@@ -682,8 +696,6 @@ def main():
|
||||
column_width['gpu_mem_peak'], 'gpu_mem_peak', column_width['proc_mem_median'],
|
||||
'proc_mem_median', column_width['proc_mem_peak'], 'proc_mem_peak'))
|
||||
|
||||
run_adb_command('root')
|
||||
|
||||
if args.power:
|
||||
starting_power = GPUPowerStats()
|
||||
ending_power = GPUPowerStats()
|
||||
@@ -1001,13 +1013,6 @@ def main():
|
||||
percent(safe_divide(data["native"][16], data["vulkan"][16]))
|
||||
])
|
||||
|
||||
# Clean up settings
|
||||
run_adb_command('shell settings delete global angle_debug_package')
|
||||
run_adb_command('shell settings delete global angle_gl_driver_selection_pkgs')
|
||||
run_adb_command('shell settings delete global angle_gl_driver_selection_values')
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
||||
Reference in New Issue
Block a user