<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 14, 2020, 8:29 AM Matthew J Fletcher <<a href="mailto:amimjf@gmail.com">amimjf@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Free running counter is only 32khz, so ages in cpu time at 200mhz. There is a nanosecond IEEE 1588 unit on the network interface ....<div><br></div><div>I've identified at least 6 timers going at 10ms, only 1-in-1000 invocations seem take more than a tick to run,.. they are all started in the same second but with randomish-jitter between the rtems_time_server_fire_after() calls,.. rtems would not be aligning them to all run at the same time (on tick boundary) would it </div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">It is possible that they could align. As tasks execute, they are going to tend to run either as unblocked via time (e.g. tick) or another task unblocking them. If they tend to run under a clock tick or two, this activity could begin to cluster.  This is assuming a more event driven system.</div><div dir="auto"><br></div><div dir="auto">I tend to think this is less likely to happen with a more periodic system.</div><div dir="auto"><br></div><div dir="auto">What's your clock tick quantum? I think a larger tick would have a higher tendency to cluster. This is because more activities would tend to be triggered and run to completion between two ticks </div><div dir="auto"><br></div><div dir="auto">This is all spit balling and hypothetical. A white board, some hard information, drawing event flow and timeline, and pondering would be needed to see if this is happening. </div><div dir="auto"><br></div><div dir="auto">--joel</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 14 Jan 2020 at 14:02, Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank" rel="noreferrer">joel@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"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 14, 2020 at 7:37 AM Matthew J Fletcher <<a href="mailto:amimjf@gmail.com" target="_blank" rel="noreferrer">amimjf@gmail.com</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"><div dir="ltr">Of course without nanoseconds support in the BSP measuring the timer callback duration is difficult as most calls will be less than a tick.</div></blockquote><div><br></div><div>Yeah, you can't use the clock services from rtems in that case since they don't have a high enough resolution.</div><div><br></div><div>Do you have a free running counter/timer you can read?</div><div><br></div><div>I assume you only have a finite number of timer service routines called from </div><div>the Timer Server thread. Can you benchmark them outside the application? </div><div>If this is a straightforward case of a single invocation of a method running too</div><div>long, that would be sufficient to figure it out. Or do you have something that is</div><div>processing a set of things and sometimes the set is large? </div><div><br></div><div>Hmmm... it is possible that if the clock tick configured is larger than any of</div><div>your timer intervals, they are firing in clusters. Say you have a 10 millisecond</div><div>clock tick configured and all your timers fire in less than that. They will all</div><div>fire in 1 tick. Any chance of a degenerate set like this?</div><div><br></div><div>--joel</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 14 Jan 2020 at 08:41, Matthew J Fletcher <<a href="mailto:amimjf@gmail.com" target="_blank" rel="noreferrer">amimjf@gmail.com</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"><div dir="ltr">Ok,<div><br></div><div>So first step is to create a wrapper that all timers fire through, then an array to count the number of invocations per timer_id, after that some per timer_id time accounting.</div><div><br></div><div>Will let you know if its anything outside my application.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 13 Jan 2020 at 15:01, Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank" rel="noreferrer">joel@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"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 13, 2020 at 8:53 AM Matthew J Fletcher <<a href="mailto:amimjf@gmail.com" target="_blank" rel="noreferrer">amimjf@gmail.com</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"><div dir="ltr">Hi,<div><br></div><div>My application seems to be using around 1/3rd of its total cpu usage in the 'TIME' task,. is this the task created by rtems_timer_initiate_server() ?</div></div></blockquote><div><br></div><div>Yes. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>What would be the best way to get more information,. are there console commands that would emit more data, or do i need to instrument my application to see usage of all rtems_timer_xx callbacks ?</div></div></blockquote><div><br></div><div>rtems_timer_server_xx would be the ones going to the TIME Server.</div><div><br></div><div>But 1/3 seems quite excessive. I would assume one of your timer server routines is doing something unexpectedly heavy CPU-wise.</div><div><br></div><div>I don't think there is any instrumentation in the server which would help. Measuring the execution time of each invocation is what comes to mind. My first thought is that this would be a nice debug option for timers. But I am not sure how good this would be for ISR style. </div><div><br></div><div>--joel </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div dir="ltr"><div><br>regards</div><div>---</div><div>Matthew J Fletcher</div><br></div></div></div>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank" rel="noreferrer">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a></blockquote></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><br>regards</div><div>---</div><div>Matthew J Fletcher</div><br></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><br>regards</div><div>---</div><div>Matthew J Fletcher</div><br></div>
</blockquote></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><br>regards</div><div>---</div><div>Matthew J Fletcher</div><br></div>
</blockquote></div></div></div>