<div dir="ltr"><div>Hi,<br><br></div>I will update the document for this ticket together with #2795 ticket.<br><ol><li>Further reading will be changed to references.</li><li>The description of rtems_rate_monotonic_get_status() and related structure will be updated.<br></li><li>The potential overflow problem of #2795 will be mentioned.</li><li>Test sp78 will be prepared for testing the potential overflow.</li><li>The mentioned papers in #2795 will be added into references as well.</li></ol>Please let me know if I miss anything for these two tickets.<br><br>Best,<br>Kuan-Hsun</div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-25 17:56 GMT+01:00 Kuan Hsun Chen <span dir="ltr"><<a href="mailto:c0066c@gmail.com" target="_blank">c0066c@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="m_7899520165952034652gmail-im">This is the patch for #2885 ticket.<br></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-01-25 16:18 GMT+01:00 Kuan-Hsun Chen <span dir="ltr"><<a href="mailto:c0066c@gmail.com" target="_blank">c0066c@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Add a variable named "count" in rtems_rate_monotonic_period_st<wbr>atus structure<br>
Revise rtems_rate_monotonic_get_statu<wbr>s() for the postponed job count.<br>
<br>
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/rt<wbr>ems/ratemon.h | 24 ++++--------------------<br>
cpukit/rtems/src/ratemongetst<wbr>atus.c | 2 ++<br>
cpukit/rtems/src/ratemonperio<wbr>d.c | 16 +---------------<br>
testsuites/sptests/sp69/init.<wbr>c | 8 ++++++++<br>
testsuites/sptests/sp69/sp69.<wbr>doc | 2 ++<br>
testsuites/sptests/sp69/sp69.<wbr>scn | 5 +++--<br>
6 files changed, 20 insertions(+), 37 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..5616ee9 100644<br>
--- a/cpukit/rtems/include/rtems/r<wbr>tems/ratemon.h<br>
+++ b/cpukit/rtems/include/rtems/r<wbr>tems/ratemon.h<br>
@@ -23,7 +23,7 @@<br>
<br>
/* COPYRIGHT (c) 1989-2009, 2016.<br>
* On-Line Applications Research Corporation (OAR).<br>
- * COPYRIGHT (c) 2016 Kuan-Hsun Chen.<br>
+ * COPYRIGHT (c) 2016-2017 Kuan-Hsun Chen.<br>
*<br>
* The license and distribution terms for this file may be<br>
* found in the file LICENSE in this distribution or at<br>
@@ -182,6 +182,9 @@ 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 count of postponed jobs of this period. */<br>
+ uint32_t postponed_jobs_count;<br>
} rtems_rate_monotonic_period_st<wbr>atus;<br>
<br>
/**<br>
@@ -417,25 +420,6 @@ rtems_status_code rtems_rate_monotonic_period(<br>
rtems_interval length<br>
);<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>
<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..4e6b964 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) 2017 Kuan-Hsun Chen.<br>
*<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>
<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>
<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..5b5d1dc 100644<br>
--- a/cpukit/rtems/src/ratemonperi<wbr>od.c<br>
+++ b/cpukit/rtems/src/ratemonperi<wbr>od.c<br>
@@ -9,7 +9,7 @@<br>
* COPYRIGHT (c) 1989-2010.<br>
* On-Line Applications Research Corporation (OAR).<br>
* Copyright (c) 2016 embedded brains GmbH.<br>
- * COPYRIGHT (c) 2016 Kuan-Hsun Chen.<br>
+ * COPYRIGHT (c) 2016-2017 Kuan-Hsun Chen.<br>
*<br>
* The license and distribution terms for this file may be<br>
* found in the file LICENSE in this distribution or at<br>
@@ -302,20 +302,6 @@ static rtems_status_code _Rate_monotonic_Block_while_ex<wbr>pired(<br>
return RTEMS_TIMEOUT;<br>
}<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>
@@ -162,6 +162,14 @@ rtems_task Init(<br>
<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>
<br>
TEST_END();<br>
<br>
diff --git a/testsuites/sptests/sp69/sp69<wbr>.doc b/testsuites/sptests/sp69/sp69<wbr>.doc<br>
index fbf0e4e..60aacb8 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) 2017 Kuan-Hsun Chen.<br>
#<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_stat<wbr>us - verify values of an inactive period<br>
rtems_rate_monotonic_get_stat<wbr>us - check RTEMS_NOT_DEFINED<br>
rtems_rate_monotonic_get_stat<wbr>us - 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>
<span class="m_7899520165952034652HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>