<div dir="ltr"><div><div><div><div><div>Hi Sebastian,<br><br></div>Okay. I will clarify it.<br><br></div>I used git format-patch -1 to generate the patch and git send-email --to <a href="mailto:devel@rtems.org">devel@rtems.org</a> *.patch to send out the mail.<br></div>Could you tell me what I have missed?<br><br></div><div>Aha, it is 2017...<br></div><div><br></div>Best,<br></div>Kuan-hsun<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-25 15:10 GMT+01:00 Sebastian Huber <span dir="ltr"><<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Please use the standard Git commit message format.<div><div class="h5"><br>
<br>
On 25/01/17 15:04, Kuan-Hsun Chen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
sptests/sp69: Revise<br>
Add in the verification of the postponed job count for rtems_rate_monotonic_get_statu<wbr>s().<br>
---<br>
cpukit/rtems/include/rtems/rte<wbr>ms/ratemon.h | 24 +++++-------------------<br>
cpukit/rtems/src/ratemongetsta<wbr>tus.c | 2 ++<br>
cpukit/rtems/src/ratemonperiod<wbr>.c | 14 --------------<br>
testsuites/sptests/sp69/init.<wbr>c | 8 ++++++++<br>
testsuites/sptests/sp69/sp69.d<wbr>oc | 2 ++<br>
testsuites/sptests/sp69/sp69.s<wbr>cn | 5 +++--<br>
6 files changed, 20 insertions(+), 35 deletions(-)<br>
<br>
diff --git a/cpukit/rtems/include/rtems/r<wbr>tems/ratemon.h b/cpukit/rtems/include/rtems/r<wbr>tems/ratemon.h<br>
index 54ddd05..59512c5 100644<br>
--- a/cpukit/rtems/include/rtems/r<wbr>tems/ratemon.h<br>
+++ b/cpukit/rtems/include/rtems/r<wbr>tems/ratemon.h<br>
@@ -182,6 +182,11 @@ typedef struct {<br>
* then this field has no meaning.<br>
*/<br>
rtems_thread_cpu_usage_t executed_since_last_period;<br>
+<br>
+ /** This is the number of postponed jobs. This number<br>
+ * is only increased by the corresponding watchdog,<br>
+ * and is decreased by RMS manager with the postponed job releasing. */<br>
+ uint32_t postponed_jobs_count;<br>
} rtems_rate_monotonic_period_st<wbr>atus;<br>
</blockquote>
<br></div></div>
Number in comment vs. count in member. I prefer count. Please clarify this a bit and avoid the watchdog. The watchdog is an implementation detail. The mentioning of RMS manager is redundant.<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
/**<br>
@@ -417,25 +422,6 @@ rtems_status_code rtems_rate_monotonic_period(<br>
rtems_interval length<br>
);<br>
-/**<br>
- * @brief Return the number of postponed jobs<br>
- *<br>
- * This is a helper function for runtime monitoring to return<br>
- * the number of postponed jobs in this given period. This number<br>
- * is only increased by the corresponding watchdog,<br>
- * and is decreased by RMS manager with the postponed job releasing.<br>
- *<br>
- * @param[in] id is the period id<br>
- *<br>
- * @retval This helper function returns the number of postponed<br>
- * jobs with a given period_id.<br>
- *<br>
- */<br>
-uint32_t rtems_rate_monotonic_postponed<wbr>_job_count(<br>
- rtems_id period_id<br>
-);<br>
-<br>
-<br>
/**@}*/<br>
#ifdef __cplusplus<br>
diff --git a/cpukit/rtems/src/ratemongets<wbr>tatus.c b/cpukit/rtems/src/ratemongets<wbr>tatus.c<br>
index 403c6ed..8bd3613 100644<br>
--- a/cpukit/rtems/src/ratemongets<wbr>tatus.c<br>
+++ b/cpukit/rtems/src/ratemongets<wbr>tatus.c<br>
@@ -9,6 +9,7 @@<br>
* COPYRIGHT (c) 1989-2009.<br>
* On-Line Applications Research Corporation (OAR).<br>
* Copyright (c) 2016 embedded brains GmbH.<br>
+ * Copyright (c) 2016 Kuan-Hsun Chen.<br>
</blockquote>
<br></div></div>
We have 2017.<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
*<br>
* The license and distribution terms for this file may be<br>
* found in the file LICENSE in this distribution or at<br>
@@ -43,6 +44,7 @@ rtems_status_code rtems_rate_monotonic_get_statu<wbr>s(<br>
period_status->owner = the_period->owner->Object.id;<br>
period_status->state = the_period->state;<br>
+ period_status->postponed_jobs_<wbr>count = the_period->postponed_jobs;<br>
if ( the_period->state == RATE_MONOTONIC_INACTIVE ) {<br>
/*<br>
diff --git a/cpukit/rtems/src/ratemonperi<wbr>od.c b/cpukit/rtems/src/ratemonperi<wbr>od.c<br>
index 97547e2..efcd121 100644<br>
--- a/cpukit/rtems/src/ratemonperi<wbr>od.c<br>
+++ b/cpukit/rtems/src/ratemonperi<wbr>od.c<br>
@@ -302,20 +302,6 @@ static rtems_status_code _Rate_monotonic_Block_while_ex<wbr>pired(<br>
return RTEMS_TIMEOUT;<br>
}<br>
-uint32_t rtems_rate_monotonic_postponed<wbr>_job_count( rtems_id period_id )<br>
-{<br>
- Rate_monotonic_Control *the_period;<br>
- ISR_lock_Context lock_context;<br>
- uint32_t jobs;<br>
-<br>
- the_period = _Rate_monotonic_Get( period_id, &lock_context );<br>
- _Assert( the_period != NULL );<br>
-<br>
- jobs = the_period->postponed_jobs;<br>
- _Rate_monotonic_Release( the_period, &lock_context );<br>
- return jobs;<br>
-}<br>
-<br>
rtems_status_code rtems_rate_monotonic_period(<br>
rtems_id id,<br>
rtems_interval length<br>
diff --git a/testsuites/sptests/sp69/init<wbr>.c b/testsuites/sptests/sp69/init<wbr>.c<br>
index ac6f58c..c38beb8 100644<br>
--- a/testsuites/sptests/sp69/init<wbr>.c<br>
+++ b/testsuites/sptests/sp69/init<wbr>.c<br>
</blockquote>
<br></div></div>
Missing copyright?<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
@@ -162,6 +162,14 @@ rtems_task Init(<br>
rtems_test_assert( statistics.missed_count == i );<br>
}<br>
+<br>
+ /* Check the status */<br>
+ status = rtems_rate_monotonic_get_statu<wbr>s( period_id, &period_status );<br>
+ directive_failed( status, "rate_monotonic_get_status" );<br>
+ puts(<br>
+ "rtems_rate_monotonic_get_stat<wbr>us - verify value of a postponed jobs count"<br>
+ );<br>
+ rtems_test_assert( period_status.postponed_jobs_c<wbr>ount == 3 );<br>
TEST_END();<br>
diff --git a/testsuites/sptests/sp69/sp69<wbr>.doc b/testsuites/sptests/sp69/sp69<wbr>.doc<br>
index fbf0e4e..e881a19 100644<br>
--- a/testsuites/sptests/sp69/sp69<wbr>.doc<br>
+++ b/testsuites/sptests/sp69/sp69<wbr>.doc<br>
@@ -1,5 +1,6 @@<br>
# COPYRIGHT (c) 1989-2009.<br>
# On-Line Applications Research Corporation (OAR).<br>
+# COPYRIGHT (c) Kuan-Hsun Chen.<br>
</blockquote>
<br></span>
Missing year.<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
#<br>
# The license and distribution terms for this file may be<br>
# found in the file LICENSE in this distribution or at<br>
@@ -21,3 +22,4 @@ concepts:<br>
a period is initiated.<br>
+ Verify the correctness of the status values returned on an active period.<br>
+ Ensure the missed period count is properly maintained.<br>
++ Verify the correctness of the postponed job count.<br>
diff --git a/testsuites/sptests/sp69/sp69<wbr>.scn b/testsuites/sptests/sp69/sp69<wbr>.scn<br>
index 654eea0..e102d22 100644<br>
--- a/testsuites/sptests/sp69/sp69<wbr>.scn<br>
+++ b/testsuites/sptests/sp69/sp69<wbr>.scn<br>
@@ -2,8 +2,9 @@<br>
rtems_rate_monotonic_get_statu<wbr>s - verify values of an inactive period<br>
rtems_rate_monotonic_get_statu<wbr>s - check RTEMS_NOT_DEFINED<br>
rtems_rate_monotonic_get_statu<wbr>s - verify values of an active period<br>
-wall time should be ~600000000 is 609216000<br>
-cpu time should be ~100000000 is 109217000<br>
+wall time should be ~600000000 is 609402399<br>
+cpu time should be ~100000000 is 109612659<br>
rtems_rate_monotonic_cancel - OK<br>
Testing statistics on missed periods<br>
+rtems_rate_monotonic_get_stat<wbr>us - verify value of a postponed jobs count<br>
*** END OF TEST 69 ***<br>
</blockquote>
<br>
-- <br></div></div>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone : <a href="tel:%2B49%2089%20189%2047%2041-16" value="+4989189474116" target="_blank">+49 89 189 47 41-16</a><br>
Fax : <a href="tel:%2B49%2089%20189%2047%2041-09" value="+4989189474109" target="_blank">+49 89 189 47 41-09</a><br>
E-Mail : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brain<wbr>s.de</a><br>
PGP : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
<br>
</blockquote></div><br></div>