diff options
| author | Alexander Egorenkov <eaibmz@gmail.com> | 2024-06-12 11:06:56 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-06-12 09:29:39 +0000 |
| commit | f815599d9539b0606408a912fe53e2e80bbc4629 (patch) | |
| tree | 153a1de352ea89d819b96c02b08278d29baca354 /executor/executor.cc | |
| parent | 4c9fd6c10277084e471b7c3d9902cefa483448c8 (diff) | |
executor: fix extraction of number of KCOV comparisons from coverage data
KCOV stores the number of KCOV comparisons in a coverage buffer always
as a 64-bit integer at offset 0 of the coverage buffer. Don't use
the field size of the coverage object which is initialized
in cover_collect() and size of which depends on kernel bitness because
this field is intended only for KCOV PC coverage and not for
KCOV comparisons.
Signed-off-by: Alexander Egorenkov <eaibmz@gmail.com>
Diffstat (limited to 'executor/executor.cc')
| -rw-r--r-- | executor/executor.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/executor/executor.cc b/executor/executor.cc index c2c361ccf..0d08f562b 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -1117,11 +1117,11 @@ void write_call_output(thread_t* th, bool finished) if (flag_comparisons) { // Collect only the comparisons - uint32 ncomps = th->cov.size; + uint64 ncomps = *(uint64_t*)th->cov.data; kcov_comparison_t* start = (kcov_comparison_t*)(th->cov.data + sizeof(uint64)); kcov_comparison_t* end = start + ncomps; if ((char*)end > th->cov.data_end) - failmsg("too many comparisons", "ncomps=%u", ncomps); + failmsg("too many comparisons", "ncomps=%llu", ncomps); cover_unprotect(&th->cov); std::sort(start, end); ncomps = std::unique(start, end) - start; @@ -1141,7 +1141,7 @@ void write_call_output(thread_t* th, bool finished) else write_coverage_signal<uint32>(&th->cov, signal_count_pos, cover_count_pos); } - debug_verbose("out #%u: index=%u num=%u errno=%d finished=%d blocked=%d sig=%u cover=%u comps=%u\n", + debug_verbose("out #%u: index=%u num=%u errno=%d finished=%d blocked=%d sig=%u cover=%u comps=%llu\n", completed, th->call_index, th->call_num, reserrno, finished, blocked, *signal_count_pos, *cover_count_pos, *comps_count_pos); completed++; |
