Skip to content

Commit

Permalink
skip comments on converting phpspy compatible traces to the speedscop…
Browse files Browse the repository at this point in the history
…e format and fix ordering of traces
  • Loading branch information
sj-i committed Oct 8, 2021
1 parent 01dd6f1 commit a6c89d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Command/Converter/SpeedscopeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ private function parsePhpSpyCompatible(array $buffer): CallTrace
$frames = [];
foreach ($buffer as $line_buffer) {
$result = explode(' ', $line_buffer);
[$_depth, $name, $file_line] = $result;
[$depth, $name, $file_line] = $result;
if ($depth === '#') { // comment
continue;
}
[$file, $line] = explode(':', $file_line);
$frames[] = new CallFrame(
'',
Expand Down Expand Up @@ -102,7 +105,7 @@ private function collectFrames(iterable $call_frames): array
}
$sampled_stack[] = $trace_map[$mapper_key];
}
$sampled_stacks[] = $sampled_stack;
$sampled_stacks[] = \array_reverse($sampled_stack);
$counter++;
}
return [
Expand Down

0 comments on commit a6c89d4

Please sign in to comment.