public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 8/9] metadata: metaparse: Add a few pre-defined macros
Date: Thu, 19 Dec 2024 15:16:56 +0100	[thread overview]
Message-ID: <20241219141656.GC115746@pevik> (raw)
In-Reply-To: <20241218190029.15015-9-chrubis@suse.cz>

Hi Cyril,

> This is used mostly for stripping macro prefixes such as:

> ...
>     "save_restore": [
>       [
>        "/proc/sys/user/max_user_namespaces",
>        null,
> -      "TST_SR_SKIP"
> +      "SKIP"
>       ],
> ...
> -   "needs_cgroup_ver": "TST_CG_V2",
> +   "needs_cgroup_ver": "2",
> ...

> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
>  metadata/metaparse.c | 47 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)

> diff --git a/metadata/metaparse.c b/metadata/metaparse.c
> index 29c03e5c3..fa30be727 100644
> --- a/metadata/metaparse.c
> +++ b/metadata/metaparse.c
> @@ -760,6 +760,51 @@ static void parse_include_macros(FILE *f, int level)
>  	close_include(inc);
>  }

> +/* pre-defined macros that makes the output cleaner. */
> +static const struct macro {
> +	char *from;
> +	char *to;
> +} internal_macros[] = {
> +	{"TST_CG_V2", "2"},
> +	{"TST_CG_V1", "1"},
> +	{"TST_KB", "1024"},
> +	{"TST_MB", "1048576"},
> +	{"TST_GB", "1073741824"},
I guess we need a number for calculation (e.g. 1 * TST_GB)
Otherwise 1 GB would be more readable than a big number.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-12-19 14:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18 19:00 [LTP] [PATCH 0/9] Metadata parser fixes Cyril Hrubis
2024-12-18 19:00 ` [LTP] [PATCH 1/9] metadata: metaparse: Parse operators *, +, and | properly Cyril Hrubis
2024-12-18 19:08   ` Petr Vorel
2024-12-19 10:45     ` Cyril Hrubis
2025-01-09 13:43     ` Cyril Hrubis
2024-12-18 19:00 ` [LTP] [PATCH 2/9] metadata: metaparse: Implement recursive include Cyril Hrubis
2024-12-18 19:10   ` Petr Vorel
2024-12-18 19:00 ` [LTP] [PATCH 3/9] metadata: metaparse: Apply macros in arrays Cyril Hrubis
2024-12-18 19:13   ` Petr Vorel
2024-12-18 19:00 ` [LTP] [PATCH 4/9] metadata: data_storage: Add JSON null type Cyril Hrubis
2024-12-18 19:15   ` Petr Vorel
2024-12-18 19:00 ` [LTP] [PATCH 5/9] metadata: data_storage: Add two array functions Cyril Hrubis
2024-12-18 19:21   ` Petr Vorel
2024-12-19 10:45     ` Cyril Hrubis
2024-12-18 19:00 ` [LTP] [PATCH 6/9] metadata: metaparse: Better array parsing Cyril Hrubis
2024-12-19 14:01   ` Petr Vorel
2024-12-18 19:00 ` [LTP] [PATCH 7/9] metadata: metaparse: Ignore ', ' in array inside parenthesis Cyril Hrubis
2024-12-19 14:13   ` Petr Vorel
2024-12-18 19:00 ` [LTP] [PATCH 8/9] metadata: metaparse: Add a few pre-defined macros Cyril Hrubis
2024-12-19 14:16   ` Petr Vorel [this message]
2024-12-19 14:25     ` Cyril Hrubis
2024-12-27  7:32       ` Petr Vorel
2024-12-18 19:00 ` [LTP] [PATCH 9/9] metadata: parse.sh: Add -Itestcases/kernel/include Cyril Hrubis
2024-12-19 14:17   ` Petr Vorel

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=20241219141656.GC115746@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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