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: Mininum mutator utilization plot window durations range is not consistent across Include options #35330

Open
egorbunov opened this issue Nov 3, 2019 · 1 comment

Comments

@egorbunov
Copy link

@egorbunov egorbunov commented Nov 3, 2019

What version of Go are you using (go version)?

$ go version
go version go1.13.4 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/eg/.cache/go-build"
GOENV="/home/eg/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/eg/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/eg/go/src/bitbucket.org/triangleteam/resource-manager/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build569889623=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I wrote a simple code to check built in golang tracing:
package main

import (
	"os"
	"runtime"
	"runtime/trace"
	"sync"
	"time"
)

func main() {
	f, err := os.Create("trace.out")
	if err != nil {
		panic(err)
	}

	trace.Start(f)
	defer func() {
		trace.Stop()
		_ = f.Close()
	}()

	wg := sync.WaitGroup{}

	for g := 0; g < runtime.NumCPU(); g++ {
		wg.Add(1)
		go func() {
			for i := 0; i < 40; i++ {
				bs := make([]byte, 1024*1024)
				for k := range bs {
					bs[k] = byte(k % 8)
				}
				time.Sleep(50 * time.Millisecond)
			}
			wg.Done()
		}()
	}

	wg.Wait()
}

After running this program and getting trace.out file as an output I do $ go tool trace trace.out, open http://127.0.0.1:32935/mmu in the browser and look at the plots with and without STW checkbox set.

What did you expect to see?

I expect that X-axis range (min and max Window duration for which MMU function is evaluated) is the same with STW set and not set.

What did you see instead?

I see that with STW checkbox set the window duration range is [1ms, ~10s], and when checkbox is unset range is [1ns, 1ms].

MMU with STW set
MMU with STW unset

To conclude: if I get everything correctly, such behavior makes it harder to understand how GC affects the utilization. Should we make the window duration range consistent across any set of checked options? Or maybe we should make it possible for user to configure the range.

@hyangah
Copy link
Contributor

@hyangah hyangah commented Nov 4, 2019

@FiloSottile FiloSottile added this to the Unplanned milestone Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.