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 EB974C3064D for ; Thu, 27 Jun 2024 13:47:25 +0000 (UTC) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 7D82A3D1228 for ; Thu, 27 Jun 2024 15:47:24 +0200 (CEST) Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) (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 F3AAE3D1228 for ; Thu, 27 Jun 2024 15:47:07 +0200 (CEST) Authentication-Results: in-6.smtp.seeweb.it; spf=pass (sender SPF authorized) smtp.mailfrom=suse.cz (client-ip=2a07:de40:b251:101:10:150:64:2; helo=smtp-out2.suse.de; envelope-from=mdoucha@suse.cz; receiver=lists.linux.it) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) (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-6.smtp.seeweb.it (Postfix) with ESMTPS id E0BD31402FB2 for ; Thu, 27 Jun 2024 15:47:06 +0200 (CEST) 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-out2.suse.de (Postfix) with ESMTPS id 6EAEC1FBF2; Thu, 27 Jun 2024 13:47:05 +0000 (UTC) Authentication-Results: smtp-out2.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 5F552137DF; Thu, 27 Jun 2024 13:47:05 +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 ipmOFlltfWabZwAAD6G6ig (envelope-from ); Thu, 27 Jun 2024 13:47:05 +0000 Message-ID: Date: Thu, 27 Jun 2024 15:47:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Cyril Hrubis , ltp@lists.linux.it References: <20240627133456.11327-1-chrubis@suse.cz> From: Martin Doucha Autocrypt: addr=mdoucha@suse.cz; keydata= xsFNBF1D6M0BEAC5BHC0NuN/v+UBXDYuwuYeAJA4leuKz0H76YBevziJKUtnzMsBA+GT9vdH bs60wdsTbBJ1XqmQ/HWDPBV0OIGox195GSZQFblKOY1YoFXV6cv9Kyw4LyYeqozRhGx8NuE8 +qC62nuV97k7GgiDE8onWfPd7wsLBdavZO7qgxRTqbjnf/hReHCPqcts3QEYaLaL5eCfW9gY 6m8wGuF3k7xg7z591dkI7Xfu5rB5IhFcZGLIc+Q1RNEYz+OBP+MnNUSrGPdbFOIgd2jyYRFR npj+OkrPFaZvteQvj8GCwPv/HIStRM9gW6RTGIVw2fTMGGCQb2Jp7Fq51GkKIECRnlhQVJ11 CIndtWP8p2NoxcWA0GH1Y1jjWcV+YvbtflFTQAwsJ5wIiZYvaHhN8VQlS5o1wCjSjPSAzlId XaN3BqM0w2su/dH9EqVZsGee04U2ZqNfrRmGfUICW6XDZRP2ozlJEKHNO0ZZqRt5bjFaelAf X1MgkyDFUikAkstZ6MErt89DlegUNo6GQqAYt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hTtLZRxrqusibeRSj14j0xAuEsDZD3VbMD7fnlTDSyjdY0ghHygq/5 YchPWWq+T2P32r/hxymkw0EiQptA13TElxj13Pbc2hP+e0SoEKFkHfyb63rik3dlPmxGk5eM Rz4zFhW8KQ9+zrae5rL/6vwz3d/MpEeOmDm9uutE6xyzXRl/RxeFZ8P7KlACXWm7VjSyc74E eCNL6GOOeqzE77fDcBf4HvNGn8w7IX/FvNzmu78wzT2MDwMi8ug8T4KEKzIYUIRibe7cl0LG 2dSj02pOT7E5/x4gKQB/OZqnTTQxJ0OL8BJKNFeSYqaMzKFKiYaArwuFkGnCknwh5A== In-Reply-To: <20240627133456.11327-1-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: 6EAEC1FBF2 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Virus-Scanned: clamav-milter 1.0.3 at in-6.smtp.seeweb.it X-Virus-Status: Clean Subject: Re: [LTP] [PATCH v2] include/tst_timer: Add TST_NO_LIBLTP 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: , Cc: kernel-team@android.com, John Stultz , Darren Hart Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" Hi, this is a lot of unnecessary code to fix a problem that didn't exist in the original sched_football patch. I'd prefer one of two other solutions: 1) go back to using ts_delta() from the original patch 2) fully port the test to new LTP API On 27. 06. 24 15:34, Cyril Hrubis wrote: > Older compilers (gcc-4.8) are not smart enough to eliminate the > impossible branch with tst_brk() early enough and the sched_football > compilation fails due to the unresolved function. > > Add TST_NO_LIBLTP macro that adds tst_brk_() inline implementaiont that > prints the message and calls abort() and make use of it in sched_football. > > Cc: kernel-team@android.com > Cc: Darren Hart > Cc: John Stultz > Signed-off-by: Cyril Hrubis > --- > include/tst_test.h | 23 +++++++++++++++++++ > .../func/sched_football/sched_football.c | 1 + > 2 files changed, 24 insertions(+) > > diff --git a/include/tst_test.h b/include/tst_test.h > index 8dc20d110..9bd1b363d 100644 > --- a/include/tst_test.h > +++ b/include/tst_test.h > @@ -648,4 +648,27 @@ int main(int argc, char *argv[]) > #define TST_TEST_TCONF(message) \ > static struct tst_test test = { .tconf_msg = message } \ > > +/* > + * Fallback for cases where we do not want to link against ltp library. > + * > + * This allows us for instance to use tst_timer.h without LTP library. > + */ > +#ifdef TST_NO_LIBLTP > +__attribute__ ((format (printf, 4, 5))) > +inline void tst_brk_(const char *file, const int lineno, int ttype, > + const char *fmt, ...) > +{ > + va_list va; > + > + (void) ttype; > + > + fprintf(stderr, "%s: %i: ", file, lineno); > + va_start(va, fmt); > + vfprintf(stderr, fmt, va); > + va_end(va); > + > + abort(); > +} > +#endif > + > #endif /* TST_TEST_H__ */ > diff --git a/testcases/realtime/func/sched_football/sched_football.c b/testcases/realtime/func/sched_football/sched_football.c > index b6ae692af..6846978f4 100644 > --- a/testcases/realtime/func/sched_football/sched_football.c > +++ b/testcases/realtime/func/sched_football/sched_football.c > @@ -74,6 +74,7 @@ > #include > #include > #define TST_NO_DEFAULT_MAIN > +#define TST_NO_LIBLTP > #include > > -- Martin Doucha mdoucha@suse.cz SW Quality Engineer SUSE LINUX, s.r.o. CORSO IIa Krizikova 148/34 186 00 Prague 8 Czech Republic -- Mailing list info: https://lists.linux.it/listinfo/ltp