On 08/28/2017 12:05 PM, [email protected] 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. _______________________________________________ Xenomai mailing list [email protected] https://xenomai.org/mailman/listinfo/xenomai
