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 0E276C433F5 for ; Thu, 12 May 2022 12:36:42 +0000 (UTC) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 557B93CA9D3 for ; Thu, 12 May 2022 14:36:40 +0200 (CEST) Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 21D303C053F for ; Thu, 12 May 2022 14:36:05 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (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-3.smtp.seeweb.it (Postfix) with ESMTPS id A47451A010F3 for ; Thu, 12 May 2022 14:36:04 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 52D161F460; Thu, 12 May 2022 12:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1652358964; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JqBRt2iFXHkQ8EZ/Ae7BhSNTmNZVH/i2JwtWC/QldtI=; b=AV1+2WWPsx9EwbOjqcLf6zY4zgVEYCLg5tsAMxNquPFlLbA73JxecAgoSQJZV0apANbLwu uNWwFdXdmVO2aTqR8IsYunbOjS0nT9WN5WUeJy4XkclxpZYEnN1CIF+eckPETmT2ilHy3W qUrz6X8kVnOvH1WVTt6pkSnQ/0Fncqg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1652358964; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JqBRt2iFXHkQ8EZ/Ae7BhSNTmNZVH/i2JwtWC/QldtI=; b=1fxUJ3I5tcgpQEgAlXExg+TI2unHCB4/Xx3TEKeAUAIbgcSGgbGwzjxkNPD2BPUHsZYcCc aM+rTPren0tUM0DQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3F35513ABE; Thu, 12 May 2022 12:36:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id DJctDjT/fGIQGgAAMHmgww (envelope-from ); Thu, 12 May 2022 12:36:04 +0000 From: Cyril Hrubis To: ltp@lists.linux.it Date: Thu, 12 May 2022 14:37:50 +0200 Message-Id: <20220512123816.24399-4-chrubis@suse.cz> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220512123816.24399-1-chrubis@suse.cz> References: <20220512123816.24399-1-chrubis@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-3.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v3 03/29] mtest06/mmap3: Convert to runtime 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: automated-testing@lists.yoctoproject.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" Signed-off-by: Cyril Hrubis --- testcases/kernel/mem/mtest06/mmap3.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/testcases/kernel/mem/mtest06/mmap3.c b/testcases/kernel/mem/mtest06/mmap3.c index 23609752f..6d47b01e7 100644 --- a/testcases/kernel/mem/mtest06/mmap3.c +++ b/testcases/kernel/mem/mtest06/mmap3.c @@ -23,11 +23,9 @@ static char *str_loops; static char *str_threads; static char *map_private; -static char *str_exec_time; static int loops = 1000; static int threads = 40; -static float exec_time = 24; static volatile int sig_caught; static int threads_running; @@ -109,7 +107,7 @@ static void test_mmap(void) long i; pthread_t thids[threads]; - alarm(exec_time * 3600); + alarm(tst_remaining_runtime()); while (!sig_caught) { for (i = 0; i < threads; i++) { @@ -138,11 +136,6 @@ static void setup(void) if (tst_parse_int(str_threads, &threads, 1, INT_MAX)) tst_brk(TBROK, "Invalid number of threads '%s'", str_threads); - if (tst_parse_float(str_exec_time, &exec_time, 0.0005, 9000)) - tst_brk(TBROK, "Invalid execution time '%s'", str_exec_time); - - tst_set_timeout(exec_time * 3600 + 300); - SAFE_SIGNAL(SIGALRM, sig_handler); SAFE_SIGNAL(SIGBUS, sig_handler); SAFE_SIGNAL(SIGSEGV, sig_handler); @@ -155,7 +148,6 @@ static void setup(void) tst_res(TINFO, "Number of loops %i", loops); tst_res(TINFO, "Number of threads %i", threads); tst_res(TINFO, "MAP_PRIVATE = %i", map_private ? 1 : 0); - tst_res(TINFO, "Execution time %fH", exec_time); } static void cleanup(void) @@ -184,11 +176,11 @@ static struct tst_test test = { {"l:", &str_loops, "Number of map-write-unmap loops"}, {"n:", &str_threads, "Number of worker threads"}, {"p", &map_private, "Turns on MAP_PRIVATE (default MAP_SHARED)"}, - {"x:", &str_exec_time, "float Execution time in hours (default 24H)"}, {} }, .needs_tmpdir = 1, .setup = setup, .cleanup = cleanup, .test_all = test_mmap, + .max_runtime = 86400, }; -- 2.35.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp