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: broken link + some UX improvements #38518

Closed
entombedvirus opened this issue Apr 19, 2020 · 1 comment
Closed

cmd/trace: broken link + some UX improvements #38518

entombedvirus opened this issue Apr 19, 2020 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@entombedvirus
Copy link
Contributor

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

$ go version
go version go1.14.2 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/rravi/.cache/go-build"
GOENV="/home/rravi/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/rravi/.gotools"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build296868543=/tmp/go-build -gno-record-gcc-switches"

What did you do?

  1. generate some traces with User Regions
$ go test cmd/trace -o trace.test
$ ./trace.test -savetraces
$ ls -l *.trace
-rw------- 1 rravi rravi 4459 Apr 19 01:29 TestAnalyzeAnnotationGC.trace
-rw------- 1 rravi rravi 2278 Apr 19 01:29 TestAnalyzeAnnotations.trace
-rw------- 1 rravi rravi 1938 Apr 19 01:29 TestAnalyzeAnnotationTaskTree.trace
-rw------- 1 rravi rravi 9967 Apr 19 01:29 TestDirectSemaphoreHandoff.trace
-rw------- 1 rravi rravi 1653 Apr 19 01:29 TestFoo.trace
  1. start the trace tool
go tool trace ./TestAnalyzeAnnotations.trace
2020/04/19 01:34:02 Parsing trace...
2020/04/19 01:34:02 Splitting trace...
2020/04/19 01:34:02 Opening browser. Trace viewer is listening on http://127.0.0.1:45911
  1. visit trace ui and click on "User-defined regions"
    image
  2. click on any of the links under the "Counts" column
    image

What did you expect to see?

A table of user regions.
image

What did you see instead?

The table of user regions is missing.
image

Analysis

The root cause turned out to be a simple encoding error when forming the link: the pc URL parameter is encoded in base 10 whereas the handler expects it be encoded in base 16.

In a local branch, I have the above fix plus some UX improvements that I found useful since I use runtime/trace User Annotation API frequently to debug issues in production.

  1. Links to pprof style graphs and download links for region specific io, block, syscall and scheduler profiles. I was surprised that this functionality was implemented on the server, but not easily discoverable via the UI.
    image
  2. Table headers get a cursor: pointer CSS style on hover to signal to the user that they're in fact clickable (for sorting).
    image

I'll go through the Contribution Guide and put up a review soon.

@gopherbot
Copy link

Change https://golang.org/cl/228899 mentions this issue: cmd/trace: fix broken link + UX improvements

@andybons andybons added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 20, 2020
@andybons andybons added this to the Go1.15 milestone Apr 20, 2020
@golang golang locked and limited conversation to collaborators Apr 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants