DynamoRIO / dynamorio

Dynamic Instrumentation Tool Platform
Other
2.57k stars 552 forks source link

Reflect line executions count in drcov2lcov output #6677

Open mkravchik opened 4 months ago

mkravchik commented 4 months ago

Currently, drcov2lcov does not reflect how many times each line was executed in coverage.info it produces. Just 1 or zero. For real lcov files we get the execution counter for each line.

Is there any reason for such implementation? Would you consider fixing this?

derekbruening commented 4 months ago

Determining whether a line was executed is easily gathered with almost zero overhead beyond DR's base overhead, as you can imagine from how DR operates: that requires only transformation-time actions (If you are not familiar with transformation time versus execution time, please see http://dynamorio.org/API_BT.html#sec_control_points). Adding counts adds non-negligible overhead as it requires execution-time actions.

If you would like to add counts, that makes sense as an optional feature controlled by a runtime option so those who do not need it do not pay the overhead cost. We would be happy to consult on how to do that and to review pull requests.