* [Xenomai-help] Monitoring Xenomai scheduler switches
@ 2010-05-20 14:26 Tschaeche IT-Services
2010-05-20 14:54 ` Andreas Glatz
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Tschaeche IT-Services @ 2010-05-20 14:26 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 599 bytes --]
Hi,
we started an application which monitors task switches
using Xenomai 2.5.3.
For monitoring primary domain switches we hooked
in our code by using rt_task_add_hook(T_HOOK_SWITCH)
(storing a timestamp and the Xenomai task ID in an array,
which is read later by user space appl from shared memory).
It seems, that our code is not called when Xenomai switches to the ROOT task.
We already had this issue with Xenomai 2.4.10
and solved it by applying the attached patch.
How can we catch these Xenomai scheduler events in 2.5.3?
What is the reason for filtering them out?
Best regards,
Olli
[-- Attachment #2: Add-scheduler-switch-notification-for-all-switches.patch --]
[-- Type: text/x-diff, Size: 613 bytes --]
Index: xenomai-2.4.10/ksrc/nucleus/pod.c
===================================================================
--- xenomai-2.4.10.orig/ksrc/nucleus/pod.c 2009-08-11 15:53:55.000000000 +0200
+++ xenomai-2.4.10/ksrc/nucleus/pod.c 2010-01-27 12:41:05.000000000 +0100
@@ -2561,7 +2561,7 @@
nkpod->schedhook(runthread, XNRUNNING);
#endif /* __XENO_SIM__ */
- if (!emptyq_p(&nkpod->tswitchq) && !xnthread_test_state(runthread, XNROOT)) {
+ if (!emptyq_p(&nkpod->tswitchq)) {
trace_mark(xn_nucleus, thread_callout,
"thread %p thread_name %s hook %s",
runthread, xnthread_name(runthread), "SWITCH");
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-help] Monitoring Xenomai scheduler switches
2010-05-20 14:26 [Xenomai-help] Monitoring Xenomai scheduler switches Tschaeche IT-Services
@ 2010-05-20 14:54 ` Andreas Glatz
2010-05-21 9:04 ` Gilles Chanteperdrix
2010-05-21 9:28 ` Philippe Gerum
2 siblings, 0 replies; 5+ messages in thread
From: Andreas Glatz @ 2010-05-20 14:54 UTC (permalink / raw)
To: Tschaeche IT-Services; +Cc: xenomai@xenomai.org
Hi,
>
> we started an application which monitors task switches
> using Xenomai 2.5.3.
>
> For monitoring primary domain switches we hooked
> in our code by using rt_task_add_hook(T_HOOK_SWITCH)
> (storing a timestamp and the Xenomai task ID in an array,
> which is read later by user space appl from shared memory).
>
This is not related to your actual question:
Do you want to monitor task switches for debugging or is it part of your application? If for debugging, have you ever used lttng? I know it takes a while to install it but it's quite reliable and can give you much more than the info when a certain task switch occured.
Regards, Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-help] Monitoring Xenomai scheduler switches
2010-05-20 14:26 [Xenomai-help] Monitoring Xenomai scheduler switches Tschaeche IT-Services
2010-05-20 14:54 ` Andreas Glatz
@ 2010-05-21 9:04 ` Gilles Chanteperdrix
2010-05-21 9:28 ` Philippe Gerum
2 siblings, 0 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2010-05-21 9:04 UTC (permalink / raw)
To: Tschaeche IT-Services; +Cc: xenomai
Tschaeche IT-Services wrote:
> Hi,
>
> we started an application which monitors task switches
> using Xenomai 2.5.3.
>
> For monitoring primary domain switches we hooked
> in our code by using rt_task_add_hook(T_HOOK_SWITCH)
> (storing a timestamp and the Xenomai task ID in an array,
> which is read later by user space appl from shared memory).
>
> It seems, that our code is not called when Xenomai switches to the ROOT task.
>
> We already had this issue with Xenomai 2.4.10
> and solved it by applying the attached patch.
>
> How can we catch these Xenomai scheduler events in 2.5.3?
>
> What is the reason for filtering them out?
The nucleus switch hook service was created to implement the equivalent
service provided by RTOSes such as vxworks, psos, vrtx, etc... And we
wrongly assumed that for these RTOSes the switch hook was not called
when switching to the idle task. So, your patch is indeed neeeded. We
also probably need to change code in some places to avoid missing the
switches which take place when changing mode.
--
Gilles.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-help] Monitoring Xenomai scheduler switches
2010-05-20 14:26 [Xenomai-help] Monitoring Xenomai scheduler switches Tschaeche IT-Services
2010-05-20 14:54 ` Andreas Glatz
2010-05-21 9:04 ` Gilles Chanteperdrix
@ 2010-05-21 9:28 ` Philippe Gerum
2010-05-25 11:44 ` Tschaeche IT-Services
2 siblings, 1 reply; 5+ messages in thread
From: Philippe Gerum @ 2010-05-21 9:28 UTC (permalink / raw)
To: Tschaeche IT-Services; +Cc: xenomai
On Thu, 2010-05-20 at 16:26 +0200, Tschaeche IT-Services wrote:
> Hi,
>
> we started an application which monitors task switches
> using Xenomai 2.5.3.
>
> For monitoring primary domain switches we hooked
> in our code by using rt_task_add_hook(T_HOOK_SWITCH)
> (storing a timestamp and the Xenomai task ID in an array,
> which is read later by user space appl from shared memory).
>
> It seems, that our code is not called when Xenomai switches to the ROOT task.
>
> We already had this issue with Xenomai 2.4.10
> and solved it by applying the attached patch.
>
> How can we catch these Xenomai scheduler events in 2.5.3?
>
> What is the reason for filtering them out?
No valid one. Patch queued in my tree, thanks.
>
> Best regards,
>
> Olli
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
--
Philippe.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-help] Monitoring Xenomai scheduler switches
2010-05-21 9:28 ` Philippe Gerum
@ 2010-05-25 11:44 ` Tschaeche IT-Services
0 siblings, 0 replies; 5+ messages in thread
From: Tschaeche IT-Services @ 2010-05-25 11:44 UTC (permalink / raw)
To: Philippe Gerum; +Cc: xenomai
On Fri, May 21, 2010 at 11:28:41AM +0200, Philippe Gerum wrote:
> > ...
> > It seems, that our code is not called when Xenomai switches to the ROOT task.
> >
> > We already had this issue with Xenomai 2.4.10
> > and solved it by applying the attached patch.
> >
> > How can we catch these Xenomai scheduler events in 2.5.3?
> >
> > What is the reason for filtering them out?
>
> No valid one. Patch queued in my tree, thanks.
Just tested your queued patch for 2.5.3 in our build.
Looks great now: we are able to trace all context switches now :-)
Thanks,
Olli
--
Tschaeche IT-Services Tel.: +49/9134/9089850
Dr.-Ing. Oliver Tschäche Mobil: +49/176/20435601
Welluckenweg 4 Email: services@domain.hid
91077 Neunkirchen
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-25 11:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20 14:26 [Xenomai-help] Monitoring Xenomai scheduler switches Tschaeche IT-Services
2010-05-20 14:54 ` Andreas Glatz
2010-05-21 9:04 ` Gilles Chanteperdrix
2010-05-21 9:28 ` Philippe Gerum
2010-05-25 11:44 ` Tschaeche IT-Services
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.