[PATCH v2] KVM test: Make the profiler could be configurated

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

 



The patch let the profilers could be specified through configuration
file. kvm_stat was kept as the default profiler.

Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>
---
 client/tests/kvm/kvm_utils.py          |   21 ++++++++-------------
 client/tests/kvm/tests_base.cfg.sample |    2 +-
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index 8531c79..25f3c8c 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -866,24 +866,19 @@ def run_tests(test_list, job):
         if dependencies_satisfied:
             test_iterations = int(dict.get("iterations", 1))
             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 dict.get("run_kvm_stat") == "yes":
-                profile = True
-            else:
-                # None because it's the default value on the base_test class
-                # and the value None is specifically checked there.
-                profile = None
+            # Setting up profilers during test execution.
+            profilers = dict.get("profilers", "").split()
+            for profiler in profilers:
+                job.profilers.add(profiler)
 
-            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')
+                                          profile_only= bool(profilers) or None)
+
+            for profiler in profilers:
+                job.profilers.delete(profiler)
 
             if not current_status:
                 failed = True
diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample
index d162cf8..0f6721f 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -41,7 +41,7 @@ nic_script = scripts/qemu-ifup
 address_index = 0
 
 # Misc
-run_kvm_stat = yes
+profilers = kvm_stat
 
 
 # Tests

--
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