<div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 11, 2021 at 1:11 AM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">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">On Sun, May 9, 2021 at 9:33 AM Richi Dubey <<a href="mailto:richidubey@gmail.com" target="_blank">richidubey@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I am using the line: rtems_task_wake_after(RTEMS_MICROSECONDS_TO_TICKS(6000)); in my test program to emulate a 6 seconds sleep. But when I deubg the program using qemu, I do not see it waiting for 6 seconds; on debugging, there is a error of a shared library file not found, which leads to the ticks being 0. Can someone please help?<br>
><br>
<br>
Yes, 6000 microseconds isn't 6 seconds.<br></blockquote><div><br></div><div>Use (rtems_clock_get_ticks_per_second() * 6) as documented here:</div><div><br></div><div><a href="https://docs.rtems.org/releases/rtems-docs-4.11.2/c-user/clock_manager.html#rtems-clock-get-ticks-per-second">https://docs.rtems.org/releases/rtems-docs-4.11.2/c-user/clock_manager.html#rtems-clock-get-ticks-per-second</a> </div><div><br></div><div>But if you are on a simulator, it won't match 6 seconds of "real world time". Simulators run at a different speed than "real time" and 6 seconds of simulated processor time could take much less or much more time. Depends on the simulator, target processor, and the host computer.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> Debug log:<br>
><br>
> ----------------------------------------------------------------------------------------------------------<br>
> 35 rtems_task_wake_after(RTEMS_MICROSECONDS_TO_TICKS(6000));<br>
> (gdb) si<br>
> 0x00101176 135 rtems_task_wake_after(RTEMS_MICROSECONDS_TO_TICKS(6000));<br>
> (gdb)<br>
> 0x00101178 135 rtems_task_wake_after(RTEMS_MICROSECONDS_TO_TICKS(6000));<br>
> (gdb)<br>
> 0x0010117c 135 rtems_task_wake_after(RTEMS_MICROSECONDS_TO_TICKS(6000));<br>
> (gdb)<br>
> __udivsi3 () at ../../../../../../gnu-mirror-gcc-57b5da3/libgcc/config/arm/lib1funcs.S:1104<br>
> 1104 ../../../../../../gnu-mirror-gcc-57b5da3/libgcc/config/arm/lib1funcs.S: No such file or directory.<br>
> (gdb)<br>
> 1105 in ../../../../../../gnu-mirror-gcc-57b5da3/libgcc/config/arm/lib1funcs.S<br>
> (gdb) ni<br>
> 1106 in ../../../../../../gnu-mirror-gcc-57b5da3/libgcc/config/arm/lib1funcs.S<br>
> (gdb)<br>
> 1107 in ../../../../../../gnu-mirror-gcc-57b5da3/libgcc/config/arm/lib1funcs.S<br>
> (gdb) si<br>
> 1108 in ../../../../../../gnu-mirror-gcc-57b5da3/libgcc/config/arm/lib1funcs.S<br>
> (gdb) ni<br>
> 1109 in ../../../../../../gnu-mirror-gcc-57b5da3/libgcc/config/arm/lib1funcs.S<br>
> (gdb)<br>
> 1118 in ../../../../../../gnu-mirror-gcc-57b5da3/libgcc/config/arm/lib1funcs.S<br>
> (gdb)<br>
> 1119 in ../../../../../../gnu-mirror-gcc-57b5da3/libgcc/config/arm/lib1funcs.S<br>
> (gdb)<br>
> 1120 in ../../../../../../gnu-mirror-gcc-57b5da3/libgcc/config/arm/lib1funcs.S<br>
> (gdb)<br>
> 1121 in ../../../../../../gnu-mirror-gcc-57b5da3/libgcc/config/arm/lib1funcs.S<br>
> (gdb)<br>
> 0x00101180 in test () at ../../../testsuites/smptests/smpschededf05/init.c:135<br>
> 135 rtems_task_wake_after(RTEMS_MICROSECONDS_TO_TICKS(6000));<br>
> (gdb) si<br>
> 0x00101182 135 rtems_task_wake_after(RTEMS_MICROSECONDS_TO_TICKS(6000));<br>
> (gdb)<br>
> 0x00101184 135 rtems_task_wake_after(RTEMS_MICROSECONDS_TO_TICKS(6000));<br>
> (gdb)<br>
> rtems_task_wake_after (ticks=16777216) at ../../../cpukit/rtems/src/taskwakeafter.c:30<br>
> 30 {<br>
> (gdb)<br>
> 0x00108b44 30 {<br>
> (gdb) ni<br>
> 0x00108b46 30 {<br>
> (gdb)<br>
> 0x00108b48 30 {<br>
> (gdb)<br>
> 38 cpu_self = _Thread_Dispatch_disable();<br>
> (gdb)<br>
> 0x00108b4e 38 cpu_self = _Thread_Dispatch_disable();<br>
> (gdb)<br>
> 39 executing = _Per_CPU_Get_executing( cpu_self );<br>
> (gdb)<br>
> 0x00108b52 39 executing = _Per_CPU_Get_executing( cpu_self );<br>
> (gdb)<br>
> 0x00108b56 39 executing = _Per_CPU_Get_executing( cpu_self );<br>
> (gdb)<br>
> 41 if ( ticks == 0 ) {<br>
> (gdb)<br>
> 0x00108b5a 41 if ( ticks == 0 ) {<br>
> (gdb) p ticks<br>
> $1 = 0<br>
> (gdb)<br>
><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>
</div>