Merge pull request #61470 from ClickHouse/fix-postprocess-script

Correctly process last stacktrace in `postprocess-traces.pl`
This commit is contained in:
robot-ch-test-poll3 2024-03-16 02:18:17 +01:00 committed by GitHub
commit f523ae669a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,19 @@ use Data::Dumper;
my @current_stack = ();
my $grouped_stacks = {};
sub process_stacktrace
{
my $group = \$grouped_stacks;
for my $frame (reverse @current_stack)
{
$$group->{count} ||= 0;
++$$group->{count};
$group = \$$group->{children}{$frame};
}
@current_stack = ();
}
while (my $line = <>)
{
chomp $line;
@ -21,18 +34,12 @@ while (my $line = <>)
if ($line eq '')
{
my $group = \$grouped_stacks;
for my $frame (reverse @current_stack)
{
$$group->{count} ||= 0;
++$$group->{count};
$group = \$$group->{children}{$frame};
}
@current_stack = ();
process_stacktrace();
}
}
process_stacktrace();
sub print_group
{
my $group = shift;