From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 74DB1A0096 for ; Wed, 8 May 2019 04:02:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EDA1F37B7; Wed, 8 May 2019 04:02:03 +0200 (CEST) Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id 86BBE293B for ; Wed, 8 May 2019 04:02:01 +0200 (CEST) Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x48220YI023007; Wed, 8 May 2019 11:02:00 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 4879D637FED; Wed, 8 May 2019 11:02:00 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 3AB40637FDC; Wed, 8 May 2019 11:02:00 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Wed, 8 May 2019 10:59:44 +0900 Message-Id: <1557280784-7620-6-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557280784-7620-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1557280784-7620-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 5/5] controller: add parsing lcore IDs for spp_pcap X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa To show lcore IDs, add parsing the response from spp_pcap. Signed-off-by: Yasufumi Ogawa --- src/controller/commands/pcap.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/controller/commands/pcap.py b/src/controller/commands/pcap.py index d06327b..88dd5c8 100644 --- a/src/controller/commands/pcap.py +++ b/src/controller/commands/pcap.py @@ -115,8 +115,13 @@ class SppPcap(object): Print status received from spp_pcap. spp > pcap 1; status + Basic Information: - client-id: 3 - satus: running + - lcore_ids: + - master: 1 + - slaves: [2, 3, 3, 4, 5, 6] + Components: - core:2, receive - rx: phy:0 - core:3, write @@ -129,11 +134,21 @@ class SppPcap(object): """ - # client id and status + # Extract slave lcore IDs first + slave_lcore_ids = [] + for worker in json_obj['core']: + slave_lcore_ids.append(str(worker['core'])) + + # Basic Information + print('Basic Information:') print(' - client-id: {}'.format(json_obj['client-id'])) print(' - status: {}'.format(json_obj['status'])) + print(' - lcore_ids:') + print(' - master: {}'.format(json_obj['master-lcore'])) + print(' - slaves: [{}]'.format(', '.join(slave_lcore_ids))) - # Core + # Componennts + print('Components:') for worker in json_obj['core']: if 'role' in worker.keys(): print(" - core:{core_id} {role}".format( -- 2.17.1