-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Darwinhelp wanted
Milestone
Description
I've encountered a strong discrepancy between pprof and dtrace while profiling quic-go. I've managed to reduce it to a somewhat simple test case (link), where (in a loop) data is sent via UDP to localhost and some CPU intensive computation that takes a few ms runs.
Profiling this via dtrace gives the expected result, with the CPU intensive part taking the majority of the time. dtrace (imo correctly) shows doSomething taking almost all of the runtime, whereas pprof says 62% is spent in syscall.Syscall6, called by the netFD.Write method.
The dtrace profile is generated using flamegraph with
sudo dtrace -x ustackframes=1000 -n 'profile-99 /execname == "pprof-test" && arg1/ { @[ustack()] = count(); } tick-20s { exit(0); }' -o out.dtrace && ~/src/FlameGraph/stackcollapse.pl out.dtrace > folded.dtrace && ~/src/FlameGraph/flamegraph.pl folded.dtrace > dtrace.svg
The pprof profile is generated using
go build && ./pprof-test
# in another shell
go tool pprof pprof-test localhost:8080/debug/pprof/profile
go version go1.7.1 darwin/amd64
What operating system and processor architecture are you using (go env)?
macOS 10.12 (16A323)
~/D/pprof-test → go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/lucas/src/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.7.1/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7.1/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8c/y8j1444j1fbddn6bl788p1ym0000gn/T/go-build975132377=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Darwinhelp wanted

