This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH 1/3] Test on disassemble
- From: "Agovic, Sanimir" <sanimir dot agovic at intel dot com>
- To: 'Yao Qi' <yao at codesourcery dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 20 Nov 2013 13:24:39 +0000
- Subject: RE: [PATCH 1/3] Test on disassemble
- Authentication-results: sourceware.org; auth=none
- References: <1384915860-8805-1-git-send-email-yao at codesourcery dot com> <1384915860-8805-2-git-send-email-yao at codesourcery dot com>
Some minor comments below.
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf
> Of Yao Qi
> Sent: Wednesday, November 20, 2013 03:51 AM
> To: gdb-patches@sourceware.org
> Subject: [PATCH 1/3] Test on disassemble
>
>
> diff --git a/gdb/testsuite/gdb.perf/disassemble.exp
> b/gdb/testsuite/gdb.perf/disassemble.exp
> new file mode 100644
> index 0000000..6a2b2fd
> --- /dev/null
> +++ b/gdb/testsuite/gdb.perf/disassemble.exp
> @@ -0,0 +1,56 @@
> +
> + gdb_reinitialize_dir $srcdir/$subdir
> + gdb_load ${binfile}
> +
> + if ![runto_main] {
>
How about an option to measure performance without a running inferior
e.g. exec on top of the target stack? This may eliminate some overhead.
Does opcode/ provide some kind of null-op disassembler we can
use instead of a real ISA? A simple gdb source change or compiler
upgrade could make comparative runs quite hard.
> diff --git a/gdb/testsuite/gdb.perf/disassemble.py b/gdb/testsuite/gdb.perf/disassemble.py
> new file mode 100644
> index 0000000..b8e7dfc
> --- /dev/null
> +++ b/gdb/testsuite/gdb.perf/disassemble.py
> @@ -0,0 +1,36 @@
> +# Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
> +
> +from perftest import perftest
> +from perftest import measure
> +
I see no use of 'measure', is it still needed?
> +class Disassemble(perftest.TestCaseWithBasicMeasurements):
> + def __init__(self):
> + super (Disassemble, self).__init__ ("disassemble")
> +
> + def warm_up(self):
> + do_test_command = "disassemble ada_evaluate_subexp"
> + gdb.execute (do_test_command, False, True)
> +
> + def _do_test(self, c):
> + for func in ["evaluate_subexp_standard", "handle_inferior_event",
> "c_parse_internal"]:
> + for i in range(c+1):
> + do_test_command = "disassemble %s" % func
>
You may move this to the outer loop. Please use _ if you do not use the value "i".
> + gdb.execute (do_test_command, False, True)
> +
> + def execute_test(self):
> + for i in range(3):
> + self.measure.measure(lambda: self._do_test(i), i)
> +
> --
> 1.7.7.6
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052