aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/trace.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2022-07-19 13:49:33 -0400
committerMichael Pratt <mpratt@google.com>2022-08-12 01:39:28 +0000
commitdd8cb66d0b1bf385a8acbbdc81515b301e059236 (patch)
treec597432d852a845d21fbc229d3db550368486569 /src/runtime/trace.go
parentb464708b463b104849a951af54352c8a894bfbc4 (diff)
downloadgo-dd8cb66d0b1bf385a8acbbdc81515b301e059236.tar.xz
runtime: convert g.goid to uint64
schedt.goidgen and p.goidcache are already uint64, this makes all cases consistent. The only oddball here is schedtrace which prints -1 as an equivalent for N/A or nil. A future CL will make this more explicit. Change-Id: I489626f3232799f6ca333d0d103b71d9d3aa7494 Reviewed-on: https://go-review.googlesource.com/c/go/+/419440 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime/trace.go')
-rw-r--r--src/runtime/trace.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/runtime/trace.go b/src/runtime/trace.go
index 4290d92240..0bae0db88d 100644
--- a/src/runtime/trace.go
+++ b/src/runtime/trace.go
@@ -262,16 +262,16 @@ func StartTrace() error {
gp.tracelastp = getg().m.p
// +PCQuantum because traceFrameForPC expects return PCs and subtracts PCQuantum.
id := trace.stackTab.put([]uintptr{startPCforTrace(gp.startpc) + sys.PCQuantum})
- traceEvent(traceEvGoCreate, -1, uint64(gp.goid), uint64(id), stackID)
+ traceEvent(traceEvGoCreate, -1, gp.goid, uint64(id), stackID)
}
if status == _Gwaiting {
// traceEvGoWaiting is implied to have seq=1.
gp.traceseq++
- traceEvent(traceEvGoWaiting, -1, uint64(gp.goid))
+ traceEvent(traceEvGoWaiting, -1, gp.goid)
}
if status == _Gsyscall {
gp.traceseq++
- traceEvent(traceEvGoInSyscall, -1, uint64(gp.goid))
+ traceEvent(traceEvGoInSyscall, -1, gp.goid)
} else {
gp.sysblocktraced = false
}
@@ -780,7 +780,7 @@ func traceCPUSample(gp *g, pp *p, stk []uintptr) {
hdr[0] = 0b10
}
if gp != nil {
- hdr[1] = uint64(gp.goid)
+ hdr[1] = gp.goid
}
// Allow only one writer at a time
@@ -1376,7 +1376,7 @@ func traceGoCreate(newg *g, pc uintptr) {
newg.tracelastp = getg().m.p
// +PCQuantum because traceFrameForPC expects return PCs and subtracts PCQuantum.
id := trace.stackTab.put([]uintptr{startPCforTrace(pc) + sys.PCQuantum})
- traceEvent(traceEvGoCreate, 2, uint64(newg.goid), uint64(id))
+ traceEvent(traceEvGoCreate, 2, newg.goid, uint64(id))
}
func traceGoStart() {
@@ -1384,12 +1384,12 @@ func traceGoStart() {
pp := gp.m.p
gp.traceseq++
if pp.ptr().gcMarkWorkerMode != gcMarkWorkerNotWorker {
- traceEvent(traceEvGoStartLabel, -1, uint64(gp.goid), gp.traceseq, trace.markWorkerLabels[pp.ptr().gcMarkWorkerMode])
+ traceEvent(traceEvGoStartLabel, -1, gp.goid, gp.traceseq, trace.markWorkerLabels[pp.ptr().gcMarkWorkerMode])
} else if gp.tracelastp == pp {
- traceEvent(traceEvGoStartLocal, -1, uint64(gp.goid))
+ traceEvent(traceEvGoStartLocal, -1, gp.goid)
} else {
gp.tracelastp = pp
- traceEvent(traceEvGoStart, -1, uint64(gp.goid), gp.traceseq)
+ traceEvent(traceEvGoStart, -1, gp.goid, gp.traceseq)
}
}
@@ -1420,10 +1420,10 @@ func traceGoUnpark(gp *g, skip int) {
pp := getg().m.p
gp.traceseq++
if gp.tracelastp == pp {
- traceEvent(traceEvGoUnblockLocal, skip, uint64(gp.goid))
+ traceEvent(traceEvGoUnblockLocal, skip, gp.goid)
} else {
gp.tracelastp = pp
- traceEvent(traceEvGoUnblock, skip, uint64(gp.goid), gp.traceseq)
+ traceEvent(traceEvGoUnblock, skip, gp.goid, gp.traceseq)
}
}
@@ -1447,7 +1447,7 @@ func traceGoSysExit(ts int64) {
gp := getg().m.curg
gp.traceseq++
gp.tracelastp = gp.m.p
- traceEvent(traceEvGoSysExit, -1, uint64(gp.goid), gp.traceseq, uint64(ts)/traceTickDiv)
+ traceEvent(traceEvGoSysExit, -1, gp.goid, gp.traceseq, uint64(ts)/traceTickDiv)
}
func traceGoSysBlock(pp *p) {