Skip to content

Commit

Permalink
Merge "[ui] Fix integration tests." into main am: 71204cc
Browse files Browse the repository at this point in the history
Original change: https://android-review.googlesource.com/c/platform/external/perfetto/+/2773424

Change-Id: I52ef51359ea9f9300f2da38f7e6810363c93cb0f
Signed-off-by: Automerger Merge Worker <[email protected]>
  • Loading branch information
stevegolton authored and android-build-merge-worker-robot committed Oct 5, 2023
2 parents 0405e35 + 71204cc commit 49cfe76
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b301d6515efaffb58f8e8227ae5bcf6b78ea592b92f9037c2abe1954c6102b8e
ec0a00856b147b2e13d0fe18666a307eb085ac437d67f78787131d4ea4190581
3 changes: 2 additions & 1 deletion ui/src/common/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export const MAX_TIME = 180;
// 39. Ported cpu_slice, ftrace, and android_log tracks to plugin tracks. Track
// state entries now require a URI and old track implementations are no
// longer registered.
export const STATE_VERSION = 39;
// 40. Ported counter, process summary/sched, & cpu_freq to plugin tracks.
export const STATE_VERSION = 40;

export const SCROLLING_TRACK_GROUP = 'ScrollingTracks';

Expand Down
2 changes: 1 addition & 1 deletion ui/src/controller/track_decider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ class TrackDecider {
pUuid = this.getOrCreateUuid(utid, upid);
const summaryTrackId = uuidv4();
const type = hasSched ? 'schedule' : 'summary';
const uri = `perfetto.ProcessScheduling#${utid}.${type}`;
const uri = `perfetto.ProcessScheduling#${upid}.${utid}.${type}`;

this.tracksToAdd.push({
id: summaryTrackId,
Expand Down
10 changes: 7 additions & 3 deletions ui/src/frontend/track_panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,18 @@ export class TrackLifecycleContainer implements Disposable {
private state = TrackLifecycleState.Initializing;

constructor(private track: TrackLike) {
track.onCreate().then(() => {
track.onCreate().finally(() => {
if (this.state === TrackLifecycleState.DestroyPending) {
track.onDestroy();
track.onDestroy().finally(() => {
this.state = TrackLifecycleState.Destroyed;
});
this.state = TrackLifecycleState.Destroying;
} else {
this.state = TrackLifecycleState.Initialized;
raf.scheduleFullRedraw();
}
});
// TODO(stevegolton): Handle failure case.
}

onFullRedraw(): void {
Expand Down Expand Up @@ -450,7 +454,7 @@ export class TrackLifecycleContainer implements Disposable {
break;
case TrackLifecycleState.Initialized:
this.state = TrackLifecycleState.Destroying;
this.track.onDestroy().then(() => {
this.track.onDestroy().finally(() => {
this.state = TrackLifecycleState.Destroyed;
});
break;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/tracks/process_summary/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class ProcessSummaryPlugin implements Plugin {
pUuid = this.getOrCreateUuid(utid, upid);
const pidForColor = pid || tid || upid || utid || 0;
const type = hasSched ? 'schedule' : 'summary';
const uri = `perfetto.ProcessScheduling#${utid}.${type}`;
const uri = `perfetto.ProcessScheduling#${upid}.${utid}.${type}`;

if (hasSched) {
const config: ProcessSchedulingTrackConfig = {
Expand Down

0 comments on commit 49cfe76

Please sign in to comment.