From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7FD2AE77184 for ; Thu, 19 Dec 2024 14:17:17 +0000 (UTC) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 028513ED465 for ; Thu, 19 Dec 2024 15:17:16 +0100 (CET) Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [217.194.8.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id B59723E4EFC for ; Thu, 19 Dec 2024 15:16:59 +0100 (CET) Authentication-Results: in-5.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=suse.cz (client-ip=2a07:de40:b251:101:10:150:64:1; helo=smtp-out1.suse.de; envelope-from=pvorel@suse.cz; receiver=lists.linux.it) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 4AD44622654 for ; Thu, 19 Dec 2024 15:16:59 +0100 (CET) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1DEE721166; Thu, 19 Dec 2024 14:16:58 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id F353913A77; Thu, 19 Dec 2024 14:16:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 6RzvOdkqZGfoJQAAD6G6ig (envelope-from ); Thu, 19 Dec 2024 14:16:57 +0000 Date: Thu, 19 Dec 2024 15:16:56 +0100 From: Petr Vorel To: Cyril Hrubis Message-ID: <20241219141656.GC115746@pevik> References: <20241218190029.15015-1-chrubis@suse.cz> <20241218190029.15015-9-chrubis@suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20241218190029.15015-9-chrubis@suse.cz> X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Queue-Id: 1DEE721166 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Virus-Scanned: clamav-milter 1.0.3 at in-5.smtp.seeweb.it X-Virus-Status: Clean Subject: Re: [LTP] [PATCH 8/9] metadata: metaparse: Add a few pre-defined macros X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Petr Vorel Cc: ltp@lists.linux.it Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" 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 > --- > 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 Kind regards, Petr -- Mailing list info: https://lists.linux.it/listinfo/ltp