1
0
mirror of https://github.com/golang/go synced 2024-09-30 18:28:32 -06:00
Commit Graph

11 Commits

Author SHA1 Message Date
Dmitri Shuralyov
ef3dcd5937 cmd/heapview: look for tools repository in all GOPATH entries
The GOPATH environment variable is defined at
https://golang.org/cmd/go/#hdr-GOPATH_environment_variable as:

> The GOPATH environment variable lists places to look for Go code. On
> Unix, the value is a colon-separated string. On Windows, the value is
> a semicolon-separated string. On Plan 9, the value is a list.

It is legal for Go packages to be in any of those places, not only
the first entry. Look in all places for golang.org/x/tools repository.

Cache the directory that is found. It's slightly more expensive
to look for it, since potentially multiple directories must be
checked for existence.

Updates golang/go#19400.

Change-Id: I16661b7149d52ea6168fffc605c842d7a4da009b
Reviewed-on: https://go-review.googlesource.com/38778
Reviewed-by: Michael Matloob <matloob@golang.org>
2017-04-10 18:12:01 +00:00
Yasuhiro Matsumoto
963fe939f1 cmd/heapview: remove needless slash
Change-Id: Ie19a60595862c0afff9364ee21dd9598370e6c91
Reviewed-on: https://go-review.googlesource.com/38752
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-03-28 13:38:09 +00:00
Michael Matloob
08b1e0510c x/tools/cmd/heapview: add a sidebar to hold navigation
This change also puts more structure into the viewer.
Adds an enum for events that we'll issue and a few more elements
to organize things.

Change-Id: I39c7c53422779348ca05f051c6b0b07d22ad6a00
Reviewed-on: https://go-review.googlesource.com/26656
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-08-16 17:33:40 +00:00
Michael Matloob
68cf18548e x/tools/cmd/heapview/internal/core: stub mmapfile for !darwin,!linux
mmapfile.go uses symbols in the syscall package that are not defined
on windows and some other operating systems. Temporarily
buildtag-restrict mmapfile to darwin and linux (the platforms easiest
for me to test) to fix the build.

Change-Id: Ib056608a655b6d32170cd86deac785811e7bc0d1
Reviewed-on: https://go-review.googlesource.com/26830
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-11 13:58:04 +00:00
Michael Matloob
855bbc50ad cmd/heapview: add an internal core package for reading cores
This is based on github.com/tombergan/goheapdump/heapdump.

This CL mostly just copies over the 'raw' data structures based
on the profiler records' data structures. Many of them may need
to be changed, but I think it will be good to have these definitions
here to provide a base.

Change-Id: I609202b6b87d980b0835c8087b3d78e11bd6dfe3
Reviewed-on: https://go-review.googlesource.com/25584
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-08-09 19:00:08 +00:00
Michael Matloob
72064bd647 cmd/heapview: dowgrade to customelements v0
I've had too many issues with customelements v1. The interface for v0
isn't as nice, and v0 will eventually be deprecated. But v1's polyfill
library is better supported, and it will be easy to upgrade later.

Change-Id: I87b376376b750167a0464c6c249930edecbd59db
Reviewed-on: https://go-review.googlesource.com/25545
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2016-08-05 20:49:36 +00:00
Michael Matloob
337c0124d7 x/tools/cmd/heapview: add a heading to the page
This CL's purpose is to introduce the dependency on the HTML Custom
Elements polyfill. Like we've done so far, I'm trying to keep
dependencies light by using current or polyfilling future webcomponents
standards.

Change-Id: I11d14db367b697cdd527fb66b9d7d160ac244b78
Reviewed-on: https://go-review.googlesource.com/25494
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-05 01:00:25 +00:00
Michael Matloob
7ef02fdb22 cmd/heapview: add karma+jasmine TS unit testing config
Add a configuration that allows unit testing of client Typescript
code using Karma and Jasmine. Add a basic test to exercise this.

Change-Id: I88af82b68547423efeaafb0fab8214ed39573ee9
Reviewed-on: https://go-review.googlesource.com/25411
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Evan Martin <evanm@google.com>
2016-08-03 18:16:31 +00:00
Michael Matloob
9e7459099f x/tools/cmd/heapview: break out init code
This change breaks out the code that adds handler funcs and
starts the HTTP server into separate functions, so that they
can be overridden in other environments, such as Google's.

For instance, listenAndServe can be overridden in an init method
in a different file to use a HTTP2 server.

Updates golang/go#16410

Change-Id: I074242af10486c60c374e9ac7ebe9d0e61a8fa22
Reviewed-on: https://go-review.googlesource.com/25273
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-07-27 17:11:33 +00:00
Michael Matloob
053ddb97bf x/tools/cmd/heapview: add basic client serving
This change primarily exists to import Typescript and the
ES6 module loader polyfill as dependencies for this project.
Both dependencies are relatively lightweight and can be easily
removed if we decide we don't need them.

The module loader polyfill implements support for an upcoming
browser feature in ES6 (the next version of JavaScript). This
feature helps modularize Javascript code and conveniently split it
into multiple files. It should be supported by the stable versions
of the four major browsers (Chrome, Firefox, Safari and Edge)
by the end of the year. Once that happens, we can remove the polyfill.

The Typescript compiler provides two things: First, it compiles
new, but not-yet-supported ES6 Javascript features into ES5. It
also provides a typechecker similar to what Closure does, but types
are indicated in syntax rather than JSDoc comments. If we decide
we don't want this dependency, we can compile the Typescript code
into human-readable JavaScript code. (The compiler basically
strips out types and replaces ES6 language features with more
well-supported JavaScript equivalents). The Typescript compiler
is not required for development. typescript.js and a feature in
the module loader will be used to compile Typescript into JavaScript
at serving time. (We might want to do something different for the
production version, but we can get to that later).

The change also adds code to serve the HTML and Javascript files.

Updates golang/go#16410

Change-Id: I42c669d1de636d8b221fc03ed22aa7ac60554610
Reviewed-on: https://go-review.googlesource.com/25240
Reviewed-by: Austin Clements <austin@google.com>
2016-07-26 20:51:39 +00:00
Michael Matloob
55296b3beb x/tools/cmd/heapview: rename heapdump to heapview
Updates golang/go#16410

Change-Id: I0133971f9a1149da6d88180fc2e378003f189cc8
Reviewed-on: https://go-review.googlesource.com/25101
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-07-20 19:02:34 +00:00