Skip to content

Commit

Permalink
kram-profile - one more stab at fixing total
Browse files Browse the repository at this point in the history
  • Loading branch information
alecazam committed Mar 18, 2024
1 parent cc111d0 commit 7137432
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions kram-profile/kram-profile/kram_profileApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1484,16 +1484,22 @@ func convertStatsToTotalTrack(_ stats: BuildStats) -> [CatapultEvent] {
event.ts = stats.frontendStart + stats.totalSource
totalEvents.append(event)

// put this first, or else InstantiateClass isn't ordered properly
// Perfetto must not be sorting the events properly. So order this one first
event = makeDurEvent(tid, "Total CodeGen Function", stats.totalCodeGenFunction, total)
event.ts = stats.frontendStart + stats.totalSource + stats.totalInstantiateFunction
totalEvents.append(event)
// This is nearly always bigger than its parent total 14% vs. 16%, so are totals wrong
var totalInstantiateClass = stats.totalInstantiateClass
if totalInstantiateClass > stats.totalInstantiateFunction {
totalInstantiateClass = stats.totalInstantiateFunction
}

event = makeDurEvent(tid, "Total InstantiateClass", stats.totalInstantiateClass, total)
// This overlaps with some Source, and some InstantiateFunction, so it's sort of double
// counted, so clamp it for now so Perfetto doesn't freak out and get the event order wrong.
event = makeDurEvent(tid, "Total InstantiateClass", totalInstantiateClass, total)
event.ts = stats.frontendStart + stats.totalSource
totalEvents.append(event)

event = makeDurEvent(tid, "Total CodeGen Function", stats.totalCodeGenFunction, total)
event.ts = stats.frontendStart + stats.totalSource + stats.totalInstantiateFunction
totalEvents.append(event)

// backend
event = makeDurEvent(tid, "Total Backend", stats.totalBackend, total)
event.ts = stats.backendStart
Expand Down

0 comments on commit 7137432

Please sign in to comment.