Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class AgentprofEmbedder implements Embedder {
'dev.perfetto.CoreCommands',
'dev.perfetto.MultiTraceOpen',
'dev.perfetto.Timeline',
'dev.perfetto.FlowEventsPanel',
'dev.perfetto.FlowEvents',
'dev.perfetto.TraceInfoPage',
'dev.perfetto.SettingsPage',
'dev.agentprof.Agentprof',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.ap-label {font-size: var(--pf-font-size-s); text-transform: uppercase; letter-spacing: .5px; color: var(--pf-color-text-muted);}
.ap-tabs {height: auto;}
// Keep the divider inside the scroll area so the active tab can cover it.
.ap-tabs > .pf-tabs__tabs {
.ap-tabs > .pf-tab-strip {
padding: 0 28px 1px;
overflow-x: auto;
border-bottom: none;
Expand Down Expand Up @@ -201,7 +201,7 @@
.ap-session-table > tbody > .ap-session-row {grid-template-columns: minmax(0, 1fr);}
.ap-session-details > .ap-session-fact:first-child {grid-column: 1 / -1;}
}
@media (max-width: 800px) {.ap-inner {width: 100%;} .ap-header, .ap-content {padding: 16px;} .ap-tabs > .pf-tabs__tabs {padding-inline: 10px;} .ap-headline-row {grid-template-columns: 1fr;}}
@media (max-width: 800px) {.ap-inner {width: 100%;} .ap-header, .ap-content {padding: 16px;} .ap-tabs > .pf-tab-strip {padding-inline: 10px;} .ap-headline-row {grid-template-columns: 1fr;}}
}

.ap-context {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Agentprof <agentprof@localhost>
Date: Fri, 25 Sep 2026 13:11:17 -0400
Subject: [PATCH 1/6] ui: enable agent profiling and isolate UI types
Subject: [PATCH 1/8] ui: enable agent profiling and isolate UI types

---
ui/src/core/embedder/default_plugins.ts | 1 +
ui/tsconfig.json | 1 +
2 files changed, 2 insertions(+)

diff --git a/ui/src/core/embedder/default_plugins.ts b/ui/src/core/embedder/default_plugins.ts
index 0008eac4..25faa1de 100644
index 4370fd8137..394b6085ba 100644
--- a/ui/src/core/embedder/default_plugins.ts
+++ b/ui/src/core/embedder/default_plugins.ts
@@ -21,6 +21,7 @@
Expand All @@ -21,7 +21,7 @@ index 0008eac4..25faa1de 100644
'com.android.AndroidClientServer',
'com.android.AndroidCujs',
diff --git a/ui/tsconfig.json b/ui/tsconfig.json
index 710e259b..5b29b1df 100644
index 710e259b61..5b29b1df57 100644
--- a/ui/tsconfig.json
+++ b/ui/tsconfig.json
@@ -10,6 +10,7 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Agentprof <agentprof@localhost>
Date: Fri, 25 Sep 2026 16:00:10 -0400
Subject: [PATCH 2/6] ui: resolve linked agent plugin imports from the checkout
Subject: [PATCH 2/8] ui: resolve linked agent plugin imports from the checkout

---
ui/vite.config.mjs | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/ui/vite.config.mjs b/ui/vite.config.mjs
index 88698c98..f6f9258c 100644
index a95587e807..8a2029822d 100644
--- a/ui/vite.config.mjs
+++ b/ui/vite.config.mjs
@@ -255,6 +255,27 @@ const BUNDLE_CONFIGS = {
@@ -457,6 +457,27 @@ const BUNDLE_CONFIGS = {
// frontend index.html drives the module graph.
const BUNDLE = process.env.BUNDLE;

Expand Down Expand Up @@ -39,7 +39,7 @@ index 88698c98..f6f9258c 100644
export default defineConfig(({command}) => {
const isBuild = command === 'build';
if (isBuild && !BUNDLE) {
@@ -281,6 +302,7 @@ export default defineConfig(({command}) => {
@@ -483,6 +504,7 @@ export default defineConfig(({command}) => {
// magic "publicDir" handling so it doesn't try to serve it at /.
publicDir: false,
plugins: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Agentprof <agentprof@localhost>
Date: Sat, 26 Sep 2026 03:19:57 -0400
Subject: [PATCH 3/6] ui: distinguish trace details from agent overview
Subject: [PATCH 3/8] ui: distinguish trace details from agent overview

---
ui/src/plugins/dev.perfetto.TraceInfoPage/index.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/src/plugins/dev.perfetto.TraceInfoPage/index.ts b/ui/src/plugins/dev.perfetto.TraceInfoPage/index.ts
index df1b70ec..f57a3ddd 100644
index df1b70ecaf..f57a3ddd8b 100644
--- a/ui/src/plugins/dev.perfetto.TraceInfoPage/index.ts
+++ b/ui/src/plugins/dev.perfetto.TraceInfoPage/index.ts
@@ -29,7 +29,7 @@ export default class implements PerfettoPlugin {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Agentprof <agentprof@localhost>
Date: Sat, 26 Sep 2026 03:49:58 -0400
Subject: [PATCH 4/6] ui: support Agentprof embedder branding and focused
Subject: [PATCH 4/8] ui: support Agentprof embedder branding and focused
defaults

---
Expand All @@ -14,7 +14,7 @@ Subject: [PATCH 4/6] ui: support Agentprof embedder branding and focused
6 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/ui/src/core/embedder/create_embedder.ts b/ui/src/core/embedder/create_embedder.ts
index a30050be..25a88c04 100644
index a30050be97..25a88c046f 100644
--- a/ui/src/core/embedder/create_embedder.ts
+++ b/ui/src/core/embedder/create_embedder.ts
@@ -13,22 +13,9 @@
Expand Down Expand Up @@ -44,7 +44,7 @@ index a30050be..25a88c04 100644
+ return new AgentprofEmbedder();
}
diff --git a/ui/src/core/embedder/embedder.ts b/ui/src/core/embedder/embedder.ts
index bdde74c3..f485a616 100644
index bdde74c313..f485a61693 100644
--- a/ui/src/core/embedder/embedder.ts
+++ b/ui/src/core/embedder/embedder.ts
@@ -12,6 +12,9 @@
Expand All @@ -69,7 +69,7 @@ index bdde74c3..f485a616 100644
// should not be enabled for this embedder.
readonly analyticsId: string | undefined;
diff --git a/ui/src/frontend/index.ts b/ui/src/frontend/index.ts
index e6fb1105..97505605 100644
index e6fb11051d..97505605de 100644
--- a/ui/src/frontend/index.ts
+++ b/ui/src/frontend/index.ts
@@ -361,7 +361,8 @@ function onCssLoaded(app: AppImpl) {
Expand All @@ -83,7 +83,7 @@ index e6fb1105..97505605 100644
router.onRouteChanged = routeChange;

diff --git a/ui/src/frontend/ui_main.ts b/ui/src/frontend/ui_main.ts
index 7ad231f4..cdc4e2d4 100644
index 7ad231f40d..cdc4e2d43d 100644
--- a/ui/src/frontend/ui_main.ts
+++ b/ui/src/frontend/ui_main.ts
@@ -42,12 +42,13 @@ export class UiMain implements m.ClassComponent {
Expand All @@ -103,7 +103,7 @@ index 7ad231f4..cdc4e2d4 100644
}

diff --git a/ui/src/frontend/views/sidebar.ts b/ui/src/frontend/views/sidebar.ts
index e6a7ba5f..dc91320e 100644
index e6a7ba5fcd..dc91320ef0 100644
--- a/ui/src/frontend/views/sidebar.ts
+++ b/ui/src/frontend/views/sidebar.ts
@@ -82,7 +82,10 @@ export class Sidebar implements m.ClassComponent<SidebarAttrs> {
Expand All @@ -119,10 +119,10 @@ index e6a7ba5f..dc91320e 100644
m(
'span.pf-sidebar__branding-badge',
diff --git a/ui/vite.config.mjs b/ui/vite.config.mjs
index f6f9258c..28175108 100644
index 8a2029822d..eac6751add 100644
--- a/ui/vite.config.mjs
+++ b/ui/vite.config.mjs
@@ -258,12 +258,14 @@ const BUNDLE = process.env.BUNDLE;
@@ -460,12 +460,14 @@ const BUNDLE = process.env.BUNDLE;
// Resolve imports in Agentprof's linked source files from their checkout paths.
// Preserve pnpm's normal realpath behavior for third-party dependencies.
function pluginAgentprofOverlays() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Agentprof <agentprof@localhost>
Date: Sun, 27 Sep 2026 15:30:42 -0400
Subject: [PATCH 5/6] Add embedder hooks for responsive top-bar navigation
Subject: [PATCH 5/8] Add embedder hooks for responsive top-bar navigation

---
ui/src/core/app_impl.ts | 4 ++--
Expand All @@ -11,7 +11,7 @@ Subject: [PATCH 5/6] Add embedder hooks for responsive top-bar navigation
4 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/ui/src/core/app_impl.ts b/ui/src/core/app_impl.ts
index 0bbb751e..eadc946e 100644
index 715733dea6..8a8b088b75 100644
--- a/ui/src/core/app_impl.ts
+++ b/ui/src/core/app_impl.ts
@@ -154,11 +154,11 @@ export class AppImpl implements App {
Expand All @@ -29,7 +29,7 @@ index 0bbb751e..eadc946e 100644
this.analytics = initAnalytics(
this.testingMode,
diff --git a/ui/src/core/embedder/embedder.ts b/ui/src/core/embedder/embedder.ts
index f485a616..8deef447 100644
index f485a61693..8deef44734 100644
--- a/ui/src/core/embedder/embedder.ts
+++ b/ui/src/core/embedder/embedder.ts
@@ -54,6 +54,12 @@ export interface Embedder {
Expand All @@ -46,7 +46,7 @@ index f485a616..8deef447 100644
// Returns the Google Analytics measurement ID, or undefined if analytics
// should not be enabled for this embedder.
diff --git a/ui/src/frontend/topbar.scss b/ui/src/frontend/topbar.scss
index 1cf62a32..b848b8f8 100644
index 1cf62a3251..b848b8f83a 100644
--- a/ui/src/frontend/topbar.scss
+++ b/ui/src/frontend/topbar.scss
@@ -26,6 +26,42 @@
Expand Down Expand Up @@ -93,7 +93,7 @@ index 1cf62a32..b848b8f8 100644
.pf-omnibox--query-mode {
padding-left: 48px;
diff --git a/ui/src/frontend/topbar.ts b/ui/src/frontend/topbar.ts
index 88e090c0..a324bd93 100644
index 88e090c0f9..a324bd9393 100644
--- a/ui/src/frontend/topbar.ts
+++ b/ui/src/frontend/topbar.ts
@@ -104,16 +104,20 @@ export class Topbar implements m.ClassComponent<TopbarAttrs> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Agentprof <agentprof@localhost>
Date: Sun, 27 Sep 2026 15:49:11 -0400
Subject: [PATCH 6/6] Center embedder search between equal navigation regions
Subject: [PATCH 6/8] Center embedder search between equal navigation regions

---
ui/src/frontend/topbar.scss | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/ui/src/frontend/topbar.scss b/ui/src/frontend/topbar.scss
index b848b8f8..256973d7 100644
index b848b8f83a..256973d771 100644
--- a/ui/src/frontend/topbar.scss
+++ b/ui/src/frontend/topbar.scss
@@ -28,8 +28,11 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Agentprof <agentprof@localhost>
Date: Wed, 14 Oct 2026 12:41:55 -0700
Subject: [PATCH 7/7] ai: Route AgentProf performance investigations
Subject: [PATCH 7/8] ai: Route AgentProf performance investigations

Add domain routes for agent recordings without changing the shared skill bootstrap.

Tests: AgentProf workflow packaging and deterministic trace-query checks.
---
ai/skills/perfetto/SKILL-template.md | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
ai/skills/perfetto/SKILL-template.md | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/ai/skills/perfetto/SKILL-template.md b/ai/skills/perfetto/SKILL-template.md
index 02915e38..395650a0 100644
index 2f19001b62..4f79f25594 100644
--- a/ai/skills/perfetto/SKILL-template.md
+++ b/ai/skills/perfetto/SKILL-template.md
@@ -5,7 +5,9 @@ description: >-
analyzing them. Analysis covers loading a trace, running PerfettoSQL queries,
inspecting available tables/columns/stdlib, and guided investigations such as
Android Java heap dumps (leaks, retention, clustering many dumps, caching to
- cut memory). Routes to the right workflow and reference files.
+ cut memory), and AgentProf agent/harness/model performance (slow turns,
+ model latency, tools/delegation, context pressure, run comparisons and runtime
+ resources). Routes to the right workflow and reference files.
@@ -7,7 +7,9 @@ description: >-
Use for any trace file (.pftrace, .perfetto-trace, .pb, systrace, ftrace,
Chrome JSON) from Android, Linux, Chrome or CUDA/GPU workloads, whether or
not the user says "Perfetto". Bundles trace_processor (PerfettoSQL) plus
- guided workflows for Android memory and GPU analysis.
+ guided workflows for Android memory, GPU analysis, and AgentProf
+ agent/harness/model performance (slow turns, model latency, tools/delegation,
+ context pressure, run comparisons and runtime resources).
---

# Perfetto
@@ -87,6 +89,17 @@ Workflows above are self-contained (they carry their own queries); read
> - When asked how to cluster multiple heap dumps or reduce noise across dumps, explain the clustering workflow (preprocessing paths, TF-IDF, K-Means clustering) and recommend running `scripts/cluster_paths.py` directly in your response.
> - When asked for next steps after running clustering or generating `clustered_output.csv`, respond directly recommending running `scripts/summarize_clusters.py clustered_output.csv report.html`. Do NOT attempt shell execution of Python scripts yourself.
@@ -53,7 +55,15 @@ internal, OEM or CI images), use that instead.
- Which GPUs are in the trace: [gpu_info.md]($SKILL_ROOT/workflows/gpu/gpu_info.md)
- Busy vs idle timeline, idle-gap attribution: [timeline_occupancy.md]($SKILL_ROOT/workflows/gpu/timeline_occupancy.md)

+## Agent profiling
-4. **Everything else** (startup, jank, ANRs, CPU, scheduling, counters,
+4. **Agent profiling** (AgentProf recordings from Pi, Claude Code, Codex or Muse)
+ - Slow run or unfamiliar recording: [Investigate a run]($SKILL_ROOT/workflows/agentprof/investigate_agent_run.md).
+ - Response latency and token throughput: [Model performance]($SKILL_ROOT/workflows/agentprof/analyze_model_performance.md).
+ - Slow tools, scripts or child agents: [Tools and delegation]($SKILL_ROOT/workflows/agentprof/analyze_tools_and_delegation.md).
+ - Context growth or compaction: [Context pressure]($SKILL_ROOT/workflows/agentprof/analyze_context_pressure.md).
+ - Before/after or harness/model comparisons: [Compare runs]($SKILL_ROOT/workflows/agentprof/compare_agent_runs.md).
+ - Recorded process CPU/RSS/heap: [Runtime resources]($SKILL_ROOT/workflows/agentprof/correlate_runtime_resources.md).
+
+For AgentProf recordings from Pi, Claude Code, Codex or Muse:
+
+* **Slow run or unfamiliar recording:** [Investigate a run]($SKILL_ROOT/workflows/agentprof/investigate_agent_run.md).
+* **Response latency and token throughput:** [Model performance]($SKILL_ROOT/workflows/agentprof/analyze_model_performance.md).
+* **Slow tools, scripts or child agents:** [Tools and delegation]($SKILL_ROOT/workflows/agentprof/analyze_tools_and_delegation.md).
+* **Context growth or compaction:** [Context pressure]($SKILL_ROOT/workflows/agentprof/analyze_context_pressure.md).
+* **Before/after or harness/model comparisons:** [Compare runs]($SKILL_ROOT/workflows/agentprof/compare_agent_runs.md).
+* **Recorded process CPU/RSS/heap:** [Runtime resources]($SKILL_ROOT/workflows/agentprof/correlate_runtime_resources.md).
+
## Finishing any analysis

Whichever path you took — a guided workflow or ad-hoc queries — end by
+5. **Everything else** (startup, jank, ANRs, CPU, scheduling, counters,
any custom question): read
[querying.md]($SKILL_ROOT/infra-references/querying.md) and write
PerfettoSQL against a warm session.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: David Reveman <dreveman@gmail.com>
From: Agentprof <agentprof@localhost>
Date: Fri, 16 Oct 2026 08:52:00 -0700
Subject: [PATCH 8/8] ui: Allow embedders to provide their favicon

Expand All @@ -13,7 +13,7 @@ Tests: AgentProf build and browser favicon checks.
3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/ui/build.mjs b/ui/build.mjs
index 8b6ee9d6..cb6db1c8 100644
index 667f2050b4..26f2c0ff80 100644
--- a/ui/build.mjs
+++ b/ui/build.mjs
@@ -128,7 +128,7 @@ const RULES = [
Expand All @@ -25,7 +25,7 @@ index 8b6ee9d6..cb6db1c8 100644
{r: /ui\/src\/assets\/(data_explorer\/base-page\.json)/, f: copyAssets},
{r: /ui\/src\/assets\/(data_explorer\/examples\/(.*)[.]json)/, f: copyAssets},
{r: /ui\/src\/assets\/(data_explorer\/node_info\/(.*)[.]md)/, f: copyAssets},
@@ -1374,7 +1374,10 @@ function walk(dir, callback, skipRegex) {
@@ -1368,7 +1368,10 @@ function walk(dir, callback, skipRegex) {
if (skipRegex !== undefined && skipRegex.test(child)) continue;
if (stat.isDirectory()) {
walk(childPath, callback, skipRegex);
Expand All @@ -38,7 +38,7 @@ index 8b6ee9d6..cb6db1c8 100644
}
}
diff --git a/ui/src/core/embedder/embedder.ts b/ui/src/core/embedder/embedder.ts
index 8deef447..e8152aab 100644
index 8deef44734..e8152aabb5 100644
--- a/ui/src/core/embedder/embedder.ts
+++ b/ui/src/core/embedder/embedder.ts
@@ -51,6 +51,8 @@ export interface BrandingBadge {
Expand All @@ -51,7 +51,7 @@ index 8deef447..e8152aab 100644
readonly brandLogo?: {readonly src: string; readonly alt: string};
readonly homePage?: m.ComponentTypes<{app: App}>;
diff --git a/ui/src/frontend/index.ts b/ui/src/frontend/index.ts
index 97505605..21a749b8 100644
index 97505605de..21a749b8cb 100644
--- a/ui/src/frontend/index.ts
+++ b/ui/src/frontend/index.ts
@@ -310,7 +310,9 @@ function main() {
Expand Down
2 changes: 1 addition & 1 deletion third_party/perfetto.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Upstream Perfetto source used by tools/perfetto.
[perfetto]
url = "https://github.com/google/perfetto.git"
pin = "fff30e83b5af315d311a3f18626d70b458631fc5"
pin = "1e9c61e9844affd7dccd3d42d9ea9f3a3d10cf6d"
8 changes: 4 additions & 4 deletions tools/check-turns-ui.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const {chromium} = require('@playwright/test');
const url = 'http://127.0.0.1:10000';

export async function checkTurns(page) {
await page.locator('.ap-tabs .pf-tabs__tab-title').getByText('Turns', {exact: true}).click();
await page.locator('.ap-tabs .pf-tab-strip__tab-title').getByText('Turns', {exact: true}).click();
await page.locator('.ap-turn').first().waitFor();
assert.equal(await page.locator('.ap-turn-details').count(), 0, 'Details are lazy');
const rows = await page.evaluate(async () => {
Expand Down Expand Up @@ -96,7 +96,7 @@ export async function checkTurns(page) {
await page.waitForURL(/#!\/viewer/);
await page.waitForFunction(() => window.app.trace.selection.selection.kind === 'track_event');
await page.getByRole('navigation', {name: 'Main navigation'}).getByRole('link', {name: 'Overview', exact: true}).click();
await page.locator('.ap-tabs .pf-tabs__tab-title').getByText('Turns', {exact: true}).click();
await page.locator('.ap-tabs .pf-tab-strip__tab-title').getByText('Turns', {exact: true}).click();
await page.locator('.ap-turn').first().waitFor();
assert.equal(await page.locator('.ap-error').count(), 0, 'Setup survives remount after timeline navigation');
const expandAgain = page.locator('.ap-turn').first().getByRole('button', {name: /^Expand turn /});
Expand Down Expand Up @@ -126,7 +126,7 @@ async function checkSetupRetry(page) {
return original(sql);
};
});
await page.locator('.ap-tabs .pf-tabs__tab-title').getByText('Turns', {exact: true}).click();
await page.locator('.ap-tabs .pf-tab-strip__tab-title').getByText('Turns', {exact: true}).click();
await page.getByRole('button', {name: 'Retry turns', exact: true}).first().click();
await page.locator('.ap-turn').first().waitFor();
assert.equal(await page.locator('.ap-error').count(), 0, 'Retry recovers after a partially completed native setup');
Expand Down Expand Up @@ -225,7 +225,7 @@ async function main() {
await page.getByRole('group', {name: 'Recording agent'}).getByRole('button', {name: agent, exact: true}).click();
await page.locator('.ap-home__example').click();
await page.locator('.ap-session-summary tbody tr').first().waitFor({timeout: 60000});
await page.locator('.ap-tabs .pf-tabs__tab-title').getByText('Turns', {exact: true}).click();
await page.locator('.ap-tabs .pf-tab-strip__tab-title').getByText('Turns', {exact: true}).click();
await page.locator('.ap-turn').first().waitFor({timeout: 60000});
await page.locator('.ap-turn').first().getByRole('button', {name: /^Expand turn /}).click();
await page.locator('.ap-turn-details').first().waitFor();
Expand Down
Loading
Loading