Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/trace: grey colour is undocumented in goroutine analysis #36232

Open
RealBar opened this issue Dec 20, 2019 · 2 comments
Open

cmd/trace: grey colour is undocumented in goroutine analysis #36232

RealBar opened this issue Dec 20, 2019 · 2 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@RealBar
Copy link

RealBar commented Dec 20, 2019

1.13.4

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

not need

What did you do?

I use go tool trace to analysis goroutines

What did you expect to see?

display clearly each part of the goroutine time

What did you see instead?

unknown part of grey color

@ALTree
Copy link
Member

ALTree commented Dec 20, 2019

From https://github.com/golang/go/blob/master/src/cmd/trace/goroutines.go#L224:

.unknown-time { background-color: #636363; }
.exec-time { background-color: #d7191c; }
.io-time { background-color: #fdae61; }
.block-time { background-color: #d01c8b; }
.syscall-time { background-color: #7b3294; }
.sched-time { background-color: #2c7bb6; }

That grey (#636363) is from .unknown-time. unknownTime is computed as:

"unknownTime": func(desc *trace.GDesc) int64 {
	sum := desc.ExecTime + desc.IOTime + desc.BlockTime + desc.SyscallTime + desc.SchedWaitTime
	if sum < desc.TotalTime {
		return desc.TotalTime - sum
	}
	return 0
},

So all the other times are summed and if the sum is less that TotalTime, the difference is marked as unknownTime.

It appears the answer to your question is: grey is the time that is not spent in any of the other known phases (ExecTime, IOTime, BlockTime, SyscallTime, and SchedWaitTime).

I'm not sure what kind of activity may end up causing time to end up there, but maybe @hyangah knows.

@ALTree ALTree changed the title go tool trace:what does the grey color mean of goroutine analysis? cmd/go: grey colour is undocumented in goroutine analysis Dec 20, 2019
@ALTree ALTree added Documentation NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Dec 20, 2019
@ALTree ALTree added this to the Unplanned milestone Dec 20, 2019
@ALTree
Copy link
Member

ALTree commented Dec 20, 2019

Labelling this as a (possible) documentation issue, since it's not easy to understand what grey means without looking at the trace tool source code, so it may be worth documenting it somewhere.

@ALTree ALTree changed the title cmd/go: grey colour is undocumented in goroutine analysis cmd/trace: grey colour is undocumented in goroutine analysis Dec 20, 2019
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

3 participants