Skip to content

runtime/pprof: takes zero samples in BashOnWindows (WSL) #22366

@bradleyjkemp

Description

@bradleyjkemp

This is probably a BashOnWindows issue but just wanted to raise here to check.

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

go version go1.9.1 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/mnt/c/Users/Bradley/GoglandProjects/workflow"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build102190546=/tmp/go-
build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

Using dummy benchmark in https://play.golang.org/p/orUkRfuAl1:
When run in windows this produces a cpu.pprof file of 4.5Kb and opening with pprof gives the following information:

Type: cpu
Time: Oct 20, 2017 at 8:12pm (DST)
Duration: 12.25s, Total samples = 3.83s (31.28%)

When the same program is run in BashOnWindows this produces a cpu.pprof file of 239Bytes and opening with pprof gives:

Type: cpu
Time: Oct 20, 2017 at 8:11pm (DST)
Duration: 12.22s, Total samples = 0

What did you expect to see?

Both environments to produce a cpu.pprof file containing a similar number of samples.

What did you see instead?

When run in BashOnWindows pprof never takes a single sample.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions