perfetto-ui: Use table name in cpu track
Change-Id: I110ff236214cbcea71bfb34e8d4d0e32c8fa7dc5
diff --git a/ui/src/tracks/cpu_slices/controller.ts b/ui/src/tracks/cpu_slices/controller.ts
index bb987f9..972e75e 100644
--- a/ui/src/tracks/cpu_slices/controller.ts
+++ b/ui/src/tracks/cpu_slices/controller.ts
@@ -46,11 +46,10 @@
this.busy = true;
if (this.setup === false) {
await this.query(
- `create virtual table window_${this.trackState.id} using window;`);
- await this.query(
- `create virtual table span_${this.trackState.id}
+ `create virtual table ${this.tableName('window')} using window;`);
+ await this.query(`create virtual table ${this.tableName('span')}
using span_join(sched PARTITIONED cpu,
- window_${this.trackState.id} PARTITIONED cpu);`);
+ ${this.tableName('window')} PARTITIONED cpu);`);
this.setup = true;
}
@@ -91,7 +90,7 @@
const query = `select
quantum_ts as bucket,
sum(dur)/cast(${bucketSizeNs} as float) as utilization
- from span_${this.trackState.id}
+ from ${this.tableName('span')}
where cpu = ${this.config.cpu}
and utid != 0
group by quantum_ts`;
@@ -161,8 +160,8 @@
onDestroy(): void {
if (this.setup) {
- this.query(`drop table window_${this.trackState.id}`);
- this.query(`drop table span_${this.trackState.id}`);
+ this.query(`drop table ${this.tableName('window')}`);
+ this.query(`drop table ${this.tableName('span')}`);
this.setup = false;
}
}