[PATCH] covoar/Target_aarch64: Swap QEMU taken/not taken bits
Joel Sherrill
joel at rtems.org
Fri Apr 16 19:42:19 UTC 2021
On Fri, Apr 16, 2021 at 2:33 PM Gedare Bloom <gedare at rtems.org> wrote:
> why this is needed?
>
Bizarrely, qemu-couverture does not consistently set the same bit in the
traces
for taken and not taken across architectures.
https://git.rtems.org/rtems-tools/tree/tester/covoar/qemu-traces.h#n93
/* _BLOCK means pc .. pc+size-1 was executed. */
#define TRACE_OP_BLOCK 0x10 /* Block fully executed. */
#define TRACE_OP_FAULT 0x20 /* Fault at pc. */
#define TRACE_OP_BR0 0x01 /* Branch 0 taken at pc. */
#define TRACE_OP_BR1 0x02
Some architectures have BR0 meaning taken, others are not taken.
There has been code dealing with this since the initial move
from my rtems-testing to rtems-tools. But honestly I don't
recall anything about the difference. This means it has been
this way in Couverture for at least 7 years.
I have asked Alex to file this as an issue/question with
Couverture on github. Along with a clear bug on SPARC where
some code is missed because we do system calls to disable
interrupts and other actions. They don't seem to report those
in the traces.
--joel
> On Fri, Apr 16, 2021 at 1:25 PM Alex White <alex.white at oarcorp.com> wrote:
> >
> > This overrides the `TargetBase` behavior to allow branches to be marked
> > correctly as either taken or not taken.
> >
> > Closes #4387
> > ---
> > tester/covoar/Target_aarch64.cc | 11 +++++++++++
> > tester/covoar/Target_aarch64.h | 6 ++++++
> > 2 files changed, 17 insertions(+)
> >
> > diff --git a/tester/covoar/Target_aarch64.cc
> b/tester/covoar/Target_aarch64.cc
> > index 64472d6..4d16456 100644
> > --- a/tester/covoar/Target_aarch64.cc
> > +++ b/tester/covoar/Target_aarch64.cc
> > @@ -12,6 +12,7 @@
> >
> > #include <rld.h>
> >
> > +#include "qemu-traces.h"
> > #include "Target_aarch64.h"
> >
> > namespace Target {
> > @@ -90,6 +91,16 @@ namespace Target {
> > );
> > }
> >
> > + uint8_t Target_aarch64::qemuTakenBit()
> > + {
> > + return TRACE_OP_BR1;
> > + }
> > +
> > + uint8_t Target_aarch64::qemuNotTakenBit()
> > + {
> > + return TRACE_OP_BR0;
> > + }
> > +
> > TargetBase *Target_aarch64_Constructor(
> > std::string targetName
> > )
> > diff --git a/tester/covoar/Target_aarch64.h
> b/tester/covoar/Target_aarch64.h
> > index 26fedb6..08bd1fb 100644
> > --- a/tester/covoar/Target_aarch64.h
> > +++ b/tester/covoar/Target_aarch64.h
> > @@ -54,6 +54,12 @@ namespace Target {
> > const char* const instruction
> > );
> >
> > + /* Documentation inherited from base class */
> > + uint8_t qemuTakenBit() override;
> > +
> > + /* Documentation inherited from base class */
> > + uint8_t qemuNotTakenBit() override;
> > +
> > private:
> >
> > };
> > --
> > 2.27.0
> >
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210416/1c21f38e/attachment.html>
More information about the devel
mailing list