diff --git a/bin/verilator b/bin/verilator index 7cbe723f9..901a9f0e3 100755 --- a/bin/verilator +++ b/bin/verilator @@ -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 Verilog module and line number the statement came from. This allows gprof or oprofile reports to be correlated with the original Verilog source -statements. +statements. See also L. =item --private diff --git a/bin/verilator_profcfunc b/bin/verilator_profcfunc index 808b36d7d..3856c2401 100755 --- a/bin/verilator_profcfunc +++ b/bin/verilator_profcfunc @@ -73,6 +73,14 @@ sub profcfunc { $funcs{$func}{sec} += $sec; $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;