<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 16, 2021 at 2:33 PM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">why this is needed?<br></blockquote><div><br></div><div>Bizarrely, qemu-couverture does not consistently set the same bit in the traces</div><div>for taken and not taken across architectures. </div><div><br></div><div><a href="https://git.rtems.org/rtems-tools/tree/tester/covoar/qemu-traces.h#n93">https://git.rtems.org/rtems-tools/tree/tester/covoar/qemu-traces.h#n93</a><br><br><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>/* _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</code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code><br></code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>Some architectures have BR0 meaning taken, others are not taken.</code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code><br></code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>There has been code dealing with this since the initial move</code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>from my rtems-testing to rtems-tools. But honestly I don't </code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>recall anything about the difference. This means it has been </code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>this way in Couverture for at least 7 years.</code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code><br></code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>I have asked Alex to file this as an issue/question with</code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>Couverture on github. Along with a clear bug on SPARC where</code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>some code is missed because we do system calls to disable</code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>interrupts and other actions. They don't seem to report those</code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>in the traces.</code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code><br></code></pre><pre style="padding:0px;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);font-size:13.3333px"><code>--joel</code></pre></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
On Fri, Apr 16, 2021 at 1:25 PM Alex White <<a href="mailto:alex.white@oarcorp.com" target="_blank">alex.white@oarcorp.com</a>> wrote:<br>
><br>
> This overrides the `TargetBase` behavior to allow branches to be marked<br>
> correctly as either taken or not taken.<br>
><br>
> Closes #4387<br>
> ---<br>
> tester/covoar/Target_aarch64.cc | 11 +++++++++++<br>
> tester/covoar/Target_aarch64.h | 6 ++++++<br>
> 2 files changed, 17 insertions(+)<br>
><br>
> diff --git a/tester/covoar/Target_aarch64.cc b/tester/covoar/Target_aarch64.cc<br>
> index 64472d6..4d16456 100644<br>
> --- a/tester/covoar/Target_aarch64.cc<br>
> +++ b/tester/covoar/Target_aarch64.cc<br>
> @@ -12,6 +12,7 @@<br>
><br>
> #include <rld.h><br>
><br>
> +#include "qemu-traces.h"<br>
> #include "Target_aarch64.h"<br>
><br>
> namespace Target {<br>
> @@ -90,6 +91,16 @@ namespace Target {<br>
> );<br>
> }<br>
><br>
> + uint8_t Target_aarch64::qemuTakenBit()<br>
> + {<br>
> + return TRACE_OP_BR1;<br>
> + }<br>
> +<br>
> + uint8_t Target_aarch64::qemuNotTakenBit()<br>
> + {<br>
> + return TRACE_OP_BR0;<br>
> + }<br>
> +<br>
> TargetBase *Target_aarch64_Constructor(<br>
> std::string targetName<br>
> )<br>
> diff --git a/tester/covoar/Target_aarch64.h b/tester/covoar/Target_aarch64.h<br>
> index 26fedb6..08bd1fb 100644<br>
> --- a/tester/covoar/Target_aarch64.h<br>
> +++ b/tester/covoar/Target_aarch64.h<br>
> @@ -54,6 +54,12 @@ namespace Target {<br>
> const char* const instruction<br>
> );<br>
><br>
> + /* Documentation inherited from base class */<br>
> + uint8_t qemuTakenBit() override;<br>
> +<br>
> + /* Documentation inherited from base class */<br>
> + uint8_t qemuNotTakenBit() override;<br>
> +<br>
> private:<br>
><br>
> };<br>
> --<br>
> 2.27.0<br>
><br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>