All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gsellmann Peter <Peter.Gsellmann@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] accessing context switch counter from rttask
Date: Sun, 08 Jul 2007 14:00:28 +0200	[thread overview]
Message-ID: <4690D1DC.1020204@domain.hid> (raw)
In-Reply-To: <4681332D.2030105@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

      reply	other threads:[~2007-07-08 12:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-26 15:01 [Xenomai-help] accessing context switch counter from rttask Gsellmann Peter
2007-06-26 15:01 ` Gsellmann Peter
2007-06-26 15:39   ` Jan Kiszka
2007-07-08 12:00     ` Jan Kiszka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4690D1DC.1020204@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=Peter.Gsellmann@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.