<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div>On 28 Jan 2014, at 22:33, 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" id="" fpstyle="1" aria-label="Message body" 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; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><span style="font-size: 12pt;">I have a question about the time measure measurement in ft_trace in Litmus.</span></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">I was wondering how does the ft_trace get the timestamp information, then I found that it used this function:</div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">#include <asm/feather_trace.h></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">#include <asm/timex.h> /* for get_cycles() */</div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><span style="font-size: 12pt;">static inline unsigned long long ft_timestamp(void)</span></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">{</div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">    return get_cycles();</div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">}</div><p style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"></p><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">This function will return the cycle of the CPU, I checked all the program in the ft_tool and the sched-trace-tool-master, I thought when you get_cycles of the CPU, should not you divide the current frequency of the CPU to get the time. I did not find the division, or the current get cycle did give you the time information?</div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">When I run a small program, I get the output here, and I also send a picture as an attachment.</div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">luozheng@luozheng-Ubuntu:~/Documents/Litmus/sched-trace-tools-master$ ./st_show st--6.bin </div><div style="margin-top: 0px; margin-bottom: 0px;">[         0] NAME            4420/0     on CPU  6 base_task</div><div style="margin-top: 0px; margin-bottom: 0px;">[         0] PARAM           4420/0     on CPU  6 T=(cost:100.00ms, period:500.00ms, phase:  0.00ms), part=0</div><div style="margin-top: 0px; margin-bottom: 0px;">[   2914923] SWITCH_FROM     4420/1     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px;">[   2914923] SWITCH_TO       4420/1     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px;">[   2914923] SWITCH_FROM     4420/1     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px;">[   2914923] COMPLETION      4420/1     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px;">[   2915423] RELEASE         4420/2     on CPU  6 2915923.27ms</div><div style="margin-top: 0px; margin-bottom: 0px;">[   2915423] SWITCH_TO       4420/2     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px;">[   2915774] SWITCH_FROM     4420/2     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px;">[   2915774] COMPLETION      4420/2     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px;">[   2915923] RELEASE         4420/3     on CPU  6 2916423.27ms</div><div style="margin-top: 0px; margin-bottom: 0px;">[   2915923] SWITCH_TO       4420/3     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px;">[   2916274] SWITCH_FROM     4420/3     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px;">[   2916274] COMPLETION      4420/3     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px;">[   2916423] RELEASE         4420/4     on CPU  6 2916923.27ms</div><div style="margin-top: 0px; margin-bottom: 0px;">[   2916423] SWITCH_TO       4420/4     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px;">[   2916774] COMPLETION      4420/4     on CPU  6 </div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">I get a little confused here. Is number in the [] should be the cycles of the CPU? The number like <span style="font-size: 12pt;">2915923.27ms is the actual time? Or how do we interpret this? I think I need some help here. Thank you very much.</span></div></div></div></div></blockquote><br></div><div>Hi Zheng,</div><div><br></div><div>the overhead tracing uses raw processor cycles. You are looking at sched-trace-tools, which uses the same tracing infrastructure but a different time source.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">   </span><a href="https://github.com/LITMUS-RT/litmus-rt/blob/master/litmus/sched_task_trace.c#L20">https://github.com/LITMUS-RT/litmus-rt/blob/master/litmus/sched_task_trace.c#L20</a></div><div><br></div><div>The time units in sched_trace traces are nanoseconds. The tool st_show does some rounding to display millisecond values (which for a human are easier to read).</div><div><br></div><div>Best regards,</div><div>Björn</div><div><br></div><div><br></div></body></html>