Skip to content

Commit 80b19a4

Browse files
authored
ui: Stop auto-selecting heap-graph dumps on the timeline (#5836)
Since we open the heap dump explorer by default, we should avoid auto selecing heap dumps on the timeline to not steal cycles from hde.
1 parent a9e1277 commit 80b19a4

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

  • ui/src/plugins/dev.perfetto.HeapProfile

ui/src/plugins/dev.perfetto.HeapProfile/index.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,32 +264,30 @@ export default class HeapProfilePlugin implements PerfettoPlugin {
264264
}
265265

266266
private async selectHeapProfile(ctx: Trace) {
267+
// Heap-graphs default open in the HeapDumpExplorer so exclude them here to
268+
// avoid redundant queries.
267269
const result = await ctx.engine.query(`
268270
SELECT
269-
id,
270271
upid,
271272
type
272273
FROM ${EVENT_TABLE_NAME}
274+
WHERE type != 'java_heap_graph'
273275
ORDER BY type, ts
274276
LIMIT 1
275277
`);
276278

277-
const iter = result.maybeFirstRow({id: NUM, upid: NUM, type: STR});
279+
const iter = result.maybeFirstRow({upid: NUM, type: STR});
278280
if (!iter) return;
279281

280282
const uri = trackUri(iter.upid, iter.type);
281283
const track = this.trackMap.get(uri);
282284
if (!track) return;
283285

284-
if (profileDescriptor(iter.type).type === ProfileType.JAVA_HEAP_GRAPH) {
285-
ctx.selection.selectTrackEvent(track.uri, iter.id);
286-
} else {
287-
ctx.selection.selectArea({
288-
start: ctx.traceInfo.start,
289-
end: ctx.traceInfo.end,
290-
trackUris: [uri],
291-
});
292-
}
286+
ctx.selection.selectArea({
287+
start: ctx.traceInfo.start,
288+
end: ctx.traceInfo.end,
289+
trackUris: [uri],
290+
});
293291
}
294292

295293
private heapProfileSelectionHandler(

0 commit comments

Comments
 (0)