Xenomai printing out excessively verbose warnings

When we try to run a component in Orocos under Xenomai, we get
excessively verbose warnings. The following deployment script can
trigger these warnings:

import("atrias_noop_conn")
loadComponent("atrias_connector", "NoopConn")
setActivity("atrias_connector", 0.001, 0, ORO_SCHED_OTHER)

NoopComm is a component that doesn't do anything (for testing).

Stepping through these manually in the deployer, I get the following
output on the setActivity line.

Deployer [S]> setActivity("atrias_connector", 0.001, 0, ORO_SCHED_OTHER)
10.715 [ Info ][Thread] Creating Thread for scheduler=1, priority=0,
CPU affinity=4294967295, with name='atrias_connector'
10.716 [ Info ][atrias_connector1] Thread created with scheduler
type '1', priority 0, cpu affinity 0 and period 0.001.
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(warn_upon_switch+0x15)[0x7f782c0c58c5]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f782b507cb0]
/usr/xenomai/lib/libnative.so.3(rt_mutex_release+0x8a)[0x7f782a5fec6a]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(_ZN3RTT2os6ThreadD1Ev+0x122)[0x7f782c0c1362]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(_ZN3RTT8ActivityD2Ev+0x2e)[0x7f782c07ea0e]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(_ZN3RTT8ActivityD0Ev+0x9)[0x7f782c07ea69]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(_ZN5boost6detail12shared_countD1Ev+0x49)[0x7f782c078479]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(_ZN3RTT11TaskContext11setActivityEPNS_4base17ActivityInterfaceE+0xca)[0x7f782c07f4ca]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-deployment-xenomai.so.2.5.0(_ZN3OCL19DeploymentComponent11setActivityERKSsdii+0xff)[0x7f782ba83f8f]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-deployment-xenomai.so.2.5.0(_ZN3RTT8internal11InvokerImplILi4EFbRKSsdiiENS0_24LocalOperationCallerImplIS4_EEE4callES3_dii+0x14b)[0x7f782bad6b9b]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-deployment-xenomai.so.2.5.0(_ZNK3RTT8internal20FusedMCallDataSourceIFbRKSsdiiEE8evaluateEv+0x95)[0x7f782bb00d25]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-taskbrowser-xenomai.so.2.5.0(_ZN3OCL11TaskBrowser7doPrintEN5boost13intrusive_ptrIN3RTT4base14DataSourceBaseEEEb+0x3e)[0x7f782bd8e84e]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-taskbrowser-xenomai.so.2.5.0(_ZN3OCL11TaskBrowser11printResultEPN3RTT4base14DataSourceBaseEb+0x8f)[0x7f782bd8f38f]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-taskbrowser-xenomai.so.2.5.0(_ZN3OCL11TaskBrowser11evalCommandERSs+0x4be)[0x7f782bd9556e]
/home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-taskbrowser-xenomai.so.2.5.0(_ZN3OCL11TaskBrowser4loopEv+0xc9f)[0x7f782bd9927f]
/home/drl/rosstacks/orocos_toolchain/ocl/bin/deployer-xenomai(main+0x751)[0x40d351]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f782ac4676d]
/home/drl/rosstacks/orocos_toolchain/ocl/bin/deployer-xenomai[0x40d4f1]
= true

These warnings are making legitimate output from Orocos and our
software difficult to find. We want these to show if a context switch
occurs during realtime operation... but we'd like to silence them
during initialization.

Thank you for any help,
Johnathan Van Why
Dynamic Robotics Laboratory
Oregon State University

Xenomai printing out excessively verbose warnings

On Tue, Aug 21, 2012 at 6:52 PM, Johnathan Van Why <jrvanwhy [..] ...> wrote:
> When we try to run a component in Orocos under Xenomai, we get
> excessively verbose warnings. The following deployment script can
> trigger these warnings:
>
> import("atrias_noop_conn")
> loadComponent("atrias_connector", "NoopConn")
> setActivity("atrias_connector", 0.001, 0, ORO_SCHED_OTHER)
>
> NoopComm is a component that doesn't do anything (for testing).
>
> Stepping through these manually in the deployer, I get the following
> output on the setActivity line.
>
> Deployer [S]> setActivity("atrias_connector", 0.001, 0, ORO_SCHED_OTHER)
> 10.715 [ Info ][Thread] Creating Thread for scheduler=1, priority=0,
> CPU affinity=4294967295, with name='atrias_connector'
> 10.716 [ Info ][atrias_connector1] Thread created with scheduler
> type '1', priority 0, cpu affinity 0 and period 0.001.
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(warn_upon_switch+0x15)[0x7f782c0c58c5]
> /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f782b507cb0]
> /usr/xenomai/lib/libnative.so.3(rt_mutex_release+0x8a)[0x7f782a5fec6a]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(_ZN3RTT2os6ThreadD1Ev+0x122)[0x7f782c0c1362]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(_ZN3RTT8ActivityD2Ev+0x2e)[0x7f782c07ea0e]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(_ZN3RTT8ActivityD0Ev+0x9)[0x7f782c07ea69]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(_ZN5boost6detail12shared_countD1Ev+0x49)[0x7f782c078479]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-rtt-xenomai.so.2.5(_ZN3RTT11TaskContext11setActivityEPNS_4base17ActivityInterfaceE+0xca)[0x7f782c07f4ca]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-deployment-xenomai.so.2.5.0(_ZN3OCL19DeploymentComponent11setActivityERKSsdii+0xff)[0x7f782ba83f8f]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-deployment-xenomai.so.2.5.0(_ZN3RTT8internal11InvokerImplILi4EFbRKSsdiiENS0_24LocalOperationCallerImplIS4_EEE4callES3_dii+0x14b)[0x7f782bad6b9b]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-deployment-xenomai.so.2.5.0(_ZNK3RTT8internal20FusedMCallDataSourceIFbRKSsdiiEE8evaluateEv+0x95)[0x7f782bb00d25]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-taskbrowser-xenomai.so.2.5.0(_ZN3OCL11TaskBrowser7doPrintEN5boost13intrusive_ptrIN3RTT4base14DataSourceBaseEEEb+0x3e)[0x7f782bd8e84e]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-taskbrowser-xenomai.so.2.5.0(_ZN3OCL11TaskBrowser11printResultEPN3RTT4base14DataSourceBaseEb+0x8f)[0x7f782bd8f38f]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-taskbrowser-xenomai.so.2.5.0(_ZN3OCL11TaskBrowser11evalCommandERSs+0x4be)[0x7f782bd9556e]
> /home/drl/rosstacks/orocos_toolchain/install/lib/liborocos-ocl-taskbrowser-xenomai.so.2.5.0(_ZN3OCL11TaskBrowser4loopEv+0xc9f)[0x7f782bd9927f]
> /home/drl/rosstacks/orocos_toolchain/ocl/bin/deployer-xenomai(main+0x751)[0x40d351]
> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f782ac4676d]
> /home/drl/rosstacks/orocos_toolchain/ocl/bin/deployer-xenomai[0x40d4f1]
> = true
>
> These warnings are making legitimate output from Orocos and our
> software difficult to find. We want these to show if a context switch
> occurs during realtime operation... but we'd like to silence them
> during initialization.

Or there's a bug in your setup code, or there's a bug in RTT. The warn
on switch flag should only be set for specific threads. The above
switch happens in the main() thread, which indeed switches frequently
when executing the taskbrowser.

How did you enable the warn on switch code in your example ?

Peter