From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 651AD42BD1; Mon, 29 May 2023 10:22:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AC4F410DD; Mon, 29 May 2023 10:22:59 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 34883410D7 for ; Mon, 29 May 2023 10:22:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685348577; x=1716884577; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Vf+yBGjDjAQbFIG4jBfDbe4jUo+nthmOVBXGt/H6Y3E=; b=bJqgqlNR85qyNdhrW2N0loRdzZR5VeNxPh2zdM7GseKJNKX8ZLBR2RJR lweOWmVk8F8JnTOnW2/k5x2ek67kQVfp3RgSBxu3eDFTSGdzZhlJqjp5L RUnJSdQlvRppmToemwwpsdXKbLQjH4Sb/0Z+7xlM9/XlH1CFGMX6wsq57 TCjObmNdCqN6cqLPKffHdnOA1UyuZ5mevFSGbNWfa/nMNVxUsvgtQSIBJ tymKZeG12DDhiW8wpgBgXBoA84iP37whMVa3P5h31mwOnanWjUZ77JIPU EaMaikMDcVLWLLnn8RIkrFSnwXfrZtYEMlvwXKSoL/ZF9M8Kb6PFXTI+2 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="353495345" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="353495345" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2023 01:22:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10724"; a="880295626" X-IronPort-AV: E=Sophos;i="6.00,200,1681196400"; d="scan'208";a="880295626" Received: from unknown (HELO localhost.localdomain) ([10.239.252.44]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2023 01:22:54 -0700 From: Dukai Yuan To: dts@dpdk.org Cc: Dukai Yuan Subject: [dts][PATCH V1] tests/vm2vm_virtio_pmd_*: perf top command optimization Date: Mon, 29 May 2023 16:00:26 +0000 Message-Id: <20230529160026.846541-1-dukaix.yuan@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Using the command perf top -p > 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 --- 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