You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then, when capture_coverage gets the address of the counters, it gets NULL because CountersFirst is NULL, so it cannot collect the coverage counters.
In fact, the expected platform should be InstrProfilingPlatformLinux.c. I tried to remove the #if in InstrProfilingPlatformLinux.c (make it use Linux platform instead of Other), then minicov could collect the counters and dump the correct coverage data.
The text was updated successfully, but these errors were encountered:
You need to execute static initializers to register counters at startup. This is normally done by libc but on -none targets you need to do this manually yourself.
And I also look into what InstrProfilingLoweringPass does in my example: https://www.diffchecker.com/07GpyZjq/ . It seems that no initializers are generated in this pass?
Reproduce
src/main.rs
:Cargo.toml
:Run:
And
0x80
is (seemingly) barely the size of the.profraw
header, and does not contain any coverage data.Possible Cause
On
x86_64-unknown-none
target,minicov
is compiled withInstrProfilingPlatformOther.c
because none of these is hit:minicov/minicov/c/InstrProfilingPlatformLinux.c
Lines 9 to 11 in 31ed26c
Then, when
capture_coverage
gets the address of the counters, it getsNULL
becauseCountersFirst
isNULL
, so it cannot collect the coverage counters.In fact, the expected platform should be
InstrProfilingPlatformLinux.c
. I tried to remove the#if
inInstrProfilingPlatformLinux.c
(make it useLinux
platform instead ofOther
), thenminicov
could collect the counters and dump the correct coverage data.The text was updated successfully, but these errors were encountered: