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: Yao Qi <yao at codesourcery dot com>
- To: "Agovic, Sanimir" <sanimir dot agovic at intel dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sun, 24 Nov 2013 13:02:00 +0800
- 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> <0377C58828D86C4588AEEC42FC3B85A7176B83E1 at IRSMSX105 dot ger dot corp dot intel dot com>
On 11/20/2013 09:24 PM, Agovic, Sanimir wrote:
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.
On target exec, GDB will read data from local executable file, which
should be quite fast and it won't bring any performance issues.
We need a running inferior, so that GDB will read data from target, with
some overhead of communication between GDB and target. We'd like to
measure the performance like that, and alarm if GDB becomes slow.
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.
I don't know what kind of simple gdb source change may affect the
result. If gdb source changes affect the result to some extent, such as
30%, such changes are what we want to monitor, right?
The process of disassemble is I/O intensive, so probably compiler
upgrade has minor effects on the result. On the other hand, we should
avoid changing factors other than GDB itself when measuring GDB performance.
>+
>+from perftest import perftest
>+from perftest import measure
>+
I see no use of 'measure', is it still needed?
No, I'll remove it from these three cases.
>+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".
Thanks for the tip. I'll post the updated one soon.
--
Yao (éå)