I am using perf in order to profile a C library. However, it does not produce %100 results because it rolls down the number to 0 under 0.00x. Since there are thousands of calls, it affects the overall result.
Does anybody know how to set precision ? ( I checked every argument on PERF-TRACE(1) gnu Linux web site but it does not exist)
Example of result for overall Children:
8.01% 0.11% baxter-wksp [kernel.kallsyms] [k] entry_SYSCALL_64_after_hwframe
7.80% 3.19% baxter-wksp [kernel.kallsyms] [k]
7.62% 0.00% baxter-wksp [unknown] [k] 0000000000000000
There are no tunable parameters that allow changing the precision of perf report
results.
Taking the latest kernel source code for reference, the overhead
values for "children" in the perf report output is being calculated here.
As you can see here,
case CCVAL_PERCENT:
default:
if (total)
percent = period * 100.0 / total;
return percent_color_fprintf(fp, "%.2f%%", percent);
}
The specification to print overhead percentages is fixed with 2 decimal digit precision after the decimal point. This requires modifying the kernel source code to allow any appropriate precision to display in the perf report
output.