diff --git a/test/data/ui-screenshots/independent_features.test.ts/debuggable-chip/track-with-debuggable-chip-expanded.png.sha256 b/test/data/ui-screenshots/independent_features.test.ts/debuggable-chip/track-with-debuggable-chip-expanded.png.sha256 index 98255ae64f..afd8c95035 100644 --- a/test/data/ui-screenshots/independent_features.test.ts/debuggable-chip/track-with-debuggable-chip-expanded.png.sha256 +++ b/test/data/ui-screenshots/independent_features.test.ts/debuggable-chip/track-with-debuggable-chip-expanded.png.sha256 @@ -1 +1 @@ -526c3bce9a8622bc5ac983a88bec6fb41194c7f84dd7b740468bd275be13ee8e \ No newline at end of file +368ccbd5d12aec6d23c124d43226f4bf352d985d5c930626cb55fc1f3ad516d0 \ No newline at end of file diff --git a/test/data/ui-screenshots/independent_features.test.ts/debuggable-chip/track-with-debuggable-chip.png.sha256 b/test/data/ui-screenshots/independent_features.test.ts/debuggable-chip/track-with-debuggable-chip.png.sha256 index eff6f6be95..c1fe6943b4 100644 --- a/test/data/ui-screenshots/independent_features.test.ts/debuggable-chip/track-with-debuggable-chip.png.sha256 +++ b/test/data/ui-screenshots/independent_features.test.ts/debuggable-chip/track-with-debuggable-chip.png.sha256 @@ -1 +1 @@ -67240fa5e871e2e8cb9369c06a27dad3a3754bc4628d8d6060ffd6711ab3a012 \ No newline at end of file +77289aa186056fc1e61fe081e102d3edd6b02d0ba47d11942bb7c966fb8b5c9a \ No newline at end of file diff --git a/ui/src/core/default_plugins.ts b/ui/src/core/default_plugins.ts index caba9f0a4d..ac15d85b34 100644 --- a/ui/src/core/default_plugins.ts +++ b/ui/src/core/default_plugins.ts @@ -70,6 +70,7 @@ export const defaultPlugins = [ 'org.chromium.CriticalUserInteraction', 'org.kernel.LinuxKernelSubsystems', 'org.kernel.SuspendResumeLatency', + 'org.kernel.Wattson', 'perfetto.CoreCommands', 'perfetto.ExampleTraces', 'perfetto.GlobalGroups', diff --git a/ui/src/plugins/org.kernel.Wattson/index.ts b/ui/src/plugins/org.kernel.Wattson/index.ts index ebbe9464ca..825521dbc3 100644 --- a/ui/src/plugins/org.kernel.Wattson/index.ts +++ b/ui/src/plugins/org.kernel.Wattson/index.ts @@ -34,15 +34,13 @@ export default class implements PerfettoPlugin { // Short circuit if Wattson is not supported for this Perfetto trace if (!(await hasWattsonSupport(ctx.engine))) return; - ctx.engine.query(`INCLUDE PERFETTO MODULE wattson.curves.estimates;`); - const group = new TrackNode({title: 'Wattson', isSummary: true}); ctx.workspace.addChildInOrder(group); // CPUs estimate as part of CPU subsystem const cpus = ctx.traceInfo.cpus; for (const cpu of cpus) { - const queryKey = `cpu${cpu}_curve`; + const queryKey = `cpu${cpu}_mw`; const uri = `/wattson/cpu_subsystem_estimate_cpu${cpu}`; const title = `Cpu${cpu} Estimate`; ctx.tracks.registerTrack({ @@ -63,7 +61,7 @@ export default class implements PerfettoPlugin { ctx.tracks.registerTrack({ uri, title, - track: new CpuSubsystemEstimateTrack(ctx, uri, `dsu_scu`), + track: new CpuSubsystemEstimateTrack(ctx, uri, `dsu_scu_mw`), tags: { kind: CPUSS_ESTIMATE_TRACK_KIND, wattson: 'Dsu_Scu', @@ -82,10 +80,10 @@ export default class implements PerfettoPlugin { new WattsonThreadSelectionAggregator(), ); ctx.selection.registerAreaSelectionAggreagtor( - new WattsonPackageSelectionAggregator(), + new WattsonProcessSelectionAggregator(), ); ctx.selection.registerAreaSelectionAggreagtor( - new WattsonProcessSelectionAggregator(), + new WattsonPackageSelectionAggregator(), ); } } @@ -98,6 +96,12 @@ class CpuSubsystemEstimateTrack extends BaseCounterTrack { this.queryKey = queryKey; } + async onInit() { + await this.engine.query( + `INCLUDE PERFETTO MODULE wattson.curves.estimates;`, + ); + } + protected getDefaultCounterOptions(): CounterOptions { const options = super.getDefaultCounterOptions(); options.yRangeSharingKey = `CpuSubsystem`; @@ -106,19 +110,7 @@ class CpuSubsystemEstimateTrack extends BaseCounterTrack { } getSqlSource() { - if (this.queryKey.startsWith(`cpu`)) { - return `select ts, ${this.queryKey} as value from _system_state_curves`; - } else { - return ` - select - ts, - -- L3 values are scaled by 1000 because it's divided by ns and L3 LUTs - -- are scaled by 10^6. This brings to same units as static_curve (mW) - ((IFNULL(l3_hit_value, 0) + IFNULL(l3_miss_value, 0)) * 1000 / dur) - + static_curve as value - from _system_state_curves - `; - } + return `select ts, ${this.queryKey} as value from _system_state_mw`; } } diff --git a/ui/src/plugins/org.kernel.Wattson/process_aggregator.ts b/ui/src/plugins/org.kernel.Wattson/process_aggregator.ts index f2325cb19d..ab797c3e2e 100644 --- a/ui/src/plugins/org.kernel.Wattson/process_aggregator.ts +++ b/ui/src/plugins/org.kernel.Wattson/process_aggregator.ts @@ -40,6 +40,9 @@ export class WattsonProcessSelectionAggregator // Prerequisite tables are already generated by Wattson thread aggregation, // which is run prior to execution of this module engine.query(` + INCLUDE PERFETTO MODULE wattson.curves.idle_attribution; + INCLUDE PERFETTO MODULE wattson.curves.estimates; + -- Only get idle attribution in user defined window and filter by selected -- CPUs and GROUP BY process CREATE OR REPLACE PERFETTO TABLE _per_process_idle_attribution AS diff --git a/ui/src/test/wattson.test.ts b/ui/src/test/wattson.test.ts index 7f660d2c13..9bff14c3f3 100644 --- a/ui/src/test/wattson.test.ts +++ b/ui/src/test/wattson.test.ts @@ -36,9 +36,7 @@ const SCREEN_CLIP = { test.beforeAll(async ({browser}, _testInfo) => { page = await browser.newPage(); pth = new PerfettoTestHelper(page); - await pth.openTraceFile('wattson_dsu_pmu.pb', { - enablePlugins: 'org.kernel.Wattson', - }); + await pth.openTraceFile('wattson_dsu_pmu.pb'); }); test('wattson aggregations', async () => {