Skip to content

Commit

Permalink
Merge branch 'master' into neg-warn
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanmar511 authored Jul 17, 2018
2 parents dc6bb2a + 3e1e08e commit 2e09821
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 35 deletions.
18 changes: 8 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,39 @@ go_import_path: github.com/google/pprof

matrix:
include:
- os: linux
go: 1.7.x
- os: linux
go: 1.8.x
- os: linux
go: 1.9.x
- os: linux
go: 1.10.x
- os: linux
go: master
- os: osx
osx_image: xcode6.4
go: 1.8.x
go: 1.9.x
env: SKIP_GRAPHVIZ=1
- os: osx
osx_image: xcode6.4
go: 1.9.x
go: 1.10.x
env: SKIP_GRAPHVIZ=1
- os: osx
osx_image: xcode6.4
go: master
env: SKIP_GRAPHVIZ=1
- os: osx
osx_image: xcode7.3
go: 1.8.x
go: 1.9.x
- os: osx
osx_image: xcode7.3
go: 1.9.x
go: 1.10.x
- os: osx
osx_image: xcode7.3
go: master
- os: osx
osx_image: xcode8.3
go: 1.8.x
go: 1.9.x
- os: osx
osx_image: xcode8.3
go: 1.9.x
go: 1.10.x
- os: osx
osx_image: xcode8.3
go: master
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ them through the use of the native binutils tools (addr2line and nm).

Prerequisites:

- Go development kit. Requires Go 1.7 or newer.
- Go development kit. Requires Go 1.9 or newer.
Follow [these instructions](http://golang.org/doc/code.html) to install the
go tool and set up GOPATH.

Expand Down
17 changes: 3 additions & 14 deletions internal/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func generateReport(p *profile.Profile, cmd []string, vars variables, o *plugin.
}

func applyCommandOverrides(cmd string, outputFormat int, v variables) variables {
trim, tagfilter, filter := v["trim"].boolValue(), true, true
trim := v["trim"].boolValue()

switch cmd {
case "callgrind", "kcachegrind":
Expand All @@ -162,7 +162,7 @@ func applyCommandOverrides(cmd string, outputFormat int, v variables) variables
trim = false
v.set("addressnoinlines", "t")
case "peek":
trim, tagfilter, filter = false, false, false
trim = false
case "list":
v.set("nodecount", "0")
v.set("lines", "t")
Expand All @@ -177,7 +177,7 @@ func applyCommandOverrides(cmd string, outputFormat int, v variables) variables
}

if outputFormat == report.Proto || outputFormat == report.Raw {
trim, tagfilter, filter = false, false, false
trim = false
v.set("addresses", "t")
}

Expand All @@ -186,17 +186,6 @@ func applyCommandOverrides(cmd string, outputFormat int, v variables) variables
v.set("nodefraction", "0")
v.set("edgefraction", "0")
}
if !tagfilter {
v.set("tagfocus", "")
v.set("tagignore", "")
}
if !filter {
v.set("focus", "")
v.set("ignore", "")
v.set("hide", "")
v.set("show", "")
v.set("show_from", "")
}
return v
}

Expand Down
17 changes: 7 additions & 10 deletions internal/driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ func TestParse(t *testing.T) {

flags := strings.Split(tc.flags, ",")

// Skip the output format in the first flag, to output to a proto
addFlags(&f, flags[1:])

// Encode profile into a protobuf and decode it again.
protoTempFile, err := ioutil.TempFile("", "profile_proto")
if err != nil {
Expand All @@ -124,6 +121,7 @@ func TestParse(t *testing.T) {
if flags[0] == "topproto" {
f.bools["proto"] = false
f.bools["topproto"] = true
f.bools["addresses"] = true
}

// First pprof invocation to save the profile into a profile.proto.
Expand All @@ -145,23 +143,22 @@ func TestParse(t *testing.T) {
}
defer os.Remove(outputTempFile.Name())
defer outputTempFile.Close()

f = baseFlags()
f.strings["output"] = outputTempFile.Name()
f.args = []string{protoTempFile.Name()}

var solution string
delete(f.bools, "proto")
addFlags(&f, flags)
solution := solutionFilename(tc.source, &f)
// Apply the flags for the second pprof run, and identify name of
// the file containing expected results
if flags[0] == "topproto" {
addFlags(&f, flags)
solution = solutionFilename(tc.source, &f)
delete(f.bools, "topproto")
f.bools["text"] = true
} else {
delete(f.bools, "proto")
addFlags(&f, flags[:1])
solution = solutionFilename(tc.source, &f)
}
// The add_comment flag is not idempotent so only apply it on the first run.
delete(f.strings, "add_comment")

// Second pprof invocation to read the profile from profile.proto
// and generate a report.
Expand Down

0 comments on commit 2e09821

Please sign in to comment.