|
@@ -114,11 +114,8 @@ func parseGoCount(b []byte) (*Profile, error) {
|
114
|
114
|
if err != nil {
|
115
|
115
|
return nil, errMalformed
|
116
|
116
|
}
|
117
|
|
- // Adjust all frames by -1 (except the leaf) to land on top of
|
118
|
|
- // the call instruction.
|
119
|
|
- if len(locs) > 0 {
|
120
|
|
- addr--
|
121
|
|
- }
|
|
117
|
+ // Adjust all frames by -1 to land on top of the call instruction.
|
|
118
|
+ addr--
|
122
|
119
|
loc := locations[addr]
|
123
|
120
|
if loc == nil {
|
124
|
121
|
loc = &Location{
|
|
@@ -527,13 +524,10 @@ func parseHeap(b []byte) (p *Profile, err error) {
|
527
|
524
|
}
|
528
|
525
|
|
529
|
526
|
var sloc []*Location
|
530
|
|
- for i, addr := range addrs {
|
|
527
|
+ for _, addr := range addrs {
|
531
|
528
|
// Addresses from stack traces point to the next instruction after
|
532
|
|
- // each call. Adjust by -1 to land somewhere on the actual call
|
533
|
|
- // (except for the leaf, which is not a call).
|
534
|
|
- if i > 0 {
|
535
|
|
- addr--
|
536
|
|
- }
|
|
529
|
+ // each call. Adjust by -1 to land somewhere on the actual call.
|
|
530
|
+ addr--
|
537
|
531
|
loc := locs[addr]
|
538
|
532
|
if locs[addr] == nil {
|
539
|
533
|
loc = &Location{
|
|
@@ -769,13 +763,10 @@ func parseContention(b []byte) (p *Profile, err error) {
|
769
|
763
|
return nil, err
|
770
|
764
|
}
|
771
|
765
|
var sloc []*Location
|
772
|
|
- for i, addr := range addrs {
|
|
766
|
+ for _, addr := range addrs {
|
773
|
767
|
// Addresses from stack traces point to the next instruction after
|
774
|
|
- // each call. Adjust by -1 to land somewhere on the actual call
|
775
|
|
- // (except for the leaf, which is not a call).
|
776
|
|
- if i > 0 {
|
777
|
|
- addr--
|
778
|
|
- }
|
|
768
|
+ // each call. Adjust by -1 to land somewhere on the actual call.
|
|
769
|
+ addr--
|
779
|
770
|
loc := locs[addr]
|
780
|
771
|
if locs[addr] == nil {
|
781
|
772
|
loc = &Location{
|