Skip to content

feat: add Android native perf profiling#757

Open
thymikee wants to merge 2 commits into
mainfrom
fix/android-native-perf
Open

feat: add Android native perf profiling#757
thymikee wants to merge 2 commits into
mainfrom
fix/android-native-perf

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Adds Android native profiling collectors under the consolidated perf family for #694.

  • Adds perf cpu profile start|stop|report --kind simpleperf and perf trace start|stop --kind perfetto across command contracts, CLI grammar, daemon routing/projection, typed client metadata, MCP-facing input, and compact output.
  • Adds Android collector seams for package/PID resolution, bounded adb simpleperf/perfetto execution, artifact pulling, Simpleperf JSON reports, and actionable unavailable/permission hints.
  • Keeps output agent-friendly: artifact paths and compact summaries only, no raw trace/profile dumps.

Refs #696
Refs #694

Touched files: 24.

Validation

Worker validation passed:

  • Focused perf/CLI/client/daemon tests.
  • pnpm check:quick.
  • pnpm build.
  • pnpm check:unit outside sandbox: 247 unit files, 2332 unit tests, 8 smoke tests.
  • pnpm format.
  • git diff --check.

Android emulator E2E:

  • Emulator: emulator-5554, Pixel 9 Pro XL API 37.
  • App/package: com.justforfun.neoncity.
  • Session: perf-e2e-696.
  • Baseline perf metrics and perf frames succeeded with compact JSON.
  • Perfetto start/stop succeeded and pulled /private/tmp/agent-device-696-app.perfetto-trace at 5,392,410 bytes.
  • Simpleperf reached the device binary but the emulator denied perf_event_open; the command returned the intended actionable hint to use a debuggable/profileable app or system image that permits profiling.

SkillGym case was added but not runnable in the sandbox because external runner approval was denied.

This PR is Android-only. iOS native profiling remains separate.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstack.github.io/agent-device/pr-preview/pr-757/

Built to branch gh-pages at 2026-06-11 07:10 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.2 MB 1.2 MB +13.7 kB
JS gzip 390.2 kB 394.6 kB +4.4 kB
npm tarball 501.5 kB 505.9 kB +4.4 kB
npm unpacked 1.7 MB 1.7 MB +14.2 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.2 ms 26.4 ms +0.2 ms
CLI --help 42.0 ms 42.0 ms +0.1 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/session.js +10.6 kB +3.5 kB
dist/src/8173.js +700 B +230 B
dist/src/8699.js +842 B +196 B
dist/src/1352.js +501 B +119 B
dist/src/args.js +344 B +117 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant