Jan Kiszka wrote:
> Gsellmann Peter wrote:
>> Hi!
>>
>> I searched for a while and found this snippet
>>
>> RT_TASK *rt = rt_task_self();
>> int x = rt->thread_base.stat.csw;
>>
>> should give the number of context switches, but:
>> RT_TASK in non-kernel mode is only RT_TASK_PLACEHOLDER so i have no
>> access to thread_base!
>>
>> Is there an official way to get this info (w/o opening
>> "/proc/xenomai/...")?
>>
> 
> Not yet. You could extend RT_TASK_INFO with this statistic (obtained via
> rt_task_inquire). There is currently work in progress to add accumulated
> execution times to the same interface, so this extension would fit quite
> well. Patches always welcome.

Meanwhile, I added this feature to my experimental patch stack while
integrating some other new stats. See

http://www.rts.uni-hannover.de/rtaddon/patches/xenomai/

against Xenomai SVN trunk, namely

http://www.rts.uni-hannover.de/rtaddon/patches/xenomai/enhance-thread-stats.patch

Just call rt_task_inquire() and check RT_TASK_INFO::ctxswitches (there
are modeswitches and pagefaults too as we are already at it).

Feedback welcome!

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to