代码拉取完成,页面将自动刷新
#!/usr/bin/perl -ws
#
# stackcollapse-aix Collapse AIX /usr/bin/procstack backtraces
#
# Parse a list of backtraces as generated with the poor man's aix-perf.pl
# profiler
#
use strict;
my $process = "";
my $current = "";
my $previous_function = "";
my %stacks;
while(<>) {
chomp;
if (m/^\d+:/) {
if(!($current eq "")) {
$current = $process . ";" . $current;
$stacks{$current} += 1;
$current = "";
}
m/^\d+: ([^ ]*)/;
$process = $1;
$current = "";
}
elsif(m/^---------- tid# \d+/){
if(!($current eq "")) {
$current = $process . ";" . $current;
$stacks{$current} += 1;
}
$current = "";
}
elsif(m/^(0x[0-9abcdef]*) *([^ ]*) ([^ ]*) ([^ ]*)/) {
my $function = $2;
my $alt = $1;
$function=~s/\(.*\)?//;
if($function =~ /^\[.*\]$/) {
$function = $alt;
}
if ($current) {
$current = $function . ";" . $current;
}
else {
$current = $function;
}
}
}
if(!($current eq "")) {
$current = $process . ";" . $current;
$stacks{$current} += 1;
$current = "";
$process = "";
}
foreach my $k (sort { $a cmp $b } keys %stacks) {
print "$k $stacks{$k}\n";
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。