Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/import/chrome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ export function importFromChromeTimeline(events: TimelineEvent[], fileName: stri
if (event.name === 'CpuProfile') {
const pidTid = `${event.pid}:${event.tid}`
const id = event.id || pidTid

if (event.args.data == null) {
console.log('Ignoring CpuProfile event with no data', event)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These logs may be noisy, or not descriptive enough. Let me know!

continue
}

cpuProfileByID.set(id, event.args.data.cpuProfile as CPUProfile)
pidTidById.set(id, pidTid)
}
Expand Down Expand Up @@ -120,6 +126,11 @@ export function importFromChromeTimeline(events: TimelineEvent[], fileName: stri
const cpuProfile = cpuProfileByID.get(event.id || pidTid)
if (cpuProfile) {
const chunk = event.args.data
if (chunk == null) {
console.log('Ignoring ProfileChunk event with no data', event)
continue
}

if (chunk.cpuProfile) {
if (chunk.cpuProfile.nodes) {
cpuProfile.nodes = cpuProfile.nodes.concat(chunk.cpuProfile.nodes)
Expand Down