diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-11-19 16:42:32 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-11-20 11:33:58 +0000 |
| commit | f56b4dcc82d7af38bf94d643c5750cf49a91a297 (patch) | |
| tree | 19b2ea6bfcbf61ab7287d420f39c45432bd9b4cc /executor/executor.cc | |
| parent | 7d02db5adbb376babbbd3199f8c530e468292727 (diff) | |
pkg/manager: show number of times coverage for each call has overflowed
If the overflows happen often, it's bad.
Add visibility into this.
Diffstat (limited to 'executor/executor.cc')
| -rw-r--r-- | executor/executor.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/executor/executor.cc b/executor/executor.cc index 5b5e06422..603f23f73 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -362,6 +362,8 @@ struct cover_t { // offset (VM_MIN_KERNEL_ADDRESS for AMD64) and then truncates the result to // uint32_t. We get this from the 'offset' member in ksancov_trace. intptr_t pc_offset; + // The coverage buffer has overflowed and we have truncated coverage. + bool overflow; }; struct thread_t { @@ -1177,6 +1179,7 @@ uint32 write_comparisons(flatbuffers::FlatBufferBuilder& fbb, cover_t* cov) kcov_comparison_t* cov_start = (kcov_comparison_t*)(cov->data + sizeof(uint64)); if ((char*)(cov_start + ncomps) > cov->data_end) failmsg("too many comparisons", "ncomps=%llu", ncomps); + cov->overflow = ((char*)(cov_start + ncomps + 1) > cov->data_end); rpc::ComparisonRaw* start = (rpc::ComparisonRaw*)cov_start; rpc::ComparisonRaw* end = start; // We will convert kcov_comparison_t to ComparisonRaw inplace. @@ -1295,6 +1298,8 @@ void write_output(int index, cover_t* cov, rpc::CallFlag flags, uint32 error, bo } rpc::CallInfoRawBuilder builder(*output_builder); + if (cov->overflow) + flags |= rpc::CallFlag::CoverageOverflow; builder.add_flags(flags); builder.add_error(error); if (signal_off) |
