diff options
author | Lalit Maganti <lalitm@google.com> | 2024-04-26 14:20:57 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-04-26 14:20:57 +0000 |
commit | 34582f5b87c886a55341f09544c43441da4b6f0a (patch) | |
tree | a5f1fa7886a48ee4a8caf4c984e5e0b56301899d | |
parent | 176b9487c2c99f1d821fe76c364af51e1c56b191 (diff) | |
parent | 99a464addc7f1bcfea0d7848b1daad84409ed65b (diff) | |
download | perfetto-34582f5b87c886a55341f09544c43441da4b6f0a.tar.gz |
Merge "ui: fix thread based process scheduling tracks" into main
-rw-r--r-- | ui/src/tracks/process_summary/process_scheduling_track.ts | 27 | ||||
-rw-r--r-- | ui/src/tracks/process_summary/process_summary_track.ts | 6 |
2 files changed, 21 insertions, 12 deletions
diff --git a/ui/src/tracks/process_summary/process_scheduling_track.ts b/ui/src/tracks/process_summary/process_scheduling_track.ts index 64fe72c1a..29017ffac 100644 --- a/ui/src/tracks/process_summary/process_scheduling_track.ts +++ b/ui/src/tracks/process_summary/process_scheduling_track.ts @@ -128,8 +128,6 @@ export class ProcessSchedulingTrack implements Track { end: time, resolution: duration, ): Promise<Data> { - assertTrue(this.config.upid !== null); - // Resolution must always be a power of 2 for this logic to work assertTrue(BIMath.popcount(resolution) === 1, `${resolution} not pow of 2`); @@ -205,14 +203,23 @@ export class ProcessSchedulingTrack implements Track { } private async createSchedView() { - await this.engine.query(` - create view ${this.tableName('process_sched')} as - select ts, dur, cpu, utid - from experimental_sched_upid - where - utid != 0 and - upid = ${this.config.upid} - `); + if (this.config.upid !== null) { + await this.engine.query(` + create view ${this.tableName('process_sched')} as + select ts, dur, cpu, utid + from experimental_sched_upid + where + utid != 0 and + upid = ${this.config.upid} + `); + } else { + await this.engine.query(` + create view ${this.tableName('process_sched')} as + select ts, dur, cpu, utid + from sched + where utid = ${this.config.utid} + `); + } } getHeight(): number { diff --git a/ui/src/tracks/process_summary/process_summary_track.ts b/ui/src/tracks/process_summary/process_summary_track.ts index f556728c2..7acf36bf8 100644 --- a/ui/src/tracks/process_summary/process_summary_track.ts +++ b/ui/src/tracks/process_summary/process_summary_track.ts @@ -15,7 +15,7 @@ import {v4 as uuidv4} from 'uuid'; import {BigintMath} from '../../base/bigint_math'; -import {assertFalse} from '../../base/logging'; +import {assertExists, assertFalse} from '../../base/logging'; import {duration, Time, time} from '../../base/time'; import {colorForTid} from '../../core/colorizer'; import {LIMIT, TrackData} from '../../common/track_data'; @@ -70,7 +70,7 @@ export class ProcessSummaryTrack implements Track { `create virtual table ${this.tableName('window')} using window;`, ); - let utids = [this.config.utid]; + let utids: number[]; // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions if (this.config.upid) { const threadQuery = await this.engine.query( @@ -80,6 +80,8 @@ export class ProcessSummaryTrack implements Track { for (const it = threadQuery.iter({utid: NUM}); it.valid(); it.next()) { utids.push(it.utid); } + } else { + utids = [assertExists(this.config.utid)]; } const trackQuery = await this.engine.query( |