From patchwork Thu Mar 28 12:50:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 32042 Received: (qmail 82807 invoked by alias); 28 Mar 2019 12:50:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 82773 invoked by uid 89); 28 Mar 2019 12:50:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-23.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, MIME_BASE64_BLANKS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=It=e2, It?= X-HELO: EUR02-HE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr10063.outbound.protection.outlook.com (HELO EUR02-HE1-obe.outbound.protection.outlook.com) (40.107.1.63) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 28 Mar 2019 12:50:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wnpTezM39ZLVk2HmBVeUjPRPIMnO3C1FHcP+Y39H+dU=; b=Gme26Bs1EVZvLbox1+MRB7sKjD05Oa1nKl1LWWrYMzJbOsDkba7ANXaa1HIOokIQ6MGVD1nSxCQ6gpzsSPJKs+r2/vKmeYmBoeFGJYLCCTDSZxN3hRxJPWQnBV/uyL4jI0O52+/FFH1jzPgOORuB6tXar2ibFIsh6ZZXEClVNow= Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.227.22) by DB6PR0802MB2469.eurprd08.prod.outlook.com (10.172.250.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.17; Thu, 28 Mar 2019 12:50:25 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::d122:4a29:4ae4:790c]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::d122:4a29:4ae4:790c%10]) with mapi id 15.20.1750.014; Thu, 28 Mar 2019 12:50:25 +0000 From: Alan Hayward To: Pedro Alves CC: Kevin Buettner , GDB Patches , nd Subject: Re: [RFC/PATCH] Testsuite: set sysroot when using gdbserver Date: Thu, 28 Mar 2019 12:50:25 +0000 Message-ID: <655F33FF-0FD8-4478-A765-F76F004FB317@arm.com> References: <20190327164025.48105-1-alan.hayward@arm.com> <20190327134915.5e9b19ba@f29-4.lan> <20190327221438.1fade1ef@f29-4.lan> <3C508419-659A-46F9-915E-0F96AF6FBC91@arm.com> In-Reply-To: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-IsSubscribed: yes > On 28 Mar 2019, at 11:32, Pedro Alves wrote: > > On 03/28/2019 11:02 AM, Alan Hayward wrote: >> >> >>> On 28 Mar 2019, at 05:14, Kevin Buettner wrote: >>> >>> Hi Alan, >>> >>> I want to apologize in case my latter comment came across as harsh. I >>> think I could have phrased it more diplomatically. >> >> Oh, no, that’s fine :) >> >>> >>> I'll note that I also have an interest in setting up sysroot for the >>> OpenMP tests that I've been working on. So I am genuinely interested >>> in whether or how sysroot can be set from a board file. >>> >>> Also, making the tests run faster is definitely a good thing, so >>> thanks for looking into this. >> > > IMO we could also look at this from the perspective that the slowness is > something that we should tackle, improve in gdb somehow. For example, we > could improve caching a lot. We have a readahead cache for vFile:pread, but > we could also have a persistent cache layer, so that we wouldn't be > downloading the same shared library files over and over again. Will caching only effect extended gdbserver (which AIUI, gdbserver stays alive between tests)? It’s not an area I’ve (yet) looked at. > >> >> I don’t know much about how the board files work, but, looks like I can >> just add a flag via “set_board_info” in the relevant board files. >> >> I can then check for it at the end of gdbserver_start. Or instead check >> at the same place “target remote” is run (although I couldn’t find where >> that was yesterday!). > > Probably just adding > > set GDBFLAGS "${GDBFLAGS} -ex \"set sysroot /\"" > > to testsuite/boards/local-board.exp is all you'd need. That fixes it! And logically makes sense too. Works fine on the buildbot slave. > > I think it'd be good to have a testcase in gdb.server/ that explicitly > tests debugging a bit with "set sysroot target:" enabled, so that we > don't lose coverage of that. Agreed. Happy to raise that as a new patch next week - trying to avoid writing anything new as I’m not really here today. Is the following patch ok for pushing? Given you told me the line to add, I wasn’t sure if I should be adding you to the changelog line too :) Testsuite: set sysroot when using gdbserver When testing using native-gdbserver and native-extended-gdbserver, the sysroot is not set. This results in a warning from GDB and files are sent via the remote protocol, which can be slow. On Ubuntu 18.04 (unlike most distros) the debug versions of the standard libraries are included by default in /usr/lib/debug/. These file reads are causing a complete native-gdbserver run on the AArch64 buildbot slave to timeout after 2.5 hours. This is also causing the builds to back up on the slave. The solution is to ensure the sysroot is set to / for all local boards. This drastically reduces the time of a test. For example, gdb.base/sigall.exp drops from 23 seconds to 4 seconds. A full native-gdbserver run on the AArch64 slave now takes 8 minutes. gdb/testsuite/ChangeLog: 2019-03-28 Alan Hayward Pedro Alves * boards/local-board.exp: set sysroot to /. diff --git a/gdb/testsuite/boards/local-board.exp b/gdb/testsuite/boards/local-board.exp index 4150f1d1d6..bf710f4632 100644 --- a/gdb/testsuite/boards/local-board.exp +++ b/gdb/testsuite/boards/local-board.exp @@ -22,3 +22,6 @@ global board_info # Remove any target variant specifications from the name. set baseboard [lindex [split $board "/"] 0] set board_info($baseboard,isremote) 0 + +# Set sysroot to avoid sending files via the remote protocol. +set GDBFLAGS "${GDBFLAGS} -ex \"set sysroot /\""