Re: [PATCHv3] Introduced new tracing mode KCOV_MODE_UNIQUE.

From: Andrey Konovalov
Date: Sat Apr 17 2021 - 15:46:36 EST


On Fri, Apr 16, 2021 at 10:42 AM Dmitry Vyukov <dvyukov@xxxxxxxxxx> wrote:
>
> On Sat, Mar 27, 2021 at 3:56 PM Andrey Konovalov <andreyknvl@xxxxxxxxx> wrote:
> >
> > On Fri, Mar 26, 2021 at 9:52 PM Alexander Lochmann
> > <info@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > >
> >
> > Hi Alexander,
> >
> > > It simply stores the executed PCs.
> > > The execution order is discarded.
> > > Each bit in the shared buffer represents every fourth
> > > byte of the text segment.
> > > Since a call instruction on every supported
> > > architecture is at least four bytes, it is safe
> > > to just store every fourth byte of the text segment.
> >
> > What about jumps?
>
> KCOV adds call __sanitizer_cov_trace_pc per coverage point. So besides
> the instructions in the original code, we also always have this call.

Ah, I see. This should be explained in the changelog.

This means that a KCOV user will need the kernel binary to recover the
actual PCs that were covered, as the information about the lower two
bits is lost, right? This needs to be explained as well.

Thanks!