All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Henning Schild <henning.schild@siemens.com>
Cc: "KISZKA, JAN" <jan.kiszka@siemens.com>, xenomai@xenomai.org
Subject: Re: [Xenomai] [RFC] Xenomai3 tuneables replaced by environment variables
Date: Mon, 21 Aug 2017 15:25:14 +0200	[thread overview]
Message-ID: <215ada11-0830-b348-1ddd-09622fa67c48@xenomai.org> (raw)
In-Reply-To: <20170821131253.4852c71b@md1em3qc>

On 08/21/2017 01:12 PM, Henning Schild wrote:
> Am Wed, 16 Aug 2017 20:13:34 +0200
> schrieb Philippe Gerum <rpm@xenomai.org>:
> 
>> On 08/08/2017 09:27 PM, Henning Schild wrote:
>>>   
>>>> Could you sketch the requirements of the app with respect to
>>>> option parsing (namespace left aside)? Is there some main
>>>> non-Xenomai executable dlopening a Xenomai-based solib defining a
>>>> set of rt-specific options?  
>>>
>>> Yes the application runs its own main() and later dlopen() s
>>> multiple libs, some of which may be linked to xenomai. The order of
>>> the dlopens seems hard to control because of static c++
>>> constructors or something alike. But i suggest we discuss the
>>> internals of that particular app after we have finished the
>>> discussion. 
>>
>> No need for this; I was not asking for details about the internals,
>> only for explicit requirements about receiving parameters / options
>> among the software components present in your app. Anyway, I think I
>> figured it out from what you've just said.
>>
>>>> It seems that you are implicitly referring to ancillaries settings
>>>> such as --silent, --verbose and --quiet as being problematic. Is it
>>>> correct or are you referring to other parameters?  
>>>
>>> If your main comes before xenomai_init() it either has to be able to
>>> ignore xenomai args or it will need to change argv/argc before
>>> dlopening.
>>>
>>> In the first case it has to know all valid args  
>>
>> ... the application accepts. Do some (non-Xenomai) dlopened libs
>> define their own option namespace the main component does not know
>> about? If not, this is only a matter of excluding/ignoring the
>> options which the application does not accept when parsing the
>> argument vector.
>>
>> xenomai_init() will do the same afterwards, ignoring the non-Xenomai
>> options transparently. The point being: who should call xenomai_init()
>> in the plugin.so file, and when.
> 
> That basically means that you can not build a very robust parser. The
> problem i see here is a typo in an otherwise valid argument. Both
> xenomai and the application will happily ignore it, creating the
> impression that it was applied.
> 

The parsing sequence is ordered: first the app, then xenomai. If some
arg is left in the argument vector returned by xenomai_init(), then such
arg must be wrong. Turn off the auto-bootstrap feature, providing your
own library constructor for the plugin module, call xenomai_init()
manually there, checking for the output vector, and there will be no
robustness issue.

-- 
Philippe.


  reply	other threads:[~2017-08-21 13:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08  9:23 [Xenomai] [RFC] Xenomai3 tuneables replaced by environment variables Henning Schild
2017-08-08 10:24 ` Philippe Gerum
2017-08-08 11:35   ` Jan Kiszka
2017-08-08 11:48   ` Henning Schild
2017-08-08 18:05     ` Philippe Gerum
2017-08-08 19:27       ` Henning Schild
2017-08-16 18:13         ` Philippe Gerum
2017-08-21 11:12           ` Henning Schild
2017-08-21 13:25             ` Philippe Gerum [this message]
2017-08-25 17:16           ` Henning Schild
2017-08-29 11:05             ` Philippe Gerum
2017-08-29 12:27               ` Henning Schild
2017-08-29 16:10                 ` Philippe Gerum
2017-08-29 17:20                   ` Henning Schild
2017-08-29 20:02                     ` Philippe Gerum
2017-08-29 20:15                       ` Philippe Gerum
2017-08-30  7:42                       ` Henning Schild
2017-08-28  6:25 ` Stéphane Ancelot
2017-08-28  7:32   ` Jan Kiszka

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=215ada11-0830-b348-1ddd-09622fa67c48@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=henning.schild@siemens.com \
    --cc=jan.kiszka@siemens.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.