[PATCH] KVM test utils: Add kvm_stat profiling to run_tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add kvm_stat profiling to the helper function
run_tests, so every kvm test run through this
function but build will present kvm_stat data
on the profiling directory.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@xxxxxxxxxx>
---
 client/tests/kvm/kvm_utils.py |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index 2bbbe22..7152816 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -902,9 +902,26 @@ def run_tests(test_list, job):
                     break
         if dependencies_satisfied:
             test_iterations = int(dict.get("iterations", 1))
-            current_status = job.run_test("kvm", params=dict,
-                                          tag=dict.get("shortname"),
-                                          iterations=test_iterations)
+            test_tag = dict.get("shortname")
+            # Setting up kvm_stat profiling during test execution.
+            # We don't need kvm_stat profiling on the build tests.
+            if "build" in test_tag:
+                # None because it's the default value on the base_test class
+                # and the value None is specifically checked there.
+                profile = None
+            else:
+                profile = True
+
+            if profile:
+                job.profilers.add('kvm_stat')
+            # We need only one execution, profiled, hence we're passing
+            # the profile_only parameter to job.run_test().
+            current_status = job.run_test("kvm", params=dict, tag=test_tag,
+                                          iterations=test_iterations,
+                                          profile_only=profile)
+            if profile:
+                job.profilers.delete('kvm_stat')
+
             if not current_status:
                 failed = True
         else:
-- 
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux