diff options
Diffstat (limited to 'src/cmd/vendor/github.com/google')
3 files changed, 17 insertions, 8 deletions
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/cli.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/cli.go index b97ef85169..7b8c3fc607 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/driver/cli.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/cli.go @@ -37,6 +37,7 @@ type source struct { HTTPHostport string HTTPDisableBrowser bool Comment string + AllFrames bool } // parseFlags parses the command lines through the specified flags package @@ -51,7 +52,8 @@ func parseFlags(o *plugin.Options) (*source, []string, error) { flagSymbolize := flag.String("symbolize", "", "Options for profile symbolization") flagBuildID := flag.String("buildid", "", "Override build id for first mapping") flagTimeout := flag.Int("timeout", -1, "Timeout in seconds for fetching a profile") - flagAddComment := flag.String("add_comment", "", "Annotation string to record in the profile") + flagAddComment := flag.String("add_comment", "", "Free-form annotation to add to the profile") + flagAllFrames := flag.Bool("all_frames", false, "Ignore drop_frames and keep_frames regexps") // CPU profile options flagSeconds := flag.Int("seconds", -1, "Length of time for dynamic profiles") // Heap profile options @@ -145,6 +147,7 @@ func parseFlags(o *plugin.Options) (*source, []string, error) { HTTPHostport: *flagHTTP, HTTPDisableBrowser: *flagNoBrowser, Comment: *flagAddComment, + AllFrames: *flagAllFrames, } if err := source.addBaseProfiles(*flagBase, *flagDiffBase); err != nil { @@ -338,6 +341,8 @@ var usageMsgVars = "\n\n" + " Port is optional and a randomly available port by default.\n" + " -no_browser Skip opening a browser for the interactive web UI.\n" + " -tools Search path for object tools\n" + + " -all_frames Ignore drop_frames and keep_frames regexps in the profile\n" + + " Rarely needed, mainly used for debugging pprof itself\n" + "\n" + " Legacy convenience options:\n" + " -inuse_space Same as -sample_index=inuse_space\n" + diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go index 969c1dac11..6d967a2037 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go @@ -77,6 +77,11 @@ func fetchProfiles(s *source, o *plugin.Options) (*profile.Profile, error) { } } + if s.AllFrames { + p.DropFrames = "" + p.KeepFrames = "" + } + // Symbolize the merged profile. if err := o.Sym.Symbolize(s.Symbolize, m, p); err != nil { return nil, err diff --git a/src/cmd/vendor/github.com/google/pprof/internal/elfexec/elfexec.go b/src/cmd/vendor/github.com/google/pprof/internal/elfexec/elfexec.go index 37884033d3..a45e6beeb4 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/elfexec/elfexec.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/elfexec/elfexec.go @@ -316,8 +316,7 @@ func ProgramHeadersForMapping(phdrs []elf.ProgHeader, mapOff, mapSz uint64) []*e // page size is not 4KB, we must try to guess the page size on the system // where the profile was collected, possibly using the architecture // specified in the ELF file header. - pageSize = 4096 - pageOffsetMask = pageSize - 1 + pageSize = 4096 ) mapLimit := mapOff + mapSz var headers []*elf.ProgHeader @@ -331,12 +330,12 @@ func ProgramHeadersForMapping(phdrs []elf.ProgHeader, mapOff, mapSz uint64) []*e segLimit := p.Off + p.Memsz // The segment must overlap the mapping. if p.Type == elf.PT_LOAD && mapOff < segLimit && p.Off < mapLimit { - // If the mapping offset is strictly less than the page aligned segment - // offset, then this mapping comes from a different segment, fixes - // b/179920361. + // If the mapping offset is strictly less than the segment offset aligned + // to the segment p_align value then this mapping comes from a different + // segment, fixes b/179920361. alignedSegOffset := uint64(0) - if p.Off > (p.Vaddr & pageOffsetMask) { - alignedSegOffset = p.Off - (p.Vaddr & pageOffsetMask) + if p.Off > (p.Vaddr & (p.Align - 1)) { + alignedSegOffset = p.Off - (p.Vaddr & (p.Align - 1)) } if mapOff < alignedSegOffset { continue |
