lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
From: MONTET Julien via lttng-dev <lttng-dev@lists.lttng.org>
To: Norbert Lange <nolange79@gmail.com>
Cc: "lttng-dev@lists.lttng.org" <lttng-dev@lists.lttng.org>
Subject: Re: [lttng-dev] LTTng - Xenomai : different results between timestamp-lttng and rt_time_read()
Date: Thu, 20 May 2021 08:28:50 +0000	[thread overview]
Message-ID: <AM7PR02MB6194C2E06B14077092AA06A0D12A9@AM7PR02MB6194.eurprd02.prod.outlook.com> (raw)
In-Reply-To: <CADYdroOAiKwD_um-ONn=UfNQrOxjs0fM-7ozhUNc18jUQX9cQw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3382 bytes --]

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.

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

Cheers,


________________________________
De : Norbert Lange <nolange79@gmail.com>
Envoyé : jeudi 20 mai 2021 10:20
À : MONTET Julien <julien.montet@reseau.eseo.fr>
Cc : lttng-dev@lists.lttng.org <lttng-dev@lists.lttng.org>
Objet : Re: [lttng-dev] LTTng - Xenomai : different results between timestamp-lttng and rt_time_read()

Am Do., 20. Mai 2021 um 09:58 Uhr schrieb MONTET Julien via lttng-dev
<lttng-dev@lists.lttng.org>:
>
> Hi the developers !
>
> CONTEXT
> I am currently working on a Raspberry pi 3B with Xenomai and LTTng tools.
> Raspbian 10.9 Buster - kernel 4.19.85
> uname -a : Linux raspberrypi 4.19.85-v7+ #5 SMP PREEMPT Wed May 12 10:13:37
> Both tools are working, but I wonder about the accuracy of LTTng libraries.
>
>
> METHOD
> The code used is quite simple, it is written with the alchemy skin.
> A rt_task_spawn calls a function that has rt_task_set_periodic(NULL, TM_NOW, period) and rt_task_wait_period(NULL).
> ->The rt_task_set_periodic is based on 1ms.
> ->The  rt_task_wait_period(NULL) is of course inside a while loop (see below at the very end).
>
> My goal is to get accurate traces from Xenomai.
> I took two methods to do so :
> -> lttng
> -> basic calculation based on  rt_timer_read()
>
> What a surprise when I found both method have two different results.
> -> LTTng shows me traces [0.870;1.13] ms (or even less precise)
> -> rt_time_read shows me traces [0.980;1.020] ms
>
> Thing to note :
> -> The use of LTTng has no influence on rt_time_read(), you can use both methods at the same time.
>
> Then, I saved the output of rt_time_read inside a tracepoint.
> It appeared the LTTng is always called at the right time because the value got by rt_time_read () is really good.
>
>
> QUESTIONS
> These are now my questions :
> - What is the method I should trust ?
> - I have searched on the forum and I found LTTng uses a MONOTONIC clock for the timestamp. Can/Should I modify it ?
>
>
> CODE
> -----------------------------------------------------------------------
> A small part of my function called by rt_task_spawn :
> [...]
>     RTIME period = 1000*1000; // in ns
>     RTIME now;
>     RTIME previous = 0;
>     RTIME duration;
> [...]
>  while(1)
>     {
>         overruns = 0;
>         err = rt_task_wait_period(&overruns);
>         now = rt_timer_read();
>         tracepoint(tp_provider, tracepoint_tick_ms, now, "tick");
>
>         if (previous != 0)
>         {
>             duration=now-previous;
>             rt_printf("%llu\n \n", duration/1000);
>         }
>        previous=now;
>    [...]
> }

Are you using the Xenomai kernel ("Cobalt"), or just skins via
copperplate ("Mercury")?
You have some file /proc/xenomai/version?

The Xenomai kernel has his own clock, which in general is not
correlated to the linux monotonic clock.
(Under some circumstances it might be identical).

My plan is to use a clock plugin for Lttng, particularly because if
lttng uses the linux monotonic clock from a realtime thread
it might deadlock really good ;)

Norbert

[-- Attachment #1.2: Type: text/html, Size: 7508 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

  reply	other threads:[~2021-05-20  8:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20  7:58 [lttng-dev] LTTng - Xenomai : different results between timestamp-lttng and rt_time_read() MONTET Julien via lttng-dev
2021-05-20  8:20 ` Norbert Lange via lttng-dev
2021-05-20  8:28   ` MONTET Julien via lttng-dev [this message]
2021-05-20  9:11     ` Norbert Lange via lttng-dev
2021-05-20 13:54       ` Mathieu Desnoyers via lttng-dev
2021-05-20 13:56         ` Mathieu Desnoyers via lttng-dev
2021-05-20 15:09           ` Mathieu Desnoyers via lttng-dev
2021-05-20 15:34             ` Jan Kiszka via lttng-dev
2021-05-20 15:39             ` Norbert Lange via lttng-dev
2021-05-21 10:13               ` MONTET Julien via lttng-dev
2021-05-25  8:46                 ` Norbert Lange via lttng-dev

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=AM7PR02MB6194C2E06B14077092AA06A0D12A9@AM7PR02MB6194.eurprd02.prod.outlook.com \
    --to=lttng-dev@lists.lttng.org \
    --cc=julien.montet@reseau.eseo.fr \
    --cc=nolange79@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).