From patchwork Thu Feb 26 15:04:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 443966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6AB9E1400EA for ; Fri, 27 Feb 2015 02:05:05 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=rYG1+TpQ; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=t7qQadzu0swFJzSvkksJRaWQEPP+DoGDcktix0BVkmwRQA JrRJ2HCrdsDVLtVEVtfiVgeEEvVsTIXF6WZRykhqF86DrYtiusaJJkBU/F5XeDdD /3JRE33tR70VFHr73gALt1qt8p+L3qFW+8Qfm0hoGFdHPbsWh4OilwKdik/vM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=yFlo1YZGCppGea9k36J/zmStG8g=; b=rYG1+TpQ9ja6mJGFTEtQ Fc28dp1ltCo5Tg9NEuRn2xclqVi6Ukefc4QRFoKi8nHeBxP7EI3Dko+HQreADMAu SCH+iH07uPbdTh/0kEU2Rj6G5jwkJiYnTkhxPvYYWVnAywEFVDQscizmtLky+6XA LVQJTT6n2K22cqjKxJOGHqo= Received: (qmail 31583 invoked by alias); 26 Feb 2015 15:04:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 31510 invoked by uid 89); 26 Feb 2015 15:04:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Feb 2015 15:04:40 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-03.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1YQzzQ-00006s-3G from Tom_deVries@mentor.com ; Thu, 26 Feb 2015 07:04:36 -0800 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-03.mgc.mentorg.com (137.202.0.108) with Microsoft SMTP Server id 14.3.224.2; Thu, 26 Feb 2015 15:04:34 +0000 Message-ID: <54EF3600.6080300@mentor.com> Date: Thu, 26 Feb 2015 16:04:32 +0100 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: GCC Patches , Mike Stump Subject: [patch, testsuite] Add profopt-target-cleanup Hi, this patch adds proc profopt-target-cleanup, which cleans up profile files, while also taking dg-additional-sources into account. Using profopt-target-cleanup in profopt-execute, we cleanup f.i. ic-misattribution-1a.gcda after running the tree-prof/ic-misattribution-1.c testcase. OK for stage4 trunk? Thanks, - Tom 2015-02-26 Tom de Vries * lib/profopt.exp (profopt-target-cleanup): New proc. (profopt-execute): Use profopt-target-cleanup to handle cleanup of files from sources from dg-additional-sources. --- gcc/testsuite/lib/profopt.exp | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/gcc/testsuite/lib/profopt.exp b/gcc/testsuite/lib/profopt.exp index 6c01a87..027ae9d 100644 --- a/gcc/testsuite/lib/profopt.exp +++ b/gcc/testsuite/lib/profopt.exp @@ -81,6 +81,30 @@ proc profopt-cleanup { testcase extlist } { } # +# profopt-target-cleanup -- remove profiling result files. +# +# DIR is the name of the directory +# TESTCASE is the name of the test +# EXT is the extensions of files to remove +# +proc profopt-target-cleanup { dir testcase ext } { + global additional_sources_used + set basename [file tail $testcase] + set base [file rootname $basename] + set file "$dir/$base.$ext" + eval "remote_file target delete $file" + + if [info exists additional_sources_used] { + foreach srcfile $additional_sources_used { + set basename [file tail $srcfile] + set base [file rootname $basename] + set file "$dir/$base.$ext" + eval "remote_file target delete $file" + } + } +} + +# # profopt-perf-value -- get performance value for a test # # TESTCASE is the name of the test @@ -262,10 +286,7 @@ proc profopt-execute { src } { remote_file build delete $execname3 verbose "Testing $testcase, $option" 1 - # Remove old profiling and performance data files. - foreach ext $prof_ext { - remote_file target delete $tmpdir/$base.$ext - } + # Remove old performance data files. if [info exists perf_ext] { profopt-cleanup $testcase $perf_ext } @@ -285,6 +306,12 @@ proc profopt-execute { src } { set extra_options [dg-additional-files-options "" "$src"] + # Remove old profiling data files. Make sure additional_sources_used is + # valid, by running it after dg-additional-files-options. + foreach ext $prof_ext { + profopt-target-cleanup $tmpdir $base $ext + } + # Tree profiling requires TLS runtime support, which may need # additional flags. if { [string first "-fprofile-generate" $profile_option] >= 0 } { @@ -368,7 +395,7 @@ proc profopt-execute { src } { # Remove the profiling data files. foreach ext $prof_ext { - remote_file target delete $tmpdir/$base.$ext + profopt-target-cleanup $tmpdir $base $ext } if { $status != "pass" } { -- 1.9.1