<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>I believe your questions may be answered by the Litmus tracing tutorial: <a href="https://wiki.litmus-rt.org/litmus/Tracing">https://wiki.litmus-rt.org/litmus/Tracing</a></div><div><br></div><div>While you should read the whole tutorial, you will be most interested in the “Recording Scheduling Traces” section.</div><div><br></div><div>You’ll use the feather-trace tools to capture the logs.  Then you can use Björn’s sched-trace-tools for analyzing them: <a href="https://github.com/brandenburg/sched-trace-tools">https://github.com/brandenburg/sched-trace-tools</a></div><div><br></div><div>-Glenn</div><div><br></div><br><div><div>On Nov 18, 2013, at 10:56 AM, Luo, Zheng <<a href="mailto:luozheng@wustl.edu">luozheng@wustl.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr" fpstyle="1" aria-label="Message body" tabindex="0" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; margin: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;">Thank you very much for the reply. That is very helpful. In the email, you mentioned that <span style="color: rgb(40, 40, 40); font-size: 12pt;">I can also use Litmus’s sched_trace logs to get more accurate information on job release times, completion times, and many other events.</span><span style="color: rgb(40, 40, 40); font-size: 12pt;"> I was wondering where that program is?</span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(40, 40, 40); font-size: 12pt;"><br></span></div><div style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(40, 40, 40); font-size: 12pt;">Is it the program in the folder </span><font color="#282828">ft_tools, named st_trace? It seems that I can not get the data properly from it.</font></div><div style="margin-top: 0px; margin-bottom: 0px;"><font color="#282828"><br></font></div><div style="margin-top: 0px; margin-bottom: 0px;"><font color="#282828">Also, is there any good documentation of Litmus? I sometimes feel very hard to figure out the function of each program.</font></div><div style="margin-top: 0px; margin-bottom: 0px;"><font color="#282828"><br></font></div><div style="margin-top: 0px; margin-bottom: 0px;"><font color="#282828">Thank you very much. Looking forward to your reply.</font></div><div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div name="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;">Zheng Luo<br></div></div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="color: rgb(40, 40, 40);"><hr tabindex="-1" style="display: inline-block; width: 691px;"><div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size: 11pt;"><b>From:</b><span class="Apple-converted-space"> </span><a href="mailto:litmus-dev-bounces@lists.litmus-rt.org">litmus-dev-bounces@lists.litmus-rt.org</a> <<a href="mailto:litmus-dev-bounces@lists.litmus-rt.org">litmus-dev-bounces@lists.litmus-rt.org</a>> on behalf of Glenn Elliott <<a href="mailto:gelliott@cs.unc.edu">gelliott@cs.unc.edu</a>><br><b>Sent:</b><span class="Apple-converted-space"> </span>Saturday, November 16, 2013 8:09 AM<br><b>To:</b><span class="Apple-converted-space"> </span><a href="mailto:litmus-dev@lists.litmus-rt.org">litmus-dev@lists.litmus-rt.org</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [LITMUS^RT] Question about GSN-EDF in Litmus</font><div> </div></div><div>Hi Zheng,<div><br></div><div>The general structure of a typical litmus application looks like this:</div><div><br></div><div>init_litmus(); /* initialize litmus (basically just pins the programs memory to avoid page faults) */</div><div>set_rt_task_param();  /* set task params, such as period, relative deadline, execution time, etc. */</div><div>task_mode(LITMUS_RT_TASK); /* become a real-time task */</div><div>wait_for_ts_release(); /* wait for synchronous task set release—i.e., until liblitmus’s release_ts program is run */</div><div>while(running) { /* keep executing jobs until task should exit */</div><div>   do_work();  /* do the actual work of a job */</div><div>   sleep_next_period();  /* sleep until next job release */</div><div>}</div><div>task_mode(BACKGROUND_TASK); /* exit real-time mode */</div><div>exit(0);</div><div><br></div><div>You can take a look at liblitmus/bin/rtspin.c and liblitmus/bin/base_task.c for examples.  (Note: Use of wait_for_ts_release() is optional.  However, without it, you may want to swap the order of sleep_next_period() and do_work().)</div><div><br></div><div>The structure of your program is incorrect:</div><div><br></div><div>init_litmus();</div><div>set_rt_task_param();</div><div>task_mode(LITMUS_RT_TASK);</div><div>task_mode(BACKGROUND_TASK);</div><div>job();</div><div><br></div><div>Problems:</div><div>1) job() is not in a loop.  (This would only be correct if you were doing real-time job shop scheduling.)</div><div>2) job() should be between task_mode(LITMUS_RT_TASK) and task_mode(BACKGROUND_TASK).  You only need to call task_mode(LITMUS_RT_TASK) once per task, not once per job.</div><div><br></div><div>One last comment: It looks like you are reading the time stamp counter to trace start and finish times.  This is fine in the correct context, but you can also use Litmus’s sched_trace logs to get more accurate information on job release times, completion times, and many other events.  In general, you have to be careful measuring times in userspace.  For instance, you cannot measure job release times in userspace because a job may not be immediately scheduled when it is released (there might be higher-priority work that needs to be scheduled first).  Thus, a userspace release measurement would have an error of (time the job was first scheduled - true release time).  It’s best if you use sched_trace logs to get accurate data.</div><div><br></div><div>-Glenn</div><div><br></div><div><br><div><div>On Nov 16, 2013, at 2:37 AM, Luo, Zheng <<a href="mailto:luozheng@wustl.edu">luozheng@wustl.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr" tabindex="0" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"><div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; margin: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-size: 12pt;">Hi All</span><span style="background-color: rgb(255, 255, 255); font-family: Helvetica, Verdana, sans-serif; font-size: 15.199999809265137px; font-weight: bold;">,</span></div><div dir="ltr" style="color: rgb(40, 40, 40);"><div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; margin: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;"><span style="background-color: rgb(255, 255, 255); font-family: Helvetica, Verdana, sans-serif; font-size: 15.199999809265137px; font-weight: bold;"><br></span></div><div><div style="margin-top: 0px; margin-bottom: 0px;"><font size="3">I am a master's student in Washington University who is doing research on realtime system. I installed Litmus because it has the global EDF scheduler. However when I do a simple experiment by using it. I simply can not get the right result. The EDF scheduler acts like a round robing scheduler. I don't know where I did wrong. The Litmus I installed is <span style="background-color: rgb(255, 255, 255);">LITMUS-RT Version 2013.1.</span></font></div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">I put my source code as a attachment, and also the screenshot of the result. Hope you can help me with. Thank you very much. Looking forward to your reply.</div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div name="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; margin: 0px;">Zheng Luo<br></div></div></div></div></div><span><Screenshot 2013-11-15 21:30:34.png></span><span><test_mt_task.c></span>_______________________________________________<br>litmus-dev mailing list<br><a href="mailto:litmus-dev@lists.litmus-rt.org">litmus-dev@lists.litmus-rt.org</a><br><a href="https://lists.litmus-rt.org/listinfo/litmus-dev">https://lists.litmus-rt.org/listinfo/litmus-dev</a></div></blockquote></div><br></div></div></div></div>_______________________________________________<br>litmus-dev mailing list<br><a href="mailto:litmus-dev@lists.litmus-rt.org">litmus-dev@lists.litmus-rt.org</a><br><a href="https://lists.litmus-rt.org/listinfo/litmus-dev">https://lists.litmus-rt.org/listinfo/litmus-dev</a></div></blockquote></div><br></body></html>