Skip to content

Commit a9e1277

Browse files
ui: Restrict Wattson GPU track to supported devices (#5834)
Dynamically check if the current device has GPU curves before enabling the Wattson GPU estimate track. This replaces the hardcoded SoC checks with a query to `_gpu_filtered_curves` in `wattson.curves.utils`. The GPU track will only show up if the trace contains GPU frequency events, GPU power state events, and the device has compatible GPU curves. Bug: 512481646 Test: UI test Signed-off-by: Runping Lai <runpinglai@google.com>
1 parent fef9c95 commit a9e1277

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • ui/src/plugins/org.kernel.Wattson

ui/src/plugins/org.kernel.Wattson/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,14 @@ async function hasWattsonGpuSupport(engine: Engine): Promise<boolean> {
215215
const result = await engine.query(`
216216
INCLUDE PERFETTO MODULE android.gpu.frequency;
217217
INCLUDE PERFETTO MODULE wattson.gpu.freq_idle;
218+
INCLUDE PERFETTO MODULE wattson.curves.utils;
218219
SELECT
219220
EXISTS (SELECT 1 FROM android_gpu_frequency) as freq,
220-
EXISTS (SELECT 1 FROM _gpu_power_state) as idle
221+
EXISTS (SELECT 1 FROM _gpu_power_state) as idle,
222+
EXISTS (SELECT 1 FROM _gpu_filtered_curves) as has_curves
221223
`);
222-
const row = result.firstRow({freq: NUM, idle: NUM});
223-
return !!row.freq && !!row.idle;
224+
const row = result.firstRow({freq: NUM, idle: NUM, has_curves: NUM});
225+
return !!row.freq && !!row.idle && !!row.has_curves;
224226
}
225227

226228
async function hasWattsonTpuSupport(engine: Engine): Promise<boolean> {

0 commit comments

Comments
 (0)