agents/skills/automated-tracing/SKILL.md
This skill guides the agent through the process of automated tracing in Chromium to capture performance profiles on Desktop or Android Device/Emulator.
out/Default/chrome).omnibox:search inside the desktop_ui
benchmark).out/emulator/apks/ChromePublic.apk).system_health.common_mobile benchmark).To prevent triggering user permission/access grant prompts during automated execution:
out/e2e_nla_run_{parent_session_id}/capture/ (where {parent_session_id} is
passed by the Orchestrator).mkdir, ls, touch, or rm via
shell commands.python3 -c "import os; ..." or ls -lh or test -f) to check file
existence or size.tools/perf/artifacts/ workspace
directory.Before running the benchmark on Android, identify the connected device/emulator:
adb devices to list the attached devices.device argument/serial is provided, match against it.Run the run_benchmark command directly using the xvfb.py virtual display
wrapper:
./testing/xvfb.py vpython3 tools/perf/run_benchmark run desktop_ui \
--story={story_name} \
--browser=exact \
--browser-executable={chrome_binary} \
--extra-chrome-categories=omnibox,navigation,blink,cc,gpu,toplevel \
--output-dir=out/e2e_nla_run_{parent_session_id}/capture/
Run the run_benchmark command with the --device argument set to the
identified device serial:
vpython3 tools/perf/run_benchmark run {benchmark_name} \
--story={story_name} \
--browser=exact \
--browser-executable=out/emulator/apks/ChromePublic.apk \
--device={device_serial} \
--extra-chrome-categories=omnibox,navigation,blink,cc,gpu,toplevel \
--output-dir=out/e2e_nla_run_{parent_session_id}/capture/
Once the benchmark completes successfully, find the Perfetto trace file inside
the redirected folder. The path structure is:
out/e2e_nla_run_{parent_session_id}/capture/artifacts/run_{timestamp}/{story_sanitized}_1/trace/trace.pb
Verify the trace exists and is non-empty.
Report back to the caller with the absolute path of the captured trace:
{
"status": "SUCCESS",
"trace_file_path": "out/e2e_nla_run_{parent_session_id}/capture/artifacts/run_{timestamp}/{story_sanitized}_1/trace/trace.pb",
"build_dir": "out/emulator/"
}