From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27776 invoked by alias); 16 Oct 2014 22:36:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27682 invoked by uid 89); 16 Oct 2014 22:36:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,LIKELY_SPAM_BODY,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 16 Oct 2014 22:36:46 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9GMagof018283 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 16 Oct 2014 18:36:42 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9GMaehh003825; Thu, 16 Oct 2014 18:36:41 -0400 Message-ID: <54404878.50406@redhat.com> Date: Thu, 16 Oct 2014 22:36:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: "Jose E. Marchesi" , gdb-patches@sourceware.org Subject: Re: [PATCH V2 7/9] Simple testsuite for DTrace USDT probes. References: <1412961772-16249-1-git-send-email-jose.marchesi@oracle.com> <1412961772-16249-8-git-send-email-jose.marchesi@oracle.com> In-Reply-To: <1412961772-16249-8-git-send-email-jose.marchesi@oracle.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-10/txt/msg00445.txt.bz2 Hi Jose, > + set result [catch "exec $dtrace -V" output] Please use "remote_exec host" to invoke tools on the host. > + set dscript_file "${srcdir}/${subdir}/${testfile}.d" > + set out_header_file "${srcdir}/${subdir}/${testfile}.h" Generating files in the ${srcdir} is a no-no. Use standard_output_file to put this in the build dir, and to make it parallel safe. > + set result \ > + [catch "exec $dtrace -h -s $dscript_file -o $out_header_file" output] > + verbose -log $output > + if {$result != 0} { > + fail "invoke dtrace -h to generate the header file for USDT probes" > + return -1 > + } > + > + if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}.o" object {debug}] != ""} { > + fail "compile ${binfile}.o" > + return -1 > + } > + > + set result \ > + [catch "exec $dtrace -G -s $dscript_file ${binfile}.o -o ${binfile}-p.o" output] > + verbose -log $output > + if {$result != 0} { > + fail "invoke dtrace -G to generate the object file with probe information" > + return -1 > + } > + > + if {[gdb_compile "${binfile}.o ${binfile}-p.o" ${binfile} executable {debug}] != ""} { > + fail "compile ${binfile}" > + return -1 > + } Seems like this routine may be general enough that it'd be reused for other tests. How about putting it a new testsuite/lib/dtrace.exp file? It's not usual that failure to compile generates a FAIL. Do we need that? Instead, it's more usual for the caller of a routine that builds the test to call "untested" on build failure. > + gdb_test "break -pdtrace test:two-locations" \ > + "Breakpoint \[0-9\]+ at $hex.*2 locations.*" \ > + "set multii-location probe breakpoint (probe two-locations)" typo "multii". Thanks, Pedro Alves