test suite reviews and discussions
 help / color / mirror / Atom feed
From: Dukai Yuan <dukaix.yuan@intel.com>
To: dts@dpdk.org
Cc: Dukai Yuan <dukaix.yuan@intel.com>
Subject: [dts][PATCH V1] tests/vm2vm_virtio_pmd_*: perf top command optimization
Date: Mon, 29 May 2023 16:00:26 +0000	[thread overview]
Message-ID: <20230529160026.846541-1-dukaix.yuan@intel.com> (raw)

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

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


             reply	other threads:[~2023-05-29  8:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 16:00 Dukai Yuan [this message]
2023-06-07  5:56 ` lijuan.tu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230529160026.846541-1-dukaix.yuan@intel.com \
    --to=dukaix.yuan@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).