From patchwork Thu Jul 13 15:37:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Mezentsev X-Patchwork-Id: 119993 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1914768vqm; Thu, 13 Jul 2023 08:49:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlGFAMmPqutTMHJG6vPAJR+DM7RYQ1pdAXuhlvAiQhxl3i+4aDuM9Cw2Ju17Gdipln33ys4K X-Received: by 2002:a17:906:749c:b0:96f:d345:d0f7 with SMTP id e28-20020a170906749c00b0096fd345d0f7mr1677606ejl.62.1689263365298; Thu, 13 Jul 2023 08:49:25 -0700 (PDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id rl8-20020a170907216800b009885462f377si8217962ejb.476.2023.07.13.08.49.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 08:49:25 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Pq2ElTX3; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E11EE385843E for ; Thu, 13 Jul 2023 15:49:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E11EE385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689263363; bh=NZzSR0oJk40drLs+5gI6fcfvuQVRKFcgSU0ICWMs4Ms=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Pq2ElTX3sK97yocsI/gkKyka4wOx4PlfKOMz1m3o4OxK5mBJDFy4ivfU8/J5c66XE DlmgRls+KOeLWB0S+Dlp+x01njBPj/sZHyUZ0ln9vKAr1/6N7Kb3vonbXGvw0SCZUB 6huF0OF9o+n/HqmdpZ7qOU4xWxzUwG0G2TUGBhfw= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id E6EEE3858430 for ; Thu, 13 Jul 2023 15:49:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E6EEE3858430 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36DEJ7fv016963 for ; Thu, 13 Jul 2023 15:49:00 GMT Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rr8xurc3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 13 Jul 2023 15:48:47 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36DEf1BF007159 for ; Thu, 13 Jul 2023 15:48:46 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rpx88hyu3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 13 Jul 2023 15:48:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=akiDPBnW/tBF2rt1FkyzTuo6iIxOX1mu8EGpuhru3Dy+/Z5osYOUT2qOqjOW70oOQ8v/hoYqCQ0ZJrn4xuaWKOvSQKX+xM15MqJJ0qoQszeQinG/3r6725r5Sgfmh4djrXQU3CxJd+vTXe5YbSQb30ztkCM2EUECn+oP3lRh1jyZ+HEv1dEnYtcG9ERaQzJaNI3zzJaJm53Y+vp2yKX97SfKox2lAHnv8htqgo39BwPaHNnSEAznTnR8TymFKzcuNjJIkMYJHqJ8g6FhBJXRw3Qkqcin7NfH4oPdi2V77mSnXraWGnf1si6tFSvuXeNcuVOMeonN22nXp9I7H4OrGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NZzSR0oJk40drLs+5gI6fcfvuQVRKFcgSU0ICWMs4Ms=; b=dKPJXhyS3OYb6YGJkB1YLHOyx4PXCO8EVtw9xFmBoU9wcs+vjHWqvaGZGMg7bKeaDq4dPj4GtJA5o+dRuGBIqny0zWWDCbzfjzHNvMRyLm/xHuvlsjRg6SbdvjZVF9dSY+hAHWWQmSKhvaitj7lghIPSBmZdcZ9IBlDuDcZyDGHEWlzdutxTqMv5c5LRe66FYwaWrgBTpLqnd9hoe7yu3oYAxEMYJuXsSKf436/QgmAFGRY99xJdJZuAgQB1d8jZEbdZPhVr2Legv06YppkgxBK0ujdoaQVkRH87Cqc8KZdL0JFzKbhh/+dTtEXkc/nN+/OsDDxA0PGNix+cpJATZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from SA2PR10MB4636.namprd10.prod.outlook.com (2603:10b6:806:11e::10) by CH0PR10MB5018.namprd10.prod.outlook.com (2603:10b6:610:d8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24; Thu, 13 Jul 2023 15:48:44 +0000 Received: from SA2PR10MB4636.namprd10.prod.outlook.com ([fe80::e0a1:158b:3862:289a]) by SA2PR10MB4636.namprd10.prod.outlook.com ([fe80::e0a1:158b:3862:289a%5]) with mapi id 15.20.6565.028; Thu, 13 Jul 2023 15:48:43 +0000 To: binutils@sourceware.org Cc: Vladimir Mezentsev Subject: [PATCH] gprofng: 30602 [2.41] gprofng test hangs on i686-linux-gnu Date: Thu, 13 Jul 2023 08:37:38 -0700 Message-Id: <20230713153738.2638727-1-vladimir.mezentsev@oracle.com> X-Mailer: git-send-email 2.31.1 X-ClientProxiedBy: SA9P221CA0028.NAMP221.PROD.OUTLOOK.COM (2603:10b6:806:25::33) To SA2PR10MB4636.namprd10.prod.outlook.com (2603:10b6:806:11e::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PR10MB4636:EE_|CH0PR10MB5018:EE_ X-MS-Office365-Filtering-Correlation-Id: d794c610-0f4b-4633-ac28-08db83b8a323 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pnnmygevW9HGAeWxrXVvCwDVv5WJfWKeOtNvXgihfzOcB3aaBrc7ugXn6FySfzlPEKg9/SW9BAVLK+UpXzsHHD3CvJn9wDMqfl9r5x4+odK/ep2TdJstNMlsU1ZBG8MmN7cgDPPy6okNAI04INzBiqGwSGX3oqITl6eojG9aLQcc88q6tXDxWKC3J7Nl047OR5LK7lF+yIl/LQbr2ZFmu4zUEJqj6V2CdJ2Ida/KPMZ2+oSvs/xJkM4s6LIG/tALIkjWQNa/Ojmk3HRzdp3ZXfuG+xFhhvXnqHxvulrR8DXE4ntCRwIxEceOem998xTzVr8whtO+nc3YkRHCL/KKHw3+MdQ+FE7Bdk88LAFHVwKw5eLJJTiBliUS0BtWAJjuSzOG2xFwITs9EAHUTuFYOkUiFJ0/0/dIxQfcnN8eZlMSZNGLDjO9OOMXbEuOlvxKY17swX+mtrnooc4lqkMUOrMQy9aPqwYAm3sWuS6zO1rIn5w3zefh5ryd01htNDYdVo2yVzKjToMou3v5WtXEV6vRoEt0lhtMIDXFUGOPnW4+kDqy28lPVTiwO+V3mxdB X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR10MB4636.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(366004)(39860400002)(396003)(346002)(376002)(136003)(451199021)(6512007)(83380400001)(2906002)(2616005)(30864003)(6916009)(6486002)(66476007)(4326008)(66946007)(66556008)(316002)(9686003)(478600001)(26005)(1076003)(5660300002)(6506007)(107886003)(186003)(8676002)(41300700001)(8936002)(6666004)(38100700002)(86362001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: edWD5ogj/sKfsQzZphGKFH+gxIZ/bdXvq0DJLH/2G1+IIT7xL5moFzFz+qe+wMwp9fdmCBf1xIT2q3d80/KH5mJuFH/MjRm/gKCRLfnD+xG1UgtektHoYTx7RJYqTVt6kQBUD/YNfU18LReN0M3FFxwwotz3UPizoubnagrIeGPKy3R5BN3X20XsEepyyc9c2RYov2PvvSwlmVwy4zzMTWCB1of3vQWIurGfyC3tutPscxCTH9vagx5GZRZfBf1tDo1L+EIip1nFyHYf2x/eD4jPIhvtfBKkyVr62bI4VDdgtMIqCSEJv1GrAQSO9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orOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d794c610-0f4b-4633-ac28-08db83b8a323 X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4636.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 15:48:43.9098 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Goo2s5T2iHKuPsN++fTKm2Wjh8Vf7NfW4pbY2hqGCustPgQnVwudV43w/r8m0hZSnTYBb9Jx0e9pQui7GommfGISuxhYrdHoKlG7/p1gB+Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5018 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-13_06,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307130140 X-Proofpoint-GUID: 8_JeEK9gRlr14plfzdtYyFVgq0QSAwvC X-Proofpoint-ORIG-GUID: 8_JeEK9gRlr14plfzdtYyFVgq0QSAwvC X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Vladimir Mezentsev via Binutils From: Vladimir Mezentsev Reply-To: vladimir.mezentsev@oracle.com Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771321022842872168 X-GMAIL-MSGID: 1771321022842872168 From: Vladimir Mezentsev If there are no rejections, may I cherry-pick this to the [2.41] branch ? There were several problems in the gprofng testing: - we did not catch a timeout for each test. - we used exit() to stop a failed test. But this stops all other tests. - we used a time_t (long) type in smalltest.c instead of a long long type. PR gprofng/30602 * configure.ac: Launch only native testing. * configure: Rebuild. * testsuite/config/default.exp: Set TEST_TIMEOUT. * testsuite/gprofng.display/setpath_map.exp: Use return instead of exit. * testsuite/gprofng.display/gp-archive.exp: Likewise. * testsuite/gprofng.display/gp-collect-app_F.exp: Likewise. * testsuite/gprofng.display/display.exp: Delete an unnecessary test for native testing. * testsuite/lib/display-lib.exp (run_native_host_cmd): Add timeout. * testsuite/lib/smalltest.c: Use a long long type instead of time_t. --- gprofng/configure | 28 +++++-------------- gprofng/configure.ac | 11 ++++---- gprofng/testsuite/config/default.exp | 2 ++ gprofng/testsuite/gprofng.display/display.exp | 7 ----- .../testsuite/gprofng.display/gp-archive.exp | 8 +++--- .../gprofng.display/gp-collect-app_F.exp | 12 ++++++-- .../testsuite/gprofng.display/setpath_map.exp | 6 ++-- gprofng/testsuite/lib/display-lib.exp | 18 ++++++------ gprofng/testsuite/lib/smalltest.c | 10 ++++--- 9 files changed, 44 insertions(+), 58 deletions(-) diff --git a/gprofng/configure b/gprofng/configure index 7aff0be4d57..c39dc8535f7 100755 --- a/gprofng/configure +++ b/gprofng/configure @@ -657,8 +657,6 @@ PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC ax_pthread_config -RUN_TESTS_FALSE -RUN_TESTS_TRUE subdirs BUILD_SRC_FALSE BUILD_SRC_TRUE @@ -12223,7 +12221,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12226 "configure" +#line 12224 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12329,7 +12327,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12332 "configure" +#line 12330 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15762,28 +15760,16 @@ else fi -run_tests=false if test x$build_collector = xtrue; then subdirs="$subdirs libcollector" - if test x${host} = x${target}; then - run_tests=true - fi -fi - if test x$run_tests = xtrue; then - RUN_TESTS_TRUE= - RUN_TESTS_FALSE='#' -else - RUN_TESTS_TRUE='#' - RUN_TESTS_FALSE= fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -16710,7 +16696,11 @@ fi` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libctf_tcl_try" >&5 $as_echo "$ac_cv_libctf_tcl_try" >&6; } - if test "${ac_cv_libctf_tcl_try}" = yes; then + +# Only native testing and only on supported platforms: + if test "${ac_cv_libctf_tcl_try}" = yes \ + -a "x${build_src}" = xtrue -a "x${build_collector}" = xtrue \ + -a "x${host}" = "x${target}"; then TCL_TRY_TRUE= TCL_TRY_FALSE='#' else @@ -17115,10 +17105,6 @@ if test -z "${BUILD_SRC_TRUE}" && test -z "${BUILD_SRC_FALSE}"; then as_fn_error $? "conditional \"BUILD_SRC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${RUN_TESTS_TRUE}" && test -z "${RUN_TESTS_FALSE}"; then - as_fn_error $? "conditional \"RUN_TESTS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${TCL_TRY_TRUE}" && test -z "${TCL_TRY_FALSE}"; then as_fn_error $? "conditional \"TCL_TRY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/gprofng/configure.ac b/gprofng/configure.ac index cba3e4487fd..cfca82e3651 100644 --- a/gprofng/configure.ac +++ b/gprofng/configure.ac @@ -74,14 +74,9 @@ build_src= AM_CONDITIONAL([BUILD_COLLECTOR], [test x$build_collector = xtrue]) AM_CONDITIONAL([BUILD_SRC], [test x$build_src = xtrue]) -run_tests=false if test x$build_collector = xtrue; then AC_CONFIG_SUBDIRS([libcollector]) - if test x${host} = x${target}; then - run_tests=true - fi fi -AM_CONDITIONAL([RUN_TESTS], [test x$run_tests = xtrue]) AX_PTHREAD # Specify a location for JDK @@ -204,7 +199,11 @@ if @<:@llength @<:@info commands try@:>@@:>@ then { puts yes } else { puts no } EOF fi` ]) -AM_CONDITIONAL(TCL_TRY, test "${ac_cv_libctf_tcl_try}" = yes) + +# Only native testing and only on supported platforms: +AM_CONDITIONAL(TCL_TRY, [test "${ac_cv_libctf_tcl_try}" = yes \ + -a "x${build_src}" = xtrue -a "x${build_collector}" = xtrue \ + -a "x${host}" = "x${target}"]) AM_ZLIB diff --git a/gprofng/testsuite/config/default.exp b/gprofng/testsuite/config/default.exp index f76047e2a34..1c862d54592 100644 --- a/gprofng/testsuite/config/default.exp +++ b/gprofng/testsuite/config/default.exp @@ -38,6 +38,8 @@ if { "$CHECK_TARGET" == "check-install" } { set ::env(GPROFNG) "$BUILDDIR/src/gprofng" } +set TEST_TIMEOUT 300 + # Create directories where gprofng can find libraries and binaries: remote_exec host "sh -c \"rm -rf tmpdir; mkdir -p tmpdir\"" remote_exec host "sh -c \"mkdir -p lib; rm -f lib/gprofng; ln -s ../libcollector/.libs lib/gprofng\"" diff --git a/gprofng/testsuite/gprofng.display/display.exp b/gprofng/testsuite/gprofng.display/display.exp index 4698795288f..b0219104f32 100644 --- a/gprofng/testsuite/gprofng.display/display.exp +++ b/gprofng/testsuite/gprofng.display/display.exp @@ -24,13 +24,6 @@ if {[info exists env(LC_ALL)]} { set env(LC_ALL) "C" set pltf [exec uname -i] - -# Native testing only for now. -if { ![istarget $pltf-*-*] - && (![string match i?86 $pltf] || ![istarget i?86-*-*]) } then { - return -} - if { "$pltf" == "aarch64" } { # Use a filter for not leaf functions due to the unwind problem in libgp-collector.so set ::env(ACCT_FILTER) [join { "|egrep -vw 'gpf|tailcallopt|" diff --git a/gprofng/testsuite/gprofng.display/gp-archive.exp b/gprofng/testsuite/gprofng.display/gp-archive.exp index 04871f91682..0dd6196a927 100644 --- a/gprofng/testsuite/gprofng.display/gp-archive.exp +++ b/gprofng/testsuite/gprofng.display/gp-archive.exp @@ -32,7 +32,7 @@ proc check_gp_archive { a_opt } { set out [lindex $output 1] send_log "'$cmd' failed\n" fail $tdir - exit 1 + return -code break } run_native_host_cmd "mv $tdir/t.c $tdir/t.c.1" @@ -42,7 +42,7 @@ proc check_gp_archive { a_opt } { set out [lindex $output 1] send_log "CORRECTSOURCE is not found aafter '$cmd'\n" fail $tdir - exit 1 + return -code break } } @@ -58,7 +58,7 @@ if { [lindex $output 0] != 0 } then { set out [lindex $output 1] send_log "Experiment is not created in $tdir\n" fail $tdir - exit 1 + return } @@ -67,4 +67,4 @@ check_gp_archive src run_native_host_cmd "rm -rf $tdir/exp.er/archives/*; mv $tdir/t.c.1 $tdir/t.c" check_gp_archive usedsrc -pass $dir +pass $tdir diff --git a/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp b/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp index f4aa764642f..f791b0f7a95 100644 --- a/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp +++ b/gprofng/testsuite/gprofng.display/gp-collect-app_F.exp @@ -37,7 +37,13 @@ proc run_gp_collect_app { subExpCnt F_opt } { set out [lindex $output 1] send_log "Experiment is not created in $tdir\n" fail $tdir - exit 1 + return -code break + } + if {[regexp "ERROR:.*LD_PRELOAD" [lindex $output 1] match]} { + set out [lindex $output 1] + send_log "Experiment is not created in $tdir\n" + xfail $tdir + return -code break } set output [run_native_host_cmd "find $tdir -name '*x1.er' | wc -l"] @@ -46,7 +52,7 @@ proc run_gp_collect_app { subExpCnt F_opt } { set out [lindex $output 1] send_log "Test failed for -F $F_opt. subExp=$subExp. Shold be $subExpCnt\n" fail $tdir - exit 1 + return -code break } return $output } @@ -58,5 +64,5 @@ run_gp_collect_app 3 "on" run_gp_collect_app 1 "=mkd.r" run_gp_collect_app 2 "=mkdir|touch" -pass $dir +pass $tdir diff --git a/gprofng/testsuite/gprofng.display/setpath_map.exp b/gprofng/testsuite/gprofng.display/setpath_map.exp index 698076d7c9e..fd0c00b2f03 100644 --- a/gprofng/testsuite/gprofng.display/setpath_map.exp +++ b/gprofng/testsuite/gprofng.display/setpath_map.exp @@ -36,7 +36,7 @@ if { [lindex $output 0] != 0 } then { set out [lindex $output 1] send_log "Experiment is not created in $tdir\n" fail $tdir - exit 1 + return } # Copy the "good" file to $tdir/src. Mark old file as "wrong": @@ -49,7 +49,7 @@ if { [string first "CORRECTSOURCE" [lindex $output 1]] < 0 } then { set out [lindex $output 1] send_log "CORRECTSOURCE is not found in $gprofng display text -setpath $tdir/src -source main $tdir/exp.er\n" fail $tdir - exit 1 + return } # Test -pathmap: @@ -59,7 +59,7 @@ if { [string first "CORRECTSOURCE" [lindex $output 1]] < 0 } then { set out [lindex $output 1] send_log "CORRECTSOURCE is not found in $gprofng display text -pathmap $tdir $tdir/src -source main $tdir/exp.er\n" fail $tdir - exit 1 + return } pass $dir diff --git a/gprofng/testsuite/lib/display-lib.exp b/gprofng/testsuite/lib/display-lib.exp index 0ad81b09bf0..50db4d5055a 100644 --- a/gprofng/testsuite/lib/display-lib.exp +++ b/gprofng/testsuite/lib/display-lib.exp @@ -21,28 +21,26 @@ # Run the COMMAND on the host and return a list of the form # { exit-status OUTPUT }. proc run_native_host_cmd { command } { - global link_output - global ld + global TEST_TIMEOUT verbose -log "$command" set run_output "" try { - set run_output [exec "sh" "-c" "$command" "2>@1"] + send_log "% timeout $TEST_TIMEOUT sh -c '$command' 2>&1\n" + set run_output [exec "timeout" $TEST_TIMEOUT "sh" "-c" "$command" "2>&1"] set status 0 } trap CHILDSTATUS {results options} { set status [lindex [dict get $options -errorcode] 2] - set run_output $results + set run_output "$results" + if { $status == 124 || $status == 133 } { + send_log " ERROR: TIMEOUT($TEST_TIMEOUT sec.)\n" + } } regsub "\n$" $run_output "" run_output if { [lindex $status 0] != 0 && [string match "" $run_output] } then { append run_output "child process exited abnormally" } - - if [string match "" $run_output] then { - return "" - } - - return [list [lindex $status 0] $run_output] + return [list [lindex $status 0] "$run_output"] } # Run a display test in DIR. diff --git a/gprofng/testsuite/lib/smalltest.c b/gprofng/testsuite/lib/smalltest.c index 49bd3957c45..fe6531e1651 100644 --- a/gprofng/testsuite/lib/smalltest.c +++ b/gprofng/testsuite/lib/smalltest.c @@ -1,11 +1,13 @@ #include #include -time_t +typedef long long hrtime_t; + +hrtime_t gethrtime (void) { struct timespec tp; - time_t rc = 0; + hrtime_t rc = 0; #ifdef CLOCK_MONOTONIC_RAW int r = clock_gettime (CLOCK_MONOTONIC_RAW, &tp); #else @@ -13,7 +15,7 @@ gethrtime (void) #endif if (r == 0) - rc = ((time_t) tp.tv_sec) * 1e9 + (time_t) tp.tv_nsec; + rc = ((hrtime_t) tp.tv_sec) * 1e9 + (hrtime_t) tp.tv_nsec; return rc; } @@ -23,7 +25,7 @@ int main (int argc, char **argv) { long long count = 0; - time_t start = gethrtime (); + hrtime_t start = gethrtime (); do {