All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Fazio Maurizio <maurizio.fazio@leonardocompany.com>,
	"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Xenomai 3.0.5 - sigwaitinfo si_overrun wrong value
Date: Fri, 27 Oct 2017 19:51:14 +0200	[thread overview]
Message-ID: <ef069032-2f58-93a8-98b5-dec4f592094f@xenomai.org> (raw)
In-Reply-To: <49f18a6100f34834bf350f4395cd6944@ocgepvsw3304.ocr.priv>

On 10/26/2017 03:56 PM, Fazio Maurizio wrote:

[snip]

>          sprintf (buffer, "%ld s %ld ns - %ld s %ld ns overrun = %d\n",tp.tv_sec,
>                  tp.tv_nsec, diffTime.tv_sec,diffTime.tv_nsec, siginfo.si_overrun);
> 
>          write (STDOUT_FILENO, buffer, strlen (buffer));

Bad, will switch the caller to secondary mode.

>          if (counter % 3 == 0)
>          {
>                usleep(1500);

Ditto with 3.0.5.

>          }
>          counter++;
>      }
> }
> 

Excerpt from the timer_getoverrun() manpage:

"The timer overrun count is  the  number of additional timer expirations
that occurred between the time when the signal was generated and when it
was delivered or accepted."

So you need to delay for at least two intervals before receiving a
non-zero overrun count.

You may want to check this building your code over the plain glibc.
usleep(1500) gives no overruns, usleep(2000) gives 1, usleep(3000) gives
2 and so on.

-- 
Philippe.


      reply	other threads:[~2017-10-27 17:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26 13:56 [Xenomai] Xenomai 3.0.5 - sigwaitinfo si_overrun wrong value Fazio Maurizio
2017-10-27 17:51 ` Philippe Gerum [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=ef069032-2f58-93a8-98b5-dec4f592094f@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=maurizio.fazio@leonardocompany.com \
    --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.