mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Revert "cmd/compile/internal/pgo: fix hard-coded PGO sample data position"
This reverts CL 465135. Reason for revert: This broke cmd/go.TestScript/build_pgo on the linux-amd64-longtest builder: https://build.golang.org/log/8f8ed7bf576f891a06d295c4a5bca987c6e941d6 Change-Id: Ie2f2cc2731099eb28eda6b94dded4dfc34e29441 Reviewed-on: https://go-review.googlesource.com/c/go/+/466439 Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Auto-Submit: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
da93766043
commit
bb6952fa25
2 changed files with 1 additions and 85 deletions
|
|
@ -140,25 +140,9 @@ func New(profileFile string) *Profile {
|
|||
return nil
|
||||
}
|
||||
|
||||
samplesCountIndex := -1
|
||||
for i, s := range profile.SampleType {
|
||||
// Samples count is the raw data collected, and CPU nanoseconds is just
|
||||
// a scaled version of it, so either one we can find is fine.
|
||||
if (s.Type == "samples" && s.Unit == "count") ||
|
||||
(s.Type == "cpu" && s.Unit == "nanoseconds") {
|
||||
samplesCountIndex = i
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if samplesCountIndex == -1 {
|
||||
log.Fatal("failed to find CPU samples count or CPU nanoseconds value-types in profile.")
|
||||
return nil
|
||||
}
|
||||
|
||||
g := newGraph(profile, &Options{
|
||||
CallTree: false,
|
||||
SampleValue: func(v []int64) int64 { return v[samplesCountIndex] },
|
||||
SampleValue: func(v []int64) int64 { return v[1] },
|
||||
})
|
||||
|
||||
p := &Profile{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue