From patchwork Sat Dec 4 20:11:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 48496 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 89C763858411 for ; Sat, 4 Dec 2021 20:12:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89C763858411 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638648731; bh=mOOOGunlTIpJd0CrmXoElY/lR7vk/d+M47DvVliGTms=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=g5LV2C1+PdWnOptddcHt/zo6GnmCyWMbnZHYGN2c6AQW1bgDSP5snzljwkRj6x02W MCcrOJZHifS4V6Zqb6z0ZFChwzkCLi0IarS3md+9QU2Xp0oY4hAl5ckrNwXm2NI0fC CVkA3/e6BgVy81+esmx3/r0Q0B3ODzNNVcNDYRF0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id 0BF123858D39 for ; Sat, 4 Dec 2021 20:11:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0BF123858D39 Received: by mail-pg1-x52c.google.com with SMTP id r5so6479856pgi.6 for ; Sat, 04 Dec 2021 12:11:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=mOOOGunlTIpJd0CrmXoElY/lR7vk/d+M47DvVliGTms=; b=ZcG+BZOG+JznmX3X3Qeix11tLSLwh0lbuYOdqW8i3VuvhBmHNF6zjdnE6s2Wn0JYhv 6AdrW0JOlTzUX9Gur0lShkKdc26TgKQaT+uU89/f7RmSE9rwyY4f/BnA6qNMhFy6Ou81 fAf65dOEtL2pexshnyg8GrTlWmejbro/J6LNOrqpNEAPCYTGyFzhoJWYpuuEsOuV2vuZ l952pDKZHnKqDIC4j3qZ7L9dVd+dhgWnlZ+RSc72WCM+79TKmJNQlpG0wtjR5uH9cy9y cPiYG/BOuePmcmBi6FXHv8M7dFXZga81m2PqpfyW3j7e313z2t5SltdCiOX5HOY8Ed7R +naQ== X-Gm-Message-State: AOAM530u7UDick/dFNl1qlotr5JRIXqdw76m7TNX9oJC3sH98L1l/BCt 3W0W/yd88boP/Ls6qYLWhWn6cdH3lSY= X-Google-Smtp-Source: ABdhPJwxOJ1NKR7DZ12pDSQ6H58dBnCXuUaOn1uyh8yFf7Yctrx8089tm6O0XwlbO0aCjdFmwYRElQ== X-Received: by 2002:a63:da17:: with SMTP id c23mr10751574pgh.44.1638648704835; Sat, 04 Dec 2021 12:11:44 -0800 (PST) Received: from gnu-tgl-3.localdomain (71-222-78-46.lsv2.qwest.net. [71.222.78.46]) by smtp.gmail.com with ESMTPSA id x14sm5856656pjl.27.2021.12.04.12.11.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Dec 2021 12:11:44 -0800 (PST) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 00578C007F for ; Sat, 4 Dec 2021 12:11:43 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH] Add --with-timeoutfactor=NUM to specify TIMEOUTFACTOR Date: Sat, 4 Dec 2021 12:11:43 -0800 Message-Id: <20211204201143.3748446-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3031.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" On Ice Lake and Tiger Lake laptops, some test programs timeout when there are 3 "make check -j8" runs in parallel. Add --with-timeoutfactor=NUM to specify an integer to scale the timeout of test programs, which can be overriden by TIMEOUTFACTOR environment variable. --- INSTALL | 3 +++ config.h.in | 3 +++ configure | 16 ++++++++++++++++ configure.ac | 7 +++++++ manual/install.texi | 3 +++ support/support_test_main.c | 2 +- 6 files changed, 33 insertions(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 02dcf6b1ca..6ae7ffd7f1 100644 --- a/INSTALL +++ b/INSTALL @@ -106,6 +106,9 @@ if 'CFLAGS' is specified it must enable optimization. For example: particular case and potentially change debugging information and metadata only). +'--with-timeoutfactor=NUM' + Specify an integer NUM to scale the timeout of test programs. + '--disable-shared' Don't build shared libraries even if it is possible. Not all systems support shared libraries; you need ELF support and diff --git a/config.h.in b/config.h.in index 0a6f57b006..2f5124684e 100644 --- a/config.h.in +++ b/config.h.in @@ -196,6 +196,9 @@ /* Define to 1 if libpthread actually resides in libc. */ #define PTHREAD_IN_LIBC 0 +/* An integer used to scale the timeout of test programs. */ +#define TIMEOUTFACTOR 1 + /* */ diff --git a/configure b/configure index 2f9adca064..e4d013907c 100755 --- a/configure +++ b/configure @@ -764,6 +764,7 @@ with_selinux with_headers with_default_link with_nonshared_cflags +with_timeoutfactor enable_sanity_checks enable_shared enable_profile @@ -1482,6 +1483,8 @@ Optional Packages: --with-default-link do not use explicit linker scripts --with-nonshared-cflags=CFLAGS build nonshared libraries with additional CFLAGS + --with-timeoutfactor=NUM + specify an integer to scale the timeout --with-cpu=CPU select code for CPU variant Some influential environment variables: @@ -3386,6 +3389,19 @@ fi + +# Check whether --with-timeoutfactor was given. +if test "${with_timeoutfactor+set}" = set; then : + withval=$with_timeoutfactor; timeoutfactor=$withval +else + timeoutfactor=1 +fi + +cat >>confdefs.h <<_ACEOF +#define TIMEOUTFACTOR $timeoutfactor +_ACEOF + + # Check whether --enable-sanity-checks was given. if test "${enable_sanity_checks+set}" = set; then : enableval=$enable_sanity_checks; enable_sanity=$enableval diff --git a/configure.ac b/configure.ac index 7eb4239359..a91a7f399c 100644 --- a/configure.ac +++ b/configure.ac @@ -163,6 +163,13 @@ AC_ARG_WITH([nonshared-cflags], [extra_nonshared_cflags=]) AC_SUBST(extra_nonshared_cflags) +AC_ARG_WITH([timeoutfactor], + AS_HELP_STRING([--with-timeoutfactor=NUM], + [specify an integer to scale the timeout]), + [timeoutfactor=$withval], + [timeoutfactor=1]) +AC_DEFINE_UNQUOTED(TIMEOUTFACTOR, $timeoutfactor) + AC_ARG_ENABLE([sanity-checks], AS_HELP_STRING([--disable-sanity-checks], [really do not use threads (should not be used except in special situations) @<:@default=yes@:>@]), diff --git a/manual/install.texi b/manual/install.texi index 46f73b538d..832a7ac0fe 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -131,6 +131,9 @@ that the objects in @file{libc_nonshared.a} are compiled with this flag (although this will not affect the generated code in this particular case and potentially change debugging information and metadata only). +@item --with-timeoutfactor=@var{NUM} +Specify an integer @var{NUM} to scale the timeout of test programs. + @c disable static doesn't work currently @c @item --disable-static @c Don't build static libraries. Static libraries aren't that useful these diff --git a/support/support_test_main.c b/support/support_test_main.c index 66a754b84f..0e07dc53cd 100644 --- a/support/support_test_main.c +++ b/support/support_test_main.c @@ -286,7 +286,7 @@ support_test_main (int argc, char **argv, const struct test_config *config) int direct = 0; /* Directly call the test function? */ int status; int opt; - unsigned int timeoutfactor = 1; + unsigned int timeoutfactor = TIMEOUTFACTOR; pid_t termpid; /* If we're debugging the test, we need to disable timeouts and use