All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] --session= is not a recognized option when using Posix skin
@ 2017-10-06  1:58 Giulio Moro
  2017-10-06  8:27 ` Philippe Gerum
  0 siblings, 1 reply; 4+ messages in thread
From: Giulio Moro @ 2017-10-06  1:58 UTC (permalink / raw)
  To: xenomai

On Xenomai 3.0.5, if I compile a program with the posix skin and I try to run it with `--session=mySessionName`, it errors as it cannot find the `--session` option. This is strange, because main() is definitely getting wrapped: if I run `--help`, it does show some Xenomai command-line options:
--main-prio=<prio>		main thread priority
--print-buffer-size=<bytes>	size of a print relay buffer (16k)
--print-buffer-count=<num>	number of print relay buffers (4)
--print-buffer-syncdelay=<ms>	max delay of output synchronization (100 ms)
--cpu-affinity=<cpu[,cpu]...>	set CPU affinity of threads
--[no-]sanity			disable/enable sanity checks
--verbose[=level] 		set verbosity to desired level [=1]
--silent, --quiet 		same as --verbose=0
--trace[=level] 		set tracing to desired level [=1]
--version			get version information
--dump-config			dump configuration settings
--help				display help

When I build a program with the Alchemy skin, then `--session` works just fine, and `--help` displays a number of additional options:
--alchemy-clock-resolution=<ns> tick value (default 1ns, tickless)
--mem-pool-size=<size[K|M|G]> 	size of the main heap
--no-registry			suppress object registration
--shared-registry		enable public access to registry
--registry-root=<path>		root path of registry
--session=<label>[/<group>]	enable shared session

I am linking with `/usr/xenomai/bin/xeno-config --ldflags --skin=posix`, which gives the following on my system (Beaglebone Black, kernel 4.4.87)
-Wl,--no-as-needed -Wl,@/usr/xenomai/lib/cobalt.wrappers -Wl,@/usr/xenomai/lib/modechk.wrappers  /usr/xenomai/lib/xenomai/bootstrap.o -Wl,--wrap=main -Wl,--dynamic-list=/usr/xenomai/lib/dynlist.ld -L/usr/xenomai/lib -lcobalt -lmodechk -lpthread -lrt

Thanks,
Giulio

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

* Re: [Xenomai] --session= is not a recognized option when using Posix skin
  2017-10-06  1:58 [Xenomai] --session= is not a recognized option when using Posix skin Giulio Moro
@ 2017-10-06  8:27 ` Philippe Gerum
  2017-10-07  1:33   ` Giulio Moro
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Gerum @ 2017-10-06  8:27 UTC (permalink / raw)
  To: Giulio Moro, xenomai

On 10/06/2017 03:58 AM, Giulio Moro wrote:
> On Xenomai 3.0.5, if I compile a program with the posix skin and I try to run it with `--session=mySessionName`, it errors as it cannot find the `--session` option. This is strange, because main() is definitely getting wrapped: if I run `--help`, it does show some Xenomai command-line options:
> --main-prio=<prio>		main thread priority
> --print-buffer-size=<bytes>	size of a print relay buffer (16k)
> --print-buffer-count=<num>	number of print relay buffers (4)
> --print-buffer-syncdelay=<ms>	max delay of output synchronization (100 ms)
> --cpu-affinity=<cpu[,cpu]...>	set CPU affinity of threads
> --[no-]sanity			disable/enable sanity checks
> --verbose[=level] 		set verbosity to desired level [=1]
> --silent, --quiet 		same as --verbose=0
> --trace[=level] 		set tracing to desired level [=1]
> --version			get version information
> --dump-config			dump configuration settings
> --help				display help
> 
> When I build a program with the Alchemy skin, then `--session` works just fine, and `--help` displays a number of additional options:
> --alchemy-clock-resolution=<ns> tick value (default 1ns, tickless)
> --mem-pool-size=<size[K|M|G]> 	size of the main heap
> --no-registry			suppress object registration
> --shared-registry		enable public access to registry
> --registry-root=<path>		root path of registry
> --session=<label>[/<group>]	enable shared session
> 
> I am linking with `/usr/xenomai/bin/xeno-config --ldflags --skin=posix`, which gives the following on my system (Beaglebone Black, kernel 4.4.87)
> -Wl,--no-as-needed -Wl,@/usr/xenomai/lib/cobalt.wrappers -Wl,@/usr/xenomai/lib/modechk.wrappers  /usr/xenomai/lib/xenomai/bootstrap.o -Wl,--wrap=main -Wl,--dynamic-list=/usr/xenomai/lib/dynlist.ld -L/usr/xenomai/lib -lcobalt -lmodechk -lpthread -lrt
> 

This feature is implemented by the so-called "copperplate" interface
libalchemy depends on. The POSIX API does not depend on copperplate, so
you don't have support for multi-process sessions when linking against
libcobalt exclusively. See there http://xenomai.org/start-here/.

-- 
Philippe.


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

* Re: [Xenomai] --session= is not a recognized option when using Posix skin
  2017-10-06  8:27 ` Philippe Gerum
@ 2017-10-07  1:33   ` Giulio Moro
  2017-10-16  8:23     ` Henning Schild
  0 siblings, 1 reply; 4+ messages in thread
From: Giulio Moro @ 2017-10-07  1:33 UTC (permalink / raw)
  To: Philippe Gerum, xenomai

> The POSIX API does not depend on copperplate, so
> you don't have support for multi-process sessions when linking against
> libcobalt exclusively. 

Ok. All we need this for is to prevent multiple instances of our program to be started at the same time. What would you suggest as the best way to check for the existence of a given real-time task using the POSIX API? We could just grep /proc/xenomai/sched/stat, or is there a better solution?

Thanks,
Giulio

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

* Re: [Xenomai] --session= is not a recognized option when using Posix skin
  2017-10-07  1:33   ` Giulio Moro
@ 2017-10-16  8:23     ` Henning Schild
  0 siblings, 0 replies; 4+ messages in thread
From: Henning Schild @ 2017-10-16  8:23 UTC (permalink / raw)
  To: Giulio Moro; +Cc: xenomai

On Sat, 7 Oct 2017 01:33:06 +0000
Giulio Moro <g.moro@qmul.ac.uk> wrote:

> > The POSIX API does not depend on copperplate, so
> > you don't have support for multi-process sessions when linking
> > against libcobalt exclusively.   
> 
> Ok. All we need this for is to prevent multiple instances of our
> program to be started at the same time. What would you suggest as the
> best way to check for the existence of a given real-time task using
> the POSIX API? We could just grep /proc/xenomai/sched/stat, or is
> there a better solution?

In the init-phase your process is probably not real-time yet. So you
can implement a PID-file-based singleton or something alike. Or offload
that task to systemd or whatever you use as init-system.

Henning

> Thanks,
> Giulio
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai



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

end of thread, other threads:[~2017-10-16  8:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06  1:58 [Xenomai] --session= is not a recognized option when using Posix skin Giulio Moro
2017-10-06  8:27 ` Philippe Gerum
2017-10-07  1:33   ` Giulio Moro
2017-10-16  8:23     ` Henning Schild

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.