[lttng-dev] LTTng - Xenomai : different results between timestamp-lttng and rt_time_read()

Norbert Lange nolange79 at gmail.com
Thu May 20 05:11:31 EDT 2021

Am Do., 20. Mai 2021 um 10:28 Uhr schrieb MONTET Julien
<julien.montet at reseau.eseo.fr>:
> Hi Norbert,
> Thank you for your answer !
> Yes, I am using a Xenomai cobalt - xenomai is 3.1
> cat /proc/xenomai/version => 3.1
> After the installation, I tested "test tools" in /proc/xenomai/ and it worked nice.

Just asked to make sure, thought the scripts usual add some -xeno tag
to the kernel version.

> What do you mean by "it might deadlock really good" ?

clock_gettime will either use a syscall (kills realtime always) or is
optimized via VDSO (which very likely is your case).

What happens is that the kernel will take a spinlock, then write new
values, then releases the spinlock.
your program will aswell spin (but just to see if the spinlock is
free), read the values and interpolates them.

But if your program interrupts the kernel while the kernel holds the
lock (all on the same cpu core), then it will spin forever and the
kernel will never execute.

The ugly truth is, that any library you use could call those
functions, you need to very closely look at your realtime path.
Some checkers can help: https://github.com/nolange/preload_checkers


More information about the lttng-dev mailing list