From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Philippe Gerum <rpm@xenomai.org>
Cc: Steven Kauffmann <steven.kauffmann@domain.hid>, xenomai@xenomai.org
Subject: Re: [Xenomai-core] [Xenomai-help] Periodic threads not scheduled anymore during debug session
Date: Wed, 13 May 2009 15:34:34 +0200 [thread overview]
Message-ID: <4A0ACC6A.3010205@domain.hid> (raw)
In-Reply-To: <1242221456.26544.960.camel@domain.hid>
Philippe Gerum wrote:
> On Wed, 2009-05-13 at 15:16 +0200, Gilles Chanteperdrix wrote:
>> Philippe Gerum wrote:
>>> On Wed, 2009-05-13 at 14:04 +0200, Steven Kauffmann wrote:
>>>> Hi all,
>>>>
>>>> If I connect a debugger to my application, other Xenomai periodic
>>>> threads (threads that not belong to the current process I'm debugging
>>>> ) are not scheduled anymore. Attached you can find a simple example
>>>> that reproduces the problem. I run the program 2 times in a different
>>>> terminal and connected a debugger to one of them. When a breakpoint is
>>>> reached both programs stops their execution but I would expect that
>>>> only the program that I'm debugging should stop and not both.
>>>>
>>>> $ cat /proc/xenomai/sched
>>>>
>>>> CPU PID PRI PERIOD TIMEOUT TIMEBASE STAT NAME
>>>> 0 0 -1 0 0 master R ROOT
>>>> 0 5469 0 1000000001 331274938 master D
>>>> 0 5471 0 1000000001 0 master XT
>>>>
>>>> This looks normal one thread is stopped ( thread that reaches the
>>>> breakpoint ) and the other one is delayed because it's a periodic
>>>> thread. Every time I call this command the timeout of the delayed
>>>> thread changes so it looks like this thread is still running but in
>>>> reality it is not.
>>> This behavior is wanted (I mean, the implementation does freeze all
>>> thread timers when a break state is reached on purpose), so that you
>>> don't get tons of overruns once the debuggee is restarted.
>>>
>>> However, I'm now wondering if we should not be a bit smarter than this,
>>> and narrow the scope of such action. We do have the mechanisms to do so,
>>> it is just a matter of using them.
>> Do we? I mean, are we able to know which process a timer belongs to?
>>
>
> We could tag the per-thread timers (rtimer, ptimer) using their status
> field, and move back to the owner thread using container_of() when
> applicable.
What if an application uses rt_alarm_create/rt_alarm_wait?
--
Gilles.
next prev parent reply other threads:[~2009-05-13 13:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 12:04 [Xenomai-help] Periodic threads not scheduled anymore during debug session Steven Kauffmann
2009-05-13 12:59 ` [Xenomai-core] " Philippe Gerum
2009-05-13 13:16 ` Gilles Chanteperdrix
2009-05-13 13:30 ` Philippe Gerum
2009-05-13 13:34 ` Gilles Chanteperdrix [this message]
2009-05-13 13:42 ` Philippe Gerum
2009-05-27 9:23 ` thomas.debes
2009-05-30 15:32 ` Philippe Gerum
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=4A0ACC6A.3010205@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=rpm@xenomai.org \
--cc=steven.kauffmann@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.