linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: Gabriele Monaco <gmonaco@redhat.com>
Cc: Clark Williams <williams@redhat.com>, linux-rt-users@vger.kernel.org
Subject: Re: [PATCH] rteval: Allow configuration from stdin
Date: Mon, 13 Jan 2025 16:34:08 -0500 (EST)	[thread overview]
Message-ID: <8d23151f-af7c-1b75-eae9-c8d88fa1ec3d@redhat.com> (raw)
In-Reply-To: <20250113121856.225406-1-gmonaco@redhat.com>



On Mon, 13 Jan 2025, Gabriele Monaco wrote:

> Modules can currently be set only via configuration file, if rteval is
> called from a script run on different systems, the only way to make sure
> the loaded modules are known is to provide (or generate) a configuration
> file and pass it via -f/--infile .

The config files are almost obsolete.
Everything has a reasonable default, or can be set from the CMI
The one exception is for the measurement module.

What would be useful would be a CMI interface to switch from rtla timerlat
to cyclictest.

Thanks

> 
> Add the possibility to use - as input file to read the configuration via
> standard input.
> 
> This allows something like:
> 
>  # rteval -f - << EOF
> [measurement]
> timerlat: module
> 
> [loads]
> stressng:  module
> EOF
> 
> Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
> ---
>  rteval/rtevalConfig.py | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/rteval/rtevalConfig.py b/rteval/rtevalConfig.py
> index 0c2fc6b..4c41ed7 100644
> --- a/rteval/rtevalConfig.py
> +++ b/rteval/rtevalConfig.py
> @@ -238,10 +238,14 @@ class rtevalConfig:
>              # Don't try to reread this file if it's already been parsed
>              return
>  
> -        self.__info(f"reading config file {cfgfile}")
>          ini = configparser.ConfigParser()
>          ini.optionxform = str
> -        ini.read(cfgfile)
> +        if cfgfile == "-":
> +            self.__info("reading config file stdin")
> +            ini.read_file(sys.stdin)
> +        else:
> +            self.__info(f"reading config file {cfgfile}")
> +            ini.read(cfgfile)
>  
>          # wipe any previously read config info
>          if not append:
> 
> base-commit: 5edb31a58bea3c2433e817439e053b79221a06df
> -- 
> 2.47.1
> 
> 
> 


  parent reply	other threads:[~2025-01-13 21:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-13 12:18 [PATCH] rteval: Allow configuration from stdin Gabriele Monaco
2025-01-13 12:30 ` Tomas Glozar
2025-01-13 21:34 ` John Kacur [this message]
2025-01-14  6:40   ` Gabriele Monaco
2025-01-14 19:50     ` Crystal Wood
2025-01-14 23:07       ` John Kacur
2025-01-16  1:14         ` Crystal Wood
2025-01-16  6:45           ` Gabriele Monaco
2025-01-16 20:56             ` Crystal Wood

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=8d23151f-af7c-1b75-eae9-c8d88fa1ec3d@redhat.com \
    --to=jkacur@redhat.com \
    --cc=gmonaco@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).