// maxArgs is the maximum number of arguments for "plain" events,
// i.e. anything that could reasonably be represented as a baseEvent.
-//
-// TODO(mknyszek): This is only 6 instead of 5 because GoStatusStack
-// has 5 arguments and needs to smuggle in a 6th. Figure out a way to
-// shrink this in the future.
-const maxArgs = 6
+const maxArgs = 5
// timedEventArgs is an array that is able to hold the arguments for any
// timed event.
s = goStateTransition(e.ctx.G, GoSyscall, GoRunnable)
s.Stack = e.Stack() // This event references the resource the event happened on.
case go122.EvGoStatus, go122.EvGoStatusStack:
- // N.B. ordering.advance populates e.base.extra.
- s = goStateTransition(GoID(e.base.args[0]), GoState(e.base.extra(version.Go122)[0]), go122GoStatus2GoState[e.base.args[2]])
+ packedStatus := e.base.args[2]
+ from, to := packedStatus>>32, packedStatus&((1<<32)-1)
+ s = goStateTransition(GoID(e.base.args[0]), GoState(from), go122GoStatus2GoState[to])
default:
panic(fmt.Sprintf("internal error: unexpected event type for StateTransition kind: %s", go122.EventString(e.base.typ)))
}
} else {
return curCtx, false, fmt.Errorf("found goroutine status for new goroutine after the first generation: id=%v status=%v", gid, status)
}
- ev.extra(version.Go122)[0] = uint64(oldState) // Smuggle in the old state for StateTransition.
+ ev.args[2] = uint64(oldState)<<32 | uint64(status) // Smuggle in the old state for StateTransition.
newCtx := curCtx
switch status {