Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/98740/?format=api
http://patchwork.dpdk.org/api/patches/98740/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210913105137.130097-3-bruce.richardson@intel.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20210913105137.130097-3-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210913105137.130097-3-bruce.richardson@intel.com", "date": "2021-09-13T10:51:36", "name": "[2/3] usertools/dpdk_telemetry: fix handling EOF for input pipe", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "7e43dd0f5e651426c79c39f620ad063b467d6bcd", "submitter": { "id": 20, "url": "http://patchwork.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210913105137.130097-3-bruce.richardson@intel.com/mbox/", "series": [ { "id": 18867, "url": "http://patchwork.dpdk.org/api/series/18867/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=18867", "date": "2021-09-13T10:51:34", "name": "improvements for telemetry script", "version": 1, "mbox": "http://patchwork.dpdk.org/series/18867/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/98740/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/98740/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 8A33BA0C45;\n\tMon, 13 Sep 2021 12:52:13 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A0AA1410EB;\n\tMon, 13 Sep 2021 12:52:12 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id 6446C410E1;\n Mon, 13 Sep 2021 12:52:10 +0200 (CEST)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Sep 2021 03:52:09 -0700", "from silpixa00399126.ir.intel.com ([10.237.223.29])\n by fmsmga006.fm.intel.com with ESMTP; 13 Sep 2021 03:52:08 -0700" ], "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10105\"; a=\"208871221\"", "E=Sophos;i=\"5.85,288,1624345200\"; d=\"scan'208\";a=\"208871221\"", "E=Sophos;i=\"5.85,288,1624345200\"; d=\"scan'208\";a=\"696639031\"" ], "X-ExtLoop1": "1", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Cc": "ciara.power@intel.com, david.hunt@intel.com,\n Bruce Richardson <bruce.richardson@intel.com>, stable@dpdk.org,\n Keith Wiles <keith.wiles@intel.com>", "Date": "Mon, 13 Sep 2021 11:51:36 +0100", "Message-Id": "<20210913105137.130097-3-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.30.2", "In-Reply-To": "<20210913105137.130097-1-bruce.richardson@intel.com>", "References": "<20210913105137.130097-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 2/3] usertools/dpdk_telemetry: fix handling EOF\n for input pipe", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "To allow the script to take queries from input pipes e.g. \"echo\n/ethdev/stats,0 | dpdk-telemetry.py\", we need to handle the case of EOF\ncorrectly without crashing with an exception. Do this by using a\ntry-except block around the input handling.\n\nFixes: 6a2967c112a3 (\"usertools: add new telemetry script\")\nCc: stable@dpdk.org\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n usertools/dpdk-telemetry.py | 16 ++++++++++------\n 1 file changed, 10 insertions(+), 6 deletions(-)", "diff": "diff --git a/usertools/dpdk-telemetry.py b/usertools/dpdk-telemetry.py\nindex bdc617db18..7ebbb64fce 100755\n--- a/usertools/dpdk-telemetry.py\n+++ b/usertools/dpdk-telemetry.py\n@@ -69,13 +69,17 @@ def handle_socket(path):\n CMDS = read_socket(sock, output_buf_len, False)[\"/\"]\n \n # interactive prompt\n- text = input('--> ').strip()\n- while text != \"quit\":\n- if text.startswith('/'):\n- sock.send(text.encode())\n- read_socket(sock, output_buf_len)\n+ try:\n text = input('--> ').strip()\n- sock.close()\n+ while text != \"quit\":\n+ if text.startswith('/'):\n+ sock.send(text.encode())\n+ read_socket(sock, output_buf_len)\n+ text = input('--> ').strip()\n+ except EOFError:\n+ pass\n+ finally:\n+ sock.close()\n \n \n def readline_complete(text, state):\n", "prefixes": [ "2/3" ] }{ "id": 98740, "url": "