Initial Beta build
All checks were successful
Validate and publish Kaleido / android (push) Successful in 2m27s

This commit is contained in:
Elijah 2026-10-24 09:09:55 -07:00
commit 2b585badac
65 changed files with 3535 additions and 0 deletions

23
scripts/profile_browse.py Normal file
View file

@ -0,0 +1,23 @@
"""Capture app atrace sections around actual remote navigation."""
import re,time,collections
from device import adb,OUT
from verify_ui import launch,key
launch();key(20);time.sleep(2)
pid=adb('shell','pidof','tv.kaleido.app').decode().strip()
adb('shell','atrace','--async_start','-b','16384','-a','tv.kaleido.app','gfx','view','sched')
adb('shell','input','keyevent',*(['KEYCODE_DPAD_RIGHT']*15))
adb('shell','input','keyevent',*(['KEYCODE_DPAD_DOWN']*3))
adb('shell','input','keyevent',*(['KEYCODE_DPAD_UP']*6))
raw=adb('shell','atrace','--async_stop','-a','tv.kaleido.app','gfx','view','sched').decode(errors='replace')
(OUT/'browse-atrace.txt').write_text(raw)
stacks=collections.defaultdict(list);spans=[]
for line in raw.splitlines():
match=re.search(r'-(\d+)\s+.*?\s(\d+\.\d+): tracing_mark_write: ([BE])(?:\|(.*))?',line)
if not match:continue
tid,stamp,kind,payload=match.groups();stamp=float(stamp)
if kind=='B':
owner,_,name=(payload or '').partition('|');stacks[tid].append((stamp,name,owner))
elif stacks[tid]:
start,name,owner=stacks[tid].pop()
if owner==pid:spans.append(((stamp-start)*1000,name,tid))
for duration,name,tid in sorted(spans,reverse=True)[:35]:print(f'{duration:8.2f}ms tid={tid} {name}')