All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Printf does not always show on the console
@ 2017-08-28 10:05 belinea123
  2017-08-29  8:57 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: belinea123 @ 2017-08-28 10:05 UTC (permalink / raw)
  To: xenomai


   I have troubles that the output of printf does not always show on the
   console.

   for(int i = 0; i<500; i++)
   {
      printf("this is my output. 01234567890123.....\n");
   }

   After 240 lines, the output stops in the middle of the sentence without
   a carriage return. The output of later printf calls appears after that.
   Same behaviour when I compile the app for debug or release. Calling
   fflush(stdout) does not make a difference.
   My app links a shared object which controls a rtdm device driver.
   The app and the shared object link xenomai and use the printf that is
   wrapped by xenomai.
   I couldn't reproduce it with a minimal cpp example.

   When I add rt_task_sleep(1000*1000) the output is Ok.

   When I start the app, I use the command line options
   --print-buffer-size=16384 --print-buffer-count=4
   --print-sync-delay=100. When i use print-buffer-size multiplied by 10,
   the output is Ok.

   Is this the normal behavior? This is difficult for me, as I use printf
   for debugging. Printf never returned a negative number, so I can't
   detect the problem in the code.

   I'm running cobalt (dual kernel).

   cat /proc/xenomai/version
   3.0.4

   ipipe
   ipipe-core-4.4.43-x86-6.patch

   uname -a
   Linux my_pc 4.4.43 #1 SMP Tue May 9 13:34:48 CEST 2017 x86_64 GNU/Linux


   Regards

   Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xenomai] Printf does not always show on the console
  2017-08-28 10:05 [Xenomai] Printf does not always show on the console belinea123
@ 2017-08-29  8:57 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2017-08-29  8:57 UTC (permalink / raw)
  To: belinea123, xenomai

On 08/28/2017 12:05 PM, belinea123@gmx.de wrote:
> 
>    I have troubles that the output of printf does not always show on the
>    console.
> 
>    for(int i = 0; i<500; i++)
>    {
>       printf("this is my output. 01234567890123.....\n");
>    }
> 
>    After 240 lines, the output stops in the middle of the sentence without
>    a carriage return. The output of later printf calls appears after that.
>    Same behaviour when I compile the app for debug or release. Calling
>    fflush(stdout) does not make a difference.
>    My app links a shared object which controls a rtdm device driver.
>    The app and the shared object link xenomai and use the printf that is
>    wrapped by xenomai.
>    I couldn't reproduce it with a minimal cpp example.
> 
>    When I add rt_task_sleep(1000*1000) the output is Ok.
> 
>    When I start the app, I use the command line options
>    --print-buffer-size=16384 --print-buffer-count=4
>    --print-sync-delay=100. When i use print-buffer-size multiplied by 10,
>    the output is Ok.
> 
>    Is this the normal behavior?

At least this is the expected one. Internal output buffers are not
resizable in the current implementation.

 This is difficult for me, as I use printf
>    for debugging. Printf never returned a negative number, so I can't
>    detect the problem in the code.

This is a ring buffer so you won't get overflows, only truncated output.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-29  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-28 10:05 [Xenomai] Printf does not always show on the console belinea123
2017-08-29  8:57 ` Philippe Gerum

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.