<div dir="ltr"><div><div><div>Hi Gedare,<br><br></div>Thanks a lot. <br>I should read all the documents again...<br><br></div>Best,<br></div>Kuan-Hsun<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-25 17:16 GMT+01:00 Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Jan 25, 2017 at 9:16 AM, Kuan Hsun Chen <<a href="mailto:c0066c@gmail.com">c0066c@gmail.com</a>> wrote:<br>
> Hi Sebastian,<br>
><br>
> Okay. I will clarify it.<br>
><br>
> I used git format-patch -1 to generate the patch and git send-email --to<br>
> <a href="mailto:devel@rtems.org">devel@rtems.org</a> *.patch to send out the mail.<br>
> Could you tell me what I have missed?<br>
><br>
</span><a href="https://devel.rtems.org/wiki/Developer/Git#GitCommits" rel="noreferrer" target="_blank">https://devel.rtems.org/wiki/<wbr>Developer/Git#GitCommits</a><br>
<br>
This should likely be linked to / added in the<br>
<a href="https://devel.rtems.org/wiki/Developer/Coding/Conventions" rel="noreferrer" target="_blank">https://devel.rtems.org/wiki/<wbr>Developer/Coding/Conventions</a><br>
<div><div class="h5"><br>
> Aha, it is 2017...<br>
><br>
> Best,<br>
> Kuan-hsun<br>
><br>
> 2017-01-25 15:10 GMT+01:00 Sebastian Huber<br>
> <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-<wbr>brains.de</a>>:<br>
>><br>
>> Please use the standard Git commit message format.<br>
>><br>
>><br>
>> On 25/01/17 15:04, Kuan-Hsun Chen wrote:<br>
>>><br>
>>> sptests/sp69: Revise<br>
>>> Add in the verification of the postponed job count for<br>
>>> rtems_rate_monotonic_get_<wbr>status().<br>
>>> ---<br>
>>>   cpukit/rtems/include/rtems/<wbr>rtems/ratemon.h | 24<br>
>>> +++++-------------------<br>
>>>   cpukit/rtems/src/<wbr>ratemongetstatus.c        |  2 ++<br>
>>>   cpukit/rtems/src/<wbr>ratemonperiod.c           | 14 --------------<br>
>>>   testsuites/sptests/sp69/init.c             |  8 ++++++++<br>
>>>   testsuites/sptests/sp69/sp69.<wbr>doc           |  2 ++<br>
>>>   testsuites/sptests/sp69/sp69.<wbr>scn           |  5 +++--<br>
>>>   6 files changed, 20 insertions(+), 35 deletions(-)<br>
>>><br>
>>> diff --git a/cpukit/rtems/include/rtems/<wbr>rtems/ratemon.h<br>
>>> b/cpukit/rtems/include/rtems/<wbr>rtems/ratemon.h<br>
>>> index 54ddd05..59512c5 100644<br>
>>> --- a/cpukit/rtems/include/rtems/<wbr>rtems/ratemon.h<br>
>>> +++ b/cpukit/rtems/include/rtems/<wbr>rtems/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>
>>> */<br>
>>> +  uint32_t                             postponed_jobs_count;<br>
>>>   }  rtems_rate_monotonic_period_<wbr>status;<br>
>><br>
>><br>
>> Number in comment vs. count in member. I prefer count. Please clarify this<br>
>> a bit and avoid the watchdog. The watchdog is an implementation detail. The<br>
>> mentioning of RMS manager is redundant.<br>
>><br>
>><br>
>>>   /**<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_<wbr>postponed_job_count(<br>
>>> -  rtems_id        period_id<br>
>>> -);<br>
>>> -<br>
>>> -<br>
>>>   /**@}*/<br>
>>>     #ifdef __cplusplus<br>
>>> diff --git a/cpukit/rtems/src/<wbr>ratemongetstatus.c<br>
>>> b/cpukit/rtems/src/<wbr>ratemongetstatus.c<br>
>>> index 403c6ed..8bd3613 100644<br>
>>> --- a/cpukit/rtems/src/<wbr>ratemongetstatus.c<br>
>>> +++ b/cpukit/rtems/src/<wbr>ratemongetstatus.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>
>><br>
>><br>
>> We have 2017.<br>
>><br>
>><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_<wbr>status(<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/<wbr>ratemonperiod.c<br>
>>> b/cpukit/rtems/src/<wbr>ratemonperiod.c<br>
>>> index 97547e2..efcd121 100644<br>
>>> --- a/cpukit/rtems/src/<wbr>ratemonperiod.c<br>
>>> +++ b/cpukit/rtems/src/<wbr>ratemonperiod.c<br>
>>> @@ -302,20 +302,6 @@ static rtems_status_code<br>
>>> _Rate_monotonic_Block_while_<wbr>expired(<br>
>>>     return RTEMS_TIMEOUT;<br>
>>>   }<br>
>>>   -uint32_t rtems_rate_monotonic_<wbr>postponed_job_count( rtems_id period_id<br>
>>> )<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/<wbr>init.c<br>
>>> b/testsuites/sptests/sp69/<wbr>init.c<br>
>>> index ac6f58c..c38beb8 100644<br>
>>> --- a/testsuites/sptests/sp69/<wbr>init.c<br>
>>> +++ b/testsuites/sptests/sp69/<wbr>init.c<br>
>><br>
>><br>
>> Missing copyright?<br>
>><br>
>>> @@ -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_<wbr>status( period_id, &period_status );<br>
>>> +  directive_failed( status, "rate_monotonic_get_status" );<br>
>>> +  puts(<br>
>>> +    "rtems_rate_monotonic_get_<wbr>status - verify value of a postponed jobs<br>
>>> count"<br>
>>> +  );<br>
>>> +  rtems_test_assert( period_status.postponed_jobs_<wbr>count == 3 );<br>
>>>         TEST_END();<br>
>>>   diff --git a/testsuites/sptests/sp69/<wbr>sp69.doc<br>
>>> b/testsuites/sptests/sp69/<wbr>sp69.doc<br>
>>> index fbf0e4e..e881a19 100644<br>
>>> --- a/testsuites/sptests/sp69/<wbr>sp69.doc<br>
>>> +++ b/testsuites/sptests/sp69/<wbr>sp69.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>
>><br>
>><br>
>> Missing year.<br>
>><br>
>><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<br>
>>> 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/<wbr>sp69.scn<br>
>>> b/testsuites/sptests/sp69/<wbr>sp69.scn<br>
>>> index 654eea0..e102d22 100644<br>
>>> --- a/testsuites/sptests/sp69/<wbr>sp69.scn<br>
>>> +++ b/testsuites/sptests/sp69/<wbr>sp69.scn<br>
>>> @@ -2,8 +2,9 @@<br>
>>>   rtems_rate_monotonic_get_<wbr>status - verify values of an inactive period<br>
>>>   rtems_rate_monotonic_get_<wbr>status - check RTEMS_NOT_DEFINED<br>
>>>   rtems_rate_monotonic_get_<wbr>status - 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_<wbr>status - verify value of a postponed jobs count<br>
>>>   *** END OF TEST 69 ***<br>
>><br>
>><br>
>> --<br>
>> Sebastian Huber, embedded brains GmbH<br>
>><br>
>> Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
>> Phone   : +49 89 189 47 41-16<br>
>> Fax     : +49 89 189 47 41-09<br>
>> E-Mail  : <a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-<wbr>brains.de</a><br>
>> PGP     : Public key available on request.<br>
>><br>
>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
>><br>
><br>
><br>
</div></div>> ______________________________<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>
</blockquote></div><br></div>