mirror of
https://github.com/jlfwong/speedscope.git
synced 2024-11-25 20:51:51 +03:00
Fix for Chrome timelines containing multiple CPU profiles
This commit is contained in:
parent
f9af0fddb2
commit
f25f8fc5cc
@ -45,11 +45,16 @@ interface CPUProfile {
|
||||
}
|
||||
|
||||
export function importFromChromeTimeline(events: TimelineEvent[]) {
|
||||
const profileEvent = events[events.length - 1]
|
||||
const chromeProfile = profileEvent.args.data.cpuProfile as CPUProfile
|
||||
// It seems like sometimes Chrome timeline files contain multiple CpuProfiles?
|
||||
// For now, choose the first one in the list.
|
||||
for (let event of events) {
|
||||
if (event.name == "CpuProfile") {
|
||||
const chromeProfile = event.args.data.cpuProfile as CPUProfile
|
||||
return importFromChromeCPUProfile(chromeProfile)
|
||||
}
|
||||
|
||||
}
|
||||
throw new Error("Could not find CPU profile in Timeline")
|
||||
}
|
||||
|
||||
const callFrameToFrameInfo = new Map<CPUProfileCallFrame, FrameInfo>()
|
||||
function frameInfoForCallFrame(callFrame: CPUProfileCallFrame) {
|
||||
|
Loading…
Reference in New Issue
Block a user