Skip to content

Commit

Permalink
fix: move FixSamplesTime call to speedscope and calltrees methods (#339)
Browse files Browse the repository at this point in the history
* Move FixSamplesTime call to speedscope and calltrees methods
  • Loading branch information
viglia authored Oct 18, 2023
1 parent 6a50fe9 commit 5a29391
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

**Internal**

- Move FixSamplesTime call to speedscope and calltrees methods([#339](https://github.com/getsentry/vroom/pull/339))


## 23.10.0

Expand Down
6 changes: 6 additions & 0 deletions internal/profile/android.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ func (p *Android) FixSamplesTime() {

// CallTrees generates call trees for a given profile.
func (p Android) CallTrees() map[uint64][]*nodetree.Node {
// in case wall-clock.secs is not monotonic, "fix" it
p.FixSamplesTime()

var activeThreadID uint64
for _, thread := range p.Threads {
if thread.Name == mainThread {
Expand Down Expand Up @@ -370,6 +373,9 @@ func (p *Android) NormalizeMethods(pi profileInterface) {
}

func (p Android) Speedscope() (speedscope.Output, error) {
// in case wall-clock.secs is not monotonic, "fix" it
p.FixSamplesTime()

frames := make([]speedscope.Frame, 0)
methodIDToFrameIndex := make(map[uint64][]int)
for _, method := range p.Methods {
Expand Down
2 changes: 0 additions & 2 deletions internal/profile/legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ func (p *LegacyProfile) Normalize() {
t.ReplaceIdleStacks()
case *Android:
t.NormalizeMethods(p)
// in case wall-clock.secs is not monotonic, "fix" it
t.FixSamplesTime()
}

if p.BuildID != "" {
Expand Down

0 comments on commit 5a29391

Please sign in to comment.