cleanup of PR #14833 (VM profiler)
This commit is contained in:
parent
d7ccd82eac
commit
f92d2eaa35
1 changed files with 16 additions and 13 deletions
|
|
@ -8,8 +8,7 @@ proc enter*(prof: var Profiler, c: PCtx, tos: PStackFrame) {.inline.} =
|
|||
prof.tEnter = cpuTime()
|
||||
prof.tos = tos
|
||||
|
||||
proc leave*(prof: var Profiler, c: PCtx) {.inline.} =
|
||||
if optProfileVM in c.config.globalOptions:
|
||||
proc leaveImpl(prof: var Profiler, c: PCtx) {.noinline.} =
|
||||
let tLeave = cpuTime()
|
||||
var tos = prof.tos
|
||||
var data = c.config.vmProfileData.data
|
||||
|
|
@ -23,6 +22,10 @@ proc leave*(prof: var Profiler, c: PCtx) {.inline.} =
|
|||
inc data[li].count
|
||||
tos = tos.next
|
||||
|
||||
proc leave*(prof: var Profiler, c: PCtx) {.inline.} =
|
||||
if optProfileVM in c.config.globalOptions:
|
||||
leaveImpl(prof, c)
|
||||
|
||||
proc dump*(conf: ConfigRef, pd: ProfileData): string =
|
||||
var data = pd.data
|
||||
echo "\nprof: µs #instr location"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue