Use python3 for profiling scripts.
Test: tools/java_heap_dump -n system_server
Test: tools/heap_profile -n system_server
Change-Id: Ibbe1c6816368fce6aba4721005790547de803ee0
diff --git a/tools/java_heap_dump b/tools/java_heap_dump
index ced597e..03abb01 100755
--- a/tools/java_heap_dump
+++ b/tools/java_heap_dump
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright (C) 2020 The Android Open Source Project
#
@@ -168,10 +168,11 @@
print(cfg)
return 0
- user = subprocess.check_output(['adb', 'shell', 'whoami']).strip()
+ user = subprocess.check_output(
+ ['adb', 'shell', 'whoami']).strip().decode('utf8')
perfetto_pid = subprocess.check_output(
['adb', 'exec-out',
- PERFETTO_CMD.format(cfg=cfg, user=user)]).strip()
+ PERFETTO_CMD.format(cfg=cfg, user=user)]).strip().decode('utf8')
try:
int(perfetto_pid.strip())
except ValueError: