<div dir="ltr">This looks like a mixed bag of stuff. The qemu cfg file could be by itself.<div><br></div><div>Two files (Jiri's email and details on writing an Explanations.txt) could go</div><div>in a (currently non-existent) document on running coverage.</div><div><br></div><div>The .css file is a support file for the output. </div><div><br></div><div>Not sure where the else fall but these seems like a handful of small patches</div><div>rather than one larger patch.</div><div><br></div><div>--joel</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 25, 2018 at 3:33 PM, Cillian O'Donnell <span dir="ltr"><<a href="mailto:cpodonnell8@gmail.com" target="_blank">cpodonnell8@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Co-author: Krzysztof Miesowicz <<a href="mailto:krzysztof.miesowicz@gmail.com">krzysztof.miesowicz@gmail.com</a><wbr>><br>
Co-author: Vijay Kumar Banerjee <<a href="mailto:vijaykumar9597@gmail.com">vijaykumar9597@gmail.com</a>><br>
---<br>
tester/rtems/testing/bsps/<wbr>leon3_qemu.ini | 52 ++++++<br>
tester/rtems/testing/coverage.<wbr>ini | 49 +++++<br>
tester/rtems/testing/coverage/<wbr>Categories.txt | 19 ++<br>
tester/rtems/testing/coverage/<wbr>Explanations.txt | 35 ++++<br>
.../coverage/SPARC-Annul-Slot-<wbr>Explanation.txt | 56 ++++++<br>
tester/rtems/testing/coverage/<wbr>style.css | 197 +++++++++++++++++++++<br>
tester/rtems/testing/coverage/<wbr>symbol_sets.cfg | 3 +<br>
tester/rtems/testing/qemu.cfg | 14 +-<br>
8 files changed, 424 insertions(+), 1 deletion(-)<br>
create mode 100644 tester/rtems/testing/bsps/<wbr>leon3_qemu.ini<br>
create mode 100644 tester/rtems/testing/coverage.<wbr>ini<br>
create mode 100644 tester/rtems/testing/coverage/<wbr>Categories.txt<br>
create mode 100644 tester/rtems/testing/coverage/<wbr>Explanations.txt<br>
create mode 100644 tester/rtems/testing/coverage/<wbr>SPARC-Annul-Slot-Explanation.<wbr>txt<br>
create mode 100644 tester/rtems/testing/coverage/<wbr>style.css<br>
create mode 100644 tester/rtems/testing/coverage/<wbr>symbol_sets.cfg<br>
<br>
diff --git a/tester/rtems/testing/bsps/<wbr>leon3_qemu.ini b/tester/rtems/testing/bsps/<wbr>leon3_qemu.ini<br>
new file mode 100644<br>
index 0000000..9888008<br>
--- /dev/null<br>
+++ b/tester/rtems/testing/bsps/<wbr>leon3_qemu.ini<br>
@@ -0,0 +1,52 @@<br>
+#<br>
+# RTEMS Tools Project (<a href="http://www.rtems.org/" rel="noreferrer" target="_blank">http://www.rtems.org/</a>)<br>
+# Copyright 2010-2014 Chris Johns (<a href="mailto:chrisj@rtems.org">chrisj@rtems.org</a>)<br>
+# All rights reserved.<br>
+#<br>
+# This file is part of the RTEMS Tools package in 'rtems-tools'.<br>
+#<br>
+# Redistribution and use in source and binary forms, with or without<br>
+# modification, are permitted provided that the following conditions are met:<br>
+#<br>
+# 1. Redistributions of source code must retain the above copyright notice,<br>
+# this list of conditions and the following disclaimer.<br>
+#<br>
+# 2. Redistributions in binary form must reproduce the above copyright notice,<br>
+# this list of conditions and the following disclaimer in the documentation<br>
+# and/or other materials provided with the distribution.<br>
+#<br>
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE<br>
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
+# POSSIBILITY OF SUCH DAMAGE.<br>
+#<br>
+<br>
+#<br>
+# The Leon 3 QEMU BSP<br>
+#<br>
+[global]<br>
+coverage_supported = 1<br>
+bsp = leon3_qemu<br>
+[leon3_qemu]<br>
+bsp = leon3_qemu<br>
+arch = sparc<br>
+tester = %{_rtscripts}/qemu.cfg<br>
+bsp_qemu_opts = %{qemu_opts_base} -M leon3_generic<br>
+<br>
+<br>
+[coverage]<br>
+format = QEMU<br>
+target = sparc-rtems5<br>
+explanations = %{_rtscripts}/coverage/<wbr>Explanations.txt<br>
+coverage_extension = .cov<br>
+gcnos_file = %{_rtscripts}/coverage/rtems.<wbr>gcnos<br>
+executable_extension = exe<br>
+project_name = RTEMS-5<br>
+report_format = html<br>
diff --git a/tester/rtems/testing/<wbr>coverage.ini b/tester/rtems/testing/<wbr>coverage.ini<br>
new file mode 100644<br>
index 0000000..c1eef2e<br>
--- /dev/null<br>
+++ b/tester/rtems/testing/<wbr>coverage.ini<br>
@@ -0,0 +1,49 @@<br>
+#<br>
+# RTEMS Tools Project (<a href="http://www.rtems.org/" rel="noreferrer" target="_blank">http://www.rtems.org/</a>)<br>
+# Copyright 2010-2014 Chris Johns (<a href="mailto:chrisj@rtems.org">chrisj@rtems.org</a>)<br>
+# All rights reserved.<br>
+#<br>
+# This file is part of the RTEMS Tools package in 'rtems-tools'.<br>
+#<br>
+# Redistribution and use in source and binary forms, with or without<br>
+# modification, are permitted provided that the following conditions are met:<br>
+#<br>
+# 1. Redistributions of source code must retain the above copyright notice,<br>
+# this list of conditions and the following disclaimer.<br>
+#<br>
+# 2. Redistributions in binary form must reproduce the above copyright notice,<br>
+# this list of conditions and the following disclaimer in the documentation<br>
+# and/or other materials provided with the distribution.<br>
+#<br>
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE<br>
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
+# POSSIBILITY OF SUCH DAMAGE.<br>
+#<br>
+<br>
+#<br>
+# All paths in defaults must be Unix format. Do not store any Windows format<br>
+# paths in the defaults.<br>
+#<br>
+# Every entry must describe the type of checking a host must pass.<br>
+#<br>
+# Records:<br>
+# key: type, attribute, value<br>
+# type : none, dir, exe, triplet<br>
+# attribute: none, required, optional<br>
+# value : 'single line', '''multi line'''<br>
+#<br>
+<br>
+#<br>
+# Global defaults<br>
+#<br>
+[global]<br>
+__covoar = covoar<br>
+_coverage = 1<br>
diff --git a/tester/rtems/testing/<wbr>coverage/Categories.txt b/tester/rtems/testing/<wbr>coverage/Categories.txt<br>
new file mode 100644<br>
index 0000000..e19a456<br>
--- /dev/null<br>
+++ b/tester/rtems/testing/<wbr>coverage/Categories.txt<br>
@@ -0,0 +1,19 @@<br>
+This is the list of Explanation Categories used when analyzing RTEMS<br>
+Coverage report. By using standard categories, the table filter on<br>
+the web site works better.<br>
+<br>
+Simple Test Case<br>
+<br>
+Hard Test Tase<br>
+<br>
+Uncalled Routine<br>
+<br>
+Interrupt Critical Section<br>
+<br>
+Simple Error Case<br>
+<br>
+Hard Error Case<br>
+<br>
+Allocation Error<br>
+<br>
+Bharath Suri<br>
diff --git a/tester/rtems/testing/<wbr>coverage/Explanations.txt b/tester/rtems/testing/<wbr>coverage/Explanations.txt<br>
new file mode 100644<br>
index 0000000..a5917f6<br>
--- /dev/null<br>
+++ b/tester/rtems/testing/<wbr>coverage/Explanations.txt<br>
@@ -0,0 +1,35 @@<br>
+schedulerpriorityyield.c:47<br>
+Simple Test Case<br>
+Branch Never Taken<br>
+New test where there is more than one thread at a priority with the<br>
+executing thread being non-preemptive. Create a higher priority thread<br>
+and then yield.<br>
+<br>
+ init task at priority 2, non-preemptive<br>
+ create task at priority 2<br>
+ create task at priority 1<br>
+ yield<br>
++++<br>
+<br>
+schedulerpriorityyield.c:51<br>
+Simple Test Case<br>
+Branch Always Taken<br>
+New test where only one thread at a priority (non-preemptive), create a<br>
+thread at higher priority, then yield.<br>
+<br>
+ init task at priority 2, non-preemptive<br>
+ create task at priority 1<br>
+ yield<br>
++++<br>
+<br>
+schedulerpriorityyield.c:52<br>
+Simple Test Case<br>
+Not Executed<br>
+Same test case as schedulerpriorityyield.c:51<br>
++++<br>
+<br>
+coremsg.c:86<br>
+Simple Test Case<br>
+We need to request enough messages of a certain size that the math<br>
+overflows to less than a single message.<br>
++++<br>
diff --git a/tester/rtems/testing/<wbr>coverage/SPARC-Annul-Slot-<wbr>Explanation.txt b/tester/rtems/testing/<wbr>coverage/SPARC-Annul-Slot-<wbr>Explanation.txt<br>
new file mode 100644<br>
index 0000000..ef740d3<br>
--- /dev/null<br>
+++ b/tester/rtems/testing/<wbr>coverage/SPARC-Annul-Slot-<wbr>Explanation.txt<br>
@@ -0,0 +1,56 @@<br>
+The SPARC assembly is often hard to understand because a single<br>
+instruction will show up as not executed. The instructions before<br>
+and after it will be marked as executed. The instruction before<br>
+the one not executed should be a "bxx,a" instruction which means<br>
+that the instruction following the branch instruction is executed<br>
+ONLY if the branch is taken. Otherwise it is "annulled" or skipped.<br>
+<br>
+So when you see these cases, it means the branch was NOT taken.<br>
+<br>
+=============================<wbr>==============================<wbr>========<br>
+Subject: <offlist> annul slot explanation<br>
+From: Jiri Gaisler <<a href="mailto:jiri@gaisler.com">jiri@gaisler.com</a>><br>
+Date: Wed, 3 Jun 2009 14:57:48 -0500<br>
+To: Joel Sherrill <Joel.Sherrill@OARcorp.com><br>
+<br>
+<br>
+Joel Sherrill wrote:<br>
+> > Hi,<br>
+> ><br>
+> > I am trying to look at more coverage cases and<br>
+> > wanted to make sure I am reading things correctly.<br>
+> ><br>
+> > The code in question is:<br>
+> ><br>
+> ><br>
+> > if ( the_thread->current_priority > interested_priority )<br>
+> > 200fd00: d8 00 e0 14 ld [ %g3 + 0x14 ], %o4<br>
+> > 200fd04: 80 a3 00 04 cmp %o4, %g4<br>
+> > 200fd08: 38 80 00 1c bgu,a 200fd78 <killinfo+0x224><br>
+> > 200fd0c: 98 10 00 04 mov %g4,<br>
+> > %o4 <== NOT EXECUTED<br>
+> ><br>
+> > /*<br>
+> > * If this thread is not interested, then go on to the next thread.<br>
+> > */<br>
+> ><br>
+> > api = the_thread->API_Extensions[ THREAD_API_POSIX ];<br>
+> > 200fd10: d4 00 e1 6c ld [ %g3 + 0x16c ], %o2<br>
+> ><br>
+> > Am I correct in interpreting this as meaning 0x200fd0c<br>
+> > is not executed because the bgu,a is never taken. And it<br>
+> > is not executed as part of falling through.<br>
+<br>
+Yes, this is correct. The branch delay slot is only executed<br>
+when the branch is taken.<br>
+<br>
+Jiri.<br>
+<br>
+> ><br>
+> > So in this case we need a test where the "if" condition<br>
+> > is true if I am reading things correctly.<br>
+> ><br>
+> > Thanks. There are a number of these 4 byte cases which<br>
+> > are probably easy to hit if I read the code correctly.<br>
+> ><br>
+> ><br>
diff --git a/tester/rtems/testing/<wbr>coverage/style.css b/tester/rtems/testing/<wbr>coverage/style.css<br>
new file mode 100644<br>
index 0000000..c715518<br>
--- /dev/null<br>
+++ b/tester/rtems/testing/<wbr>coverage/style.css<br>
@@ -0,0 +1,197 @@<br>
+body {<br>
+ background: rgb(253,253,253);<br>
+ color: rgb(0,0,0);<br>
+ font-family: helvetica, sans-serif;<br>
+ font-size: 1em;<br>
+ line-height: 1.4;<br>
+ margin: 5px, 5px, 5px, 5px;<br>
+ padding: 0;<br>
+}<br>
+<br>
+a:link {<br>
+ color: rgb(180, 50, 50);<br>
+ font-family: helvetica, sans-serif;<br>
+ font-size: 1.0em;<br>
+}<br>
+<br>
+a:visited {<br>
+ color: purple;<br>
+ font-family: helvetica, sans-serif;<br>
+ font-size: 1.0em;<br>
+}<br>
+<br>
+a:hover {<br>
+ color: rgb(0, 0, 0);<br>
+ font-family: helvetica, sans-serif;<br>
+ font-size: 1.0em;<br>
+}<br>
+<br>
+a:active {<br>
+ color: red;<br>
+ font-family: helvetica, sans-serif;<br>
+ font-size: 1.0em;<br>
+}<br>
+<br>
+.heading {<br>
+ background: rgb(250,250,250);<br>
+ background-image: url("<a href="http://www.rtems.org/logos/rtems_logo.jpg" rel="noreferrer" target="_blank">http://www.rtems.org/<wbr>logos/rtems_logo.jpg</a>");<br>
+ background-repeat: no-repeat;<br>
+ color: rgb(55,55,55);<br>
+ font-size: 1.5em;<br>
+ height: 140px;<br>
+ padding-top: 20px;<br>
+ padding-left: 300px;<br>
+}<br>
+<br>
+.heading-title {<br>
+ text-align: center;<br>
+ color: rgb(0,0,0);<br>
+ font-size: 0.9em;<br>
+ font-weight: bold;<br>
+ padding-top: 5px;<br>
+ padding-left: 0px;<br>
+ text-align: center;<br>
+ width: 100%;<br>
+}<br>
+<br>
+.datetime {<br>
+ color: rgb(55,55,55);<br>
+ font-size: 0.8em;<br>
+ padding-top: 5px;<br>
+ padding-left: 0px;<br>
+ text-align: center;<br>
+ width: 100%;<br>
+}<br>
+<br>
+.info {<br>
+ color: rgb(55,55,55);<br>
+ font-size: 0.6em;<br>
+ padding-top: 5px;<br>
+ padding-left: 00px;<br>
+ text-align: center;<br>
+ width: 100%;<br>
+}<br>
+<br>
+.stats-table {<br>
+ background: rgb(225,225,225);<br>
+ font-size: 0.9em;<br>
+ border: 1px solid rgb(200, 200, 200);<br>
+ padding: 0;<br>
+ margin-top: 3px;<br>
+ margin-left: 10px;<br>
+ width: 70%;<br>
+}<br>
+<br>
+.stats-table-target {<br>
+ background: rgb(243,243,243);<br>
+ font-size: 1.2em;<br>
+ padding-left: 10px;<br>
+ text-align: left;<br>
+}<br>
+<br>
+.stats-target-results {<br>
+ background: rgb(243,243,243);<br>
+ font-size: 0.9em;<br>
+ text-align: right;<br>
+ padding-right: 10px;<br>
+}<br>
+<br>
+.stats-target-good {<br>
+ background: rgb(30,230,30);<br>
+ font-size: 0.9em;<br>
+ text-align: right;<br>
+ padding-right: 10px;<br>
+}<br>
+<br>
+.stats-target-good {<br>
+ background: rgb(50,180,50);<br>
+ color: rgb(230,230,230);<br>
+ font-size: 0.9em;<br>
+ text-align: center;<br>
+ padding-right: 10px;<br>
+}<br>
+<br>
+.stats-target-bad {<br>
+ background: rgb(180,50,50);<br>
+ color: rgb(230,230,230);<br>
+ font-size: 0.9em;<br>
+ text-align: center;<br>
+ padding-right: 10px;<br>
+}<br>
+<br>
+.stats-table-top {<br>
+ background: rgb(243,243,243);<br>
+ color: rgb(0,0,0);<br>
+ font-size: 0.9em;<br>
+ padding-left: 2px;<br>
+}<br>
+<br>
+.stats-table-row {<br>
+ background: rgb(253,253,253);<br>
+ font-size: 0.9em;<br>
+ padding: 1px;<br>
+ text-align: right;<br>
+}<br>
+<br>
+.error-table {<br>
+ font-size: 0.9em;<br>
+ border: 1px solid rgb(200, 200, 200);<br>
+ padding: 0;<br>
+ margin-left: 10px;<br>
+ width: 96%;<br>
+}<br>
+<br>
+.error-table-top {<br>
+ background: rgb(225,225,225);<br>
+ color: rgb(0,0,0);<br>
+ font-size: 0.9em;<br>
+ padding-left: 2px;<br>
+}<br>
+<br>
+.error-table-on {<br>
+ background: rgb(225,225,225);<br>
+ font-size: 0.9em;<br>
+ padding-left: 2px;<br>
+}<br>
+<br>
+.error-table-off {<br>
+ background: rgb(253,253,253);<br>
+ font-size: 0.9em;<br>
+ padding-left: 2px;<br>
+}<br>
+<br>
+.error-table-dups {<br>
+ text-align: right;<br>
+ padding-right: 2px;<br>
+}<br>
+<br>
+.error-table-error {<br>
+ background: rgb(255,150,150);<br>
+ font-size: 0.9em;<br>
+ padding-left: 2px;<br>
+}<br>
+<br>
+.error-table-warning {<br>
+ font-size: 0.9em;<br>
+ padding-left: 2px;<br>
+}<br>
+<br>
+.navbar {<br>
+ margin-left: auto;<br>
+ margin-right: auto;<br>
+ margin-top: 10px;<br>
+ width: 40%;<br>
+}<br>
+th.table-sortable {<br>
+ background-image:url("<wbr>unsorted.gif");<br>
+ cursor: pointer;<br>
+ background-position: center left;<br>
+ background-repeat: no-repeat;<br>
+ padding-left: 15px;<br>
+}<br>
+th.table-sorted-asc {<br>
+ background-image:url("<wbr>descending.gif");<br>
+}<br>
+th.table-sorted-desc {<br>
+ background-image:url("<wbr>ascending.gif");<br>
+}<br>
\ No newline at end of file<br>
diff --git a/tester/rtems/testing/<wbr>coverage/symbol_sets.cfg b/tester/rtems/testing/<wbr>coverage/symbol_sets.cfg<br>
new file mode 100644<br>
index 0000000..7f62cce<br>
--- /dev/null<br>
+++ b/tester/rtems/testing/<wbr>coverage/symbol_sets.cfg<br>
@@ -0,0 +1,3 @@<br>
+symbolset:<br>
+ name=score<br>
+ lib=sparc-rtems5/c/leon3/<wbr>cpukit/score/libscore.a<br>
diff --git a/tester/rtems/testing/qemu.<wbr>cfg b/tester/rtems/testing/qemu.<wbr>cfg<br>
index db5b6b2..7a65ddd 100644<br>
--- a/tester/rtems/testing/qemu.<wbr>cfg<br>
+++ b/tester/rtems/testing/qemu.<wbr>cfg<br>
@@ -64,6 +64,18 @@<br>
%define qemu_opts %{bsp_qemu_opts}<br>
<br>
#<br>
+# Coverage analysis<br>
+#<br>
+%define coverage_arg %{nil}<br>
+%if %{defined _coverage}<br>
+ %if %{coverage_supported}<br>
+ %define coverage_arg -exec-trace %{test_executable}.cov<br>
+ %else<br>
+ %error "Coverage analysis unsupported for %{bsp}"<br>
+ %endif<br>
+%endif<br>
+<br>
+#<br>
# Executable<br>
#<br>
-%execute %{qemu_cmd} %{qemu_opts} -kernel %{test_executable}<br>
+%execute %{qemu_cmd} %{qemu_opts} -kernel %{test_executable} %{coverage_arg}<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
</font></span></blockquote></div><br></div></div>