Fix verilator_profcfunc on old gprofs.
This commit is contained in:
parent
9219ddaece
commit
a46aa2d62b
|
|
@ -1062,7 +1062,7 @@ block or wire statement. (Note this will slow down the executable by ~5%.)
|
||||||
Furthermore, the function name will be suffixed with the basename of the
|
Furthermore, the function name will be suffixed with the basename of the
|
||||||
Verilog module and line number the statement came from. This allows gprof
|
Verilog module and line number the statement came from. This allows gprof
|
||||||
or oprofile reports to be correlated with the original Verilog source
|
or oprofile reports to be correlated with the original Verilog source
|
||||||
statements.
|
statements. See also L<verilator_profcfunc>.
|
||||||
|
|
||||||
=item --private
|
=item --private
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,14 @@ sub profcfunc {
|
||||||
$funcs{$func}{sec} += $sec;
|
$funcs{$func}{sec} += $sec;
|
||||||
$funcs{$func}{calls} += $calls;
|
$funcs{$func}{calls} += $calls;
|
||||||
}
|
}
|
||||||
|
# Older gprofs have no call column for single-call functions
|
||||||
|
# %time cumesec selfsec {stuff} name
|
||||||
|
elsif ($line =~ /^\s*([0-9.]+)\s+[0-9.]+\s+([0-9.]+)\s+[^a-zA-Z_]*([a-zA-Z_].*)$/) {
|
||||||
|
my $pct=$1; my $sec=$2; my $calls=1; my $func=$3;
|
||||||
|
$funcs{$func}{pct} += $pct;
|
||||||
|
$funcs{$func}{sec} += $sec;
|
||||||
|
$funcs{$func}{calls} += $calls;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$fh->close;
|
$fh->close;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue