Could you convert to postprocess_iteration whilst changing it? Other than
that, looks good

On Apr 14, 2010 9:57 AM, "Lucas Meneghel Rodrigues" <[email protected]> wrote:

The hackbench test wasn't generating performance keyvals,
due to some incorrect assumptions at the postprocessing
code (the output for the test also has a debug line with
the number of tasks spawned, so the output generated will
not start with 'Time:', as the code assumes). Let's fix
that problem.

Also, in order for people to apply their custom
postprocessing to results (they might want to test out
some 3rd party postprocessing script, for example), is
allways good to keep record of the raw output generated
by the test, per iteration. I plan on doing the same
for the other benchmarks present on autotest.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 client/tests/hackbench/hackbench.py |   35
++++++++++++++++++++++++++++++-----
 1 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/client/tests/hackbench/hackbench.py
b/client/tests/hackbench/hackbench.py
index 61323c2..e2d6e69 100644
--- a/client/tests/hackbench/hackbench.py
+++ b/client/tests/hackbench/hackbench.py
@@ -3,6 +3,14 @@ from autotest_lib.client.bin import test, utils


 class hackbench(test.test):
+    """
+    This module will run the hackbench benchmark. Hackbench is a benchmark
for
+    measuring the performance, overhead and scalability of the Linux
scheduler.
+    The C program was pick from Ingo Molnar's page.
+
+    @author: Nikhil Rao ([email protected])
+    @see: http://people.redhat.com/~mingo/cfs-scheduler/tools/hackbench.c
+    """
    version = 1
    preserve_srcdir = True

@@ -18,13 +26,30 @@ class hackbench(test.test):


    def run_once(self, num_groups=90):
+        """
+        Run hackbench, store the output in raw output files per iteration
and
+        also in the results list attribute.
+
+        @param num_groups: Number of children processes hackbench will
spawn.
+        """
        hackbench_bin = os.path.join(self.srcdir, 'hackbench')
        cmd = '%s %s' % (hackbench_bin, num_groups)
-        self.results.append(utils.system_output(cmd, retain_output=True))
+        raw_output = utils.system_output(cmd, retain_output=True)
+        self.results.append(raw_output)
+
+        path = os.path.join(self.resultsdir, 'raw_output_%s' %
self.iteration)
+        raw_output_file = open(path, 'w')
+        raw_output_file.write(raw_output)
+        raw_output_file.close()


    def postprocess(self):
-        for line in self.results:
-            if line.startswith('Time:'):
-                time_val = line.split()[1]
-                self.write_perf_keyval({'time': time_val})
+        """
+        Pick up the results attribute and write it in the performance
keyval.
+        """
+        for result in self.results:
+            lines = result.split('\n')
+            for line in lines:
+                if line.startswith('Time:'):
+                    time_val = line.split()[1]
+                    self.write_perf_keyval({'time': time_val})
--
1.6.6.1

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to