[V1] tests/vm2vm_virtio_pmd_*: perf top command optimization

Message ID 20230529160026.846541-1-dukaix.yuan@intel.com (mailing list archive)
State Accepted
Headers
Series [V1] tests/vm2vm_virtio_pmd_*: perf top command optimization |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-suite-test warning SKIPPED

Commit Message

Yuan, DukaiX May 29, 2023, 4 p.m. UTC
  Using the command perf top -p <pid> > <log_file> can monitor only the specified PID process and record its output to a file, 
which can avoid mixing information from other processes in the output file 
and enable us to better monitor the performance of the specified process.

Signed-off-by: Dukai Yuan <dukaix.yuan@intel.com>
---
 tests/TestSuite_dpdk_gro_lib_cbdma.py     | 3 ++-
 tests/TestSuite_vm2vm_virtio_pmd_cbdma.py | 3 ++-
 tests/TestSuite_vm2vm_virtio_pmd_dsa.py   | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
  

Comments

Tu, Lijuan June 7, 2023, 5:56 a.m. UTC | #1
On Mon, 29 May 2023 16:00:26 +0000, Dukai Yuan <dukaix.yuan@intel.com> wrote:
> Using the command perf top -p <pid> > <log_file> can monitor only the specified PID process and record its output to a file, 
> which can avoid mixing information from other processes in the output file 
> and enable us to better monitor the performance of the specified process.
> 
> Signed-off-by: Dukai Yuan <dukaix.yuan@intel.com>

Acked-by: Lijuan Tu <lijuan.tu@intel.com>
Applied, thanks
  

Patch

diff --git a/tests/TestSuite_dpdk_gro_lib_cbdma.py b/tests/TestSuite_dpdk_gro_lib_cbdma.py
index 23a55686..0ce250ef 100644
--- a/tests/TestSuite_dpdk_gro_lib_cbdma.py
+++ b/tests/TestSuite_dpdk_gro_lib_cbdma.py
@@ -155,7 +155,8 @@  class TestDPDKGROLibCbdma(TestCase):
 
     def get_and_verify_func_name_of_perf_top(self, func_name_list):
         self.dut.send_expect("rm -fr perf_top.log", "# ", 120)
-        self.dut.send_expect("perf top > perf_top.log", "", 120)
+        pid = self.dut.send_expect("pidof dpdk-testpmd", "# ", 120)
+        self.dut.send_expect("perf top -p %s > perf_top.log" % pid, "", 120)
         time.sleep(10)
         self.dut.send_expect("^C", "#")
         out = self.dut.send_expect("cat perf_top.log", "# ", 120)
diff --git a/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py b/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py
index 0507e9ca..76508939 100644
--- a/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py
+++ b/tests/TestSuite_vm2vm_virtio_pmd_cbdma.py
@@ -165,7 +165,8 @@  class TestVM2VMVirtioPmdCBDMA(TestCase):
 
     def get_and_verify_func_name_of_perf_top(self, func_name_list):
         self.dut.send_expect("rm -fr perf_top.log", "# ", 120)
-        self.dut.send_expect("perf top > perf_top.log", "", 120)
+        pid = self.dut.send_expect("pidof dpdk-testpmd", "# ", 120)
+        self.dut.send_expect("perf top -p %s > perf_top.log" % pid, "", 120)
         time.sleep(10)
         self.dut.send_expect("^C", "#")
         out = self.dut.send_expect("cat perf_top.log", "# ", 120)
diff --git a/tests/TestSuite_vm2vm_virtio_pmd_dsa.py b/tests/TestSuite_vm2vm_virtio_pmd_dsa.py
index 6ae9f165..34d62ada 100644
--- a/tests/TestSuite_vm2vm_virtio_pmd_dsa.py
+++ b/tests/TestSuite_vm2vm_virtio_pmd_dsa.py
@@ -208,7 +208,8 @@  class TestVM2VMVirtioPmdDsa(TestCase):
     def get_and_verify_func_name_of_perf_top(self, func_name_list):
         time.sleep(10)
         self.dut.send_expect("rm -fr perf_top.log", "# ", 120)
-        self.dut.send_expect("perf top > perf_top.log", "", 120)
+        pid = self.dut.send_expect("pidof dpdk-testpmd", "# ", 120)
+        self.dut.send_expect("perf top -p %s > perf_top.log" % pid, "", 120)
         time.sleep(30)
         self.dut.send_expect("^C", "#")
         out = self.dut.send_expect("cat perf_top.log", "# ", 120)