diff mbox

[4/8] gen-pert-test: measure logging

Message ID 089e0153840a1ef3d3051b62cbdb@google.com
State New
Headers show

Commit Message

Doug Evans July 21, 2015, 1:40 p.m. UTC
Hi.
Hopefully my connection will be stable enough to let me complete
sending out this series.

This patch just adds some logging when recording perf data.
We report the resulting average, but sometimes it's useful to
see the individual numbers.

2015-07-20  Doug Evans  <dje@google.com>

	* gdb.perf/lib/perftest/measure.py (MeasurementCpuTime::stop): Print
	result.
	(MeasurementWallTime::stop): Ditto.
	(MeasurementVmSizeTime::stop): Ditto.

Comments

Doug Evans July 25, 2015, 12:46 a.m. UTC | #1
On Tue, Jul 21, 2015 at 6:40 AM, Doug Evans <dje@google.com> wrote:
> Hi.
> Hopefully my connection will be stable enough to let me complete
> sending out this series.
>
> This patch just adds some logging when recording perf data.
> We report the resulting average, but sometimes it's useful to
> see the individual numbers.
>
> 2015-07-20  Doug Evans  <dje@google.com>
>
>         * gdb.perf/lib/perftest/measure.py (MeasurementCpuTime::stop): Print
>         result.
>         (MeasurementWallTime::stop): Ditto.
>         (MeasurementVmSizeTime::stop): Ditto.

Hi.

I checked this in, but obviously missed the regression it caused,
so I've reverted it. I'll submit a different patch in time.
diff mbox

Patch

diff --git a/gdb/testsuite/gdb.perf/lib/perftest/measure.py  
b/gdb/testsuite/gdb.perf/lib/perftest/measure.py
index f0ecd48..f14b87f 100644
--- a/gdb/testsuite/gdb.perf/lib/perftest/measure.py
+++ b/gdb/testsuite/gdb.perf/lib/perftest/measure.py
@@ -103,6 +103,8 @@  class MeasurementCpuTime(Measurement):
          else:
              cpu_time = time.clock() - self.start_time
          self.result.record (id, cpu_time)
+        # Log this result for debugging purposes.
+        print ("elapsed cpu time %s" % (cpu_time))

  class MeasurementWallTime(Measurement):
      """Measurement on Wall time."""
@@ -117,6 +119,8 @@  class MeasurementWallTime(Measurement):
      def stop(self, id):
          wall_time = time.time() - self.start_time
          self.result.record (id, wall_time)
+        # Log this result for debugging purposes.
+        print ("elapsed wall time %s" % (wall_time))

  class MeasurementVmSize(Measurement):
      """Measurement on memory usage represented by VmSize."""
@@ -144,3 +148,5 @@  class MeasurementVmSize(Measurement):
      def stop(self, id):
          memory_used = self._compute_process_memory_usage("VmSize:")
          self.result.record (id, memory_used)
+        # Log this result for debugging purposes.
+        print ("vm used %s" % (memory_used))