* Weird nanosleep behaviour while debugging after toolchain change
@ 2022-02-15 20:28 François Legal
2022-02-16 21:07 ` Jan Kiszka
0 siblings, 1 reply; 2+ messages in thread
From: François Legal @ 2022-02-15 20:28 UTC (permalink / raw)
To: xenomai
Hello,
using xenomai 3.1/linux 4.4 on arm, I'm facing a weird issue with gdb debugging.
I was previously using a croostool-ng generated toolchain, and had to switch to a yocto generated one.
The same application/kernel/xenomai user land being used, when I run the application through the debugger, the calls to nanosleep in my RT thread seem to block indefinitely unless I single step through the code. Placing a break right after a nanosleep and continuing will not trigger the break.
I don't know what to do to chase this.
While the thread is in nanosleep, I can see this in /proc/xenomai/sched :
CPU PID CLASS TYPE PRI TIMEOUT STAT NAME
0 1666 rt cobalt 60 839ms140us w Thread a (sem_timedwaiting. Timeout changes each time I display threads)
0 1667 rt cobalt 62 - s Thread b (nanosleeping)
CPU PID MSW CSW XSC PF STAT %CPU NAME
0 1666 6 42 50 0 00248046 0.0 Thread a
0 1667 4 96 95 0 00640040 0.0 Thread b
Can anybody help ?
François
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Weird nanosleep behaviour while debugging after toolchain change
2022-02-15 20:28 Weird nanosleep behaviour while debugging after toolchain change François Legal
@ 2022-02-16 21:07 ` Jan Kiszka
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2022-02-16 21:07 UTC (permalink / raw)
To: François Legal, xenomai
On 15.02.22 21:28, François Legal via Xenomai wrote:
> Hello,
>
> using xenomai 3.1/linux 4.4 on arm, I'm facing a weird issue with gdb debugging.
> I was previously using a croostool-ng generated toolchain, and had to switch to a yocto generated one.
>
> The same application/kernel/xenomai user land being used, when I run the application through the debugger, the calls to nanosleep in my RT thread seem to block indefinitely unless I single step through the code. Placing a break right after a nanosleep and continuing will not trigger the break.
>
> I don't know what to do to chase this.
>
> While the thread is in nanosleep, I can see this in /proc/xenomai/sched :
> CPU PID CLASS TYPE PRI TIMEOUT STAT NAME
> 0 1666 rt cobalt 60 839ms140us w Thread a (sem_timedwaiting. Timeout changes each time I display threads)
> 0 1667 rt cobalt 62 - s Thread b (nanosleeping)
>
> CPU PID MSW CSW XSC PF STAT %CPU NAME
> 0 1666 6 42 50 0 00248046 0.0 Thread a
> 0 1667 4 96 95 0 00640040 0.0 Thread b
>
> Can anybody help ?
In such weird cases, the general recommendation is to run a system trace
in parallel (trace-cmd record ...) and check what actually happens
scheduling wise. That can also reveal if the expected syscalls are
actually being issued.
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-16 21:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 20:28 Weird nanosleep behaviour while debugging after toolchain change François Legal
2022-02-16 21:07 ` Jan Kiszka
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.