mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Merge pull request #61470 from ClickHouse/fix-postprocess-script
Correctly process last stacktrace in `postprocess-traces.pl`
This commit is contained in:
commit
f523ae669a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user