From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11320 invoked by alias); 12 Jul 2014 17:42:31 -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 11294 invoked by uid 89); 12 Jul 2014 17:42:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham 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; Sat, 12 Jul 2014 17:42:27 +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 s6CHgMDs003779 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 12 Jul 2014 13:42:22 -0400 Received: from host2.jankratochvil.net (ovpn-116-54.ams2.redhat.com [10.36.116.54]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6CHgH0u003222 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Sat, 12 Jul 2014 13:42:20 -0400 Date: Sat, 12 Jul 2014 20:25:00 -0000 From: Jan Kratochvil To: Doug Evans Cc: Eli Zaretskii , gdb-patches Subject: [testsuite patch] Re: Regression for GDB global --statistics Message-ID: <20140712174217.GA1478@host2.jankratochvil.net> References: <20140630171333.GA2225@host2.jankratochvil.net> <21437.45024.997531.453750@ruffy.mtv.corp.google.com> <20140711212537.GA19551@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00304.txt.bz2 --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 2150 On Fri, 11 Jul 2014 23:33:43 +0200, Doug Evans wrote: > On Fri, Jul 11, 2014 at 2:25 PM, Jan Kratochvil > wrote: > > On Wed, 09 Jul 2014 23:10:56 +0200, Doug Evans wrote: > >> --- a/gdb/testsuite/gdb.base/maint.exp > >> +++ b/gdb/testsuite/gdb.base/maint.exp > >> @@ -130,10 +130,11 @@ gdb_expect { > >> # tests here!! > >> gdb_test_no_output "maint check-symtabs" > >> > >> +# Test per-command stats. > >> gdb_test_no_output "maint set per-command on" > >> - > >> -gdb_test "maint set per-command off" \ > >> +gdb_test "pwd" \ > >> "Command execution time: \[0-9.\]+ \\(cpu\\), \[0-9.\]+ \\(wall\\)\[\r\n\]+Space used: $decimal \\(\\+$decimal for this command\\)\[\r\n\]+#symtabs: $decimal \\(\\+$decimal\\), #primary symtabs: $decimal \\(\\+$decimal\\), #blocks: $decimal \\(\\+$decimal\\)" > >> +gdb_test_no_output "maint set per-command off" > > > > Is it needed to change this behavior? It may break some user scripts working > > fine with previous GDB stable releases. > > Change in behaviour of something related to a maintenance command? > Or were you referring to something else? I am referring to the required change above - which will be required even for other expect-like scripts using "maint set per-command off". But in the end I am OK with it, it makes sense to no longer print the stats after "maint set per-command off". > One problem I wish to avoid is not doing anything expensive unnecessarily. > And here that translates to not computing the values of statistics > from before a command executes (so that one can then print the delta > after it completes) if said statistics will not be printed. That then > translates to any turning on of a statistics-reporting command (mt set > per-command foo) will not take effect until the next command. How > will that be a problem? I was considering a problem that "maint set per-command off" output has changed. No matter what it was before and no matter what it is now. > > Besides that the startup statistics regression is not tested here but I can > > post then a testcase for it. > > As you wish. Thanks. Done below. Thanks, Jan --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="stats.patch" Content-length: 1503 gdb/testsuite/ 2014-07-12 Jan Kratochvil * gdb.base/statistics.exp: New file. diff --git a/gdb/testsuite/gdb.base/statistics.exp b/gdb/testsuite/gdb.base/statistics.exp new file mode 100644 index 0000000..22d6f04 --- /dev/null +++ b/gdb/testsuite/gdb.base/statistics.exp @@ -0,0 +1,29 @@ +# Copyright 2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +standard_testfile + +gdb_exit + +# Inlined default_gdb_start. +set use_gdb_stub [target_info exists use_gdb_stub] +set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts] -statistics"] +if { $res < 0 || $res == "" } { + perror "Spawning $GDB failed." + return +} +set gdb_spawn_id -1 +gdb_test "" "Startup time: \[0-9.\]+ \\(cpu\\), \[0-9.\]+ \\(wall\\)\r\nSpace used: \[0-9.\]+ \\(\\+\[0-9.\]+ during startup\\)" "startup time and space" +gdb_exit --fdj2RfSjLxBAspz7--