RE: ping: [PATCH 0/4 V3] GDB Performance testing

Agovic, Sanimir
2013-10-24T08:50:52Z

Looks good to me, looking forward to your commit.

A minor comment in your perf framework:
diff --git a/gdb/testsuite/gdb.perf/lib/perftest/measure.py b/gdb/testsuite/gdb.perf/lib/perftest/measure.py
new file mode 100644
index 0000000..7478be5
--- /dev/null
+++ b/gdb/testsuite/gdb.perf/lib/perftest/measure.py
@@ -0,0 +1,146 @@
+# 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/>.
+
+import time
+import os
+import gc
+
+class Measure(object):
+ """A class that measure and collect the interesting data for a given testcase.
+
+ An instance of Measure has a collection of measurements, and each
+ of them is to measure a given aspect, such as time and memory.
+ """
+
+ def __init__(self, measurements):
+ """Constructor of measure.
+
+ measurements is a collection of Measurement objects.
+ """
+
+ self.measurements = measurements
+
+ def measure(self, func, id):
+ """Measure the operations done by func with a collection of measurements."""
+ for m in self.measurements:
+ m.start(id)
+
+ # Enable GC, force GC and disable GC before running test in order to reduce
+ # the interference from GC.
+ gc.enable()
+ gc.collect()
+ gc.disable()
+
+ func()
+
+ gc.enable()
I`d rather exclude gc cycles completely from the measurements or include gc collection
_after_ you run your perf test. Otherwise the results will depend on the order the perf
tests are run.

-Sanimir

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf
> Of Yao Qi
> Sent: Thursday, October 24, 2013 04:43 AM
> To: gdb-patches@sourceware.org
> Subject: ping: [PATCH 0/4 V3] GDB Performance testing
>
> On 10/16/2013 03:09 PM, Yao Qi wrote:
> > Here is the V3 of GDB performance testing. The changes in V3 can be
> > found in each patch, and they address all review comments.
> >
> > The basic usages of performance testing are unchanged,
> >
> > $ make check-perf
> > $ make check-perf RUNTESTFLAGS="--target_board=native-gdbserver solib.exp"
> > $ make check-perf RUNTESTFLAGS="solib.exp SOLIB_COUNT=512"
> >
> > We can skip compilation step like,
> >
> > $ make check-perf RUNTESTFLAGS='solib.exp GDB_PERFORMANCE=run'
> >
> > or only compile test cases,
> >
> > $ make check-perf RUNTESTFLAGS='solib.exp GDB_PERFORMANCE=compile'
> >
> > in default, GDB_PERFORMANCE=both.
> >
> > If the perf test case takes much time, we can specify timeout by
> > GDB_PERFORMANCE_TIMEOUT=1000.
> >
> > $ make check-perf RUNTESTFLAGS="--target_board=native-gdbserver
> GDB_PERFORMANCE_TIMEOUT=4000 solib.exp"
> >
> > Looks the perf test framework is in shape, so I add the patch to
> > testsuite/README to describe perf test.
>
> Ping. https://sourceware.org/ml/gdb-patches/2013-10/msg00470.html
>
> --
> Yao (齐尧)
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