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 DC888A00C4; Wed, 27 Jul 2022 11:12:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 815D640141; Wed, 27 Jul 2022 11:12:54 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 99DF9400D7 for ; Wed, 27 Jul 2022 11:12:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658913172; x=1690449172; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=c+ERQS6x+F+EK/OV6lhLUWpvx8Vgqsn/vP/fIitjFcI=; b=aFbikbmGMY6ayc4fPaVKoLDVAv9kuj92o66Lw2Jk/2U1wG1Epy0XocL/ om+Co59KroIm/o9sxnB19Q7WAejMpV3w5/1BET8m4a8zyFT6PPtcX48sL YxXNLtgOUPO3BaqefzVhItKaESw1SX2U6K+oCMCuwvZD/sUANRBqWeHD8 EqurZqK2zJp9LznDjSsVmbrDjkYfdBdpFknEAiNy70v272OtBgmXeeIAS SH3CpPX1805rTHMxrVNpd9CpFpNMY/bHDTbY4Ohh4YDipYdkPnxKNy9qS DDBrdPNYMkL3CO80QskvMYg/JAHi1QrYM3M7ntoMiLSfCrgpLjMqRX7h3 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10420"; a="285733561" X-IronPort-AV: E=Sophos;i="5.93,195,1654585200"; d="scan'208";a="285733561" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2022 02:12:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,195,1654585200"; d="scan'208";a="659113368" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmga008.fm.intel.com with ESMTP; 27 Jul 2022 02:12:48 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 27 Jul 2022 02:12:48 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Wed, 27 Jul 2022 02:12:47 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Wed, 27 Jul 2022 02:12:47 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.28; Wed, 27 Jul 2022 02:12:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YfaF4JhLqkLXnGarJ50FUeBRkfJrfYa7A0kGCDCIH8f8BmkAqiT7RBZBd8VRkinQ4gRgRUz2byMz8V5iQH3UEy9hxbmU3gH1/q3E9wv+MEeAKsZGvFgG/da8QA8kT1v2EPt4iGkOTPcg2kz/0WNsDiVngo8ciszgkxW0SsJ7O4V5kzD9MjkvOdpvNbtKHmCdm627R/HnkbJL5j41MzagSn/7+akN3qMl5Vxtwl7A/V4nIN9JWRufJSJDdhWSKpzAcwHVGAY6JTa7UU4XnxPnqzOsPcxV7PTOwkzNGthxKDRwRHXxEEEPIcHRMpz2yS9tAYDTowv7aXJgxmnL0xhG4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vBuVLxQmcrCIndhKNk7nvaSHrWSOY9zOhqSbJ58TiPw=; b=aVQt4VidJ2J3OxYg6DedlJ2x7ghb/XiTFl+XPTs/tef1ySOWm39C7/lg/IZJEZlSXgb9XLjTQ7dqmCjhPDingEDSmwpKp0zDGIcoKy5ZDNG5Je7oyQms2/hdlDet+SV9MGuE04mktSrYdlc7FZ+jVGXjwpTEO++pthHggQcY4w+8yK2qjD/RM/kNH3Rfx504zdjKwvQFp3w+FEFTJksTrYdUsX2FjGogZQ7a9+RWcWlCc3Pqfw6zmIibh98hVRVMsMqYqpN5lxWHL6g2u8o/9MpnlNs6l4ekV+wzsSrQFGEGXbwHL6cFV+nYbmHSpUea0PQ7Nype5ag3lgfDDyG0Wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by CY4PR11MB1623.namprd11.prod.outlook.com (2603:10b6:910:f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.24; Wed, 27 Jul 2022 09:12:46 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::8e4:e1e9:a851:4b0d]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::8e4:e1e9:a851:4b0d%5]) with mapi id 15.20.5458.024; Wed, 27 Jul 2022 09:12:46 +0000 Date: Wed, 27 Jul 2022 10:12:40 +0100 From: Bruce Richardson To: fengchengwen CC: Subject: Re: [PATCH v2 00/13] telemetry JSON escaping and other enhancements Message-ID: References: <20220623164245.561371-1-bruce.richardson@intel.com> <20220725163543.875775-1-bruce.richardson@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P265CA0193.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:318::7) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f856be79-a936-41ce-7155-08da6fb02b7d X-MS-TrafficTypeDiagnostic: CY4PR11MB1623:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YfV0NIlnmIeK+CNEvQpt9J3nc90zwzj8LUtOu3bYd9Pb/R89Dz0Ik5DDwGZhvSYGrSXeEc5ZKD+nCIlJa3B7etqTQUo3v7AbX7bpWA79VHF3tfMKuZLyQwN96mIFikwr86WY1c1lCJVdYVlUZTv5QIKlG72U9/ijlS+T9vemP91/FEWLnXJetFLpdi8FEGtBwGPr/a2f0968qyoKY4OrkTLc7YE+N1v3mcv69mxjgeDS2e7yMJHNMtAC3B7/bv1NJ+Be90Cc4Sz6ifREaT4bUKGKhrqXrO5bvbYDtxTJNbAuOWXyTiUGugDd3KvOu3ZlqXoS416g8alzJs1VIhRKdqZ189Wpq/iTGIv2FdvLAc/XqFagIUPuzc2QMx+gLQzi61rBhDXpWLTy/TwVdmK1Uzhro5B0fQoHxDqlT0z57WQRFp25YIc7POL4+dCtknratO+Nwm/z6Kj+/0A9kI/dnma4hfrRCAFnx2pNYjjy60AfRxX8+BVaD3/Mw1bzASbuEilrKQT5NKVUyKEqd8uKOkfJ1IvlREZPnF8wNlSOpIIA3gNVMnHimlOoMBj/XjHAFlqOZqKwZOsNCUvpae0N71NOxYpnJpCpRp0/jdDGQgicc99oUfRWSUBoQ0NqTsDkEp/IWmV6LQ5Kf6hJvmIbbH6DKEgtX/Co3N47rX286+PADGDZ9WK0rKiSoJfZQHA0j2aPyK2GjI0QCXrkghUeTBWMcbGfwqOdYbRwdRR/zknMdtbLdYxTZWf/Ofd+jEI7 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(396003)(346002)(136003)(39860400002)(376002)(366004)(82960400001)(44832011)(5660300002)(4326008)(38100700002)(316002)(41300700001)(6916009)(66476007)(8676002)(26005)(66946007)(66556008)(6666004)(478600001)(8936002)(6512007)(6486002)(86362001)(186003)(6506007)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ckLkUoVihpqq6+RI9hwiIJm+rVqmLrOpEKt29IhrR/grCnSQXJSXs/fWvZOx?= =?us-ascii?Q?68QdDpY/8lsuskNRXXQOx9DXGK6eXGxj+9fZ11fNnplJJ1hrbKEMzNyo74Oh?= =?us-ascii?Q?VxDcN51Lhz3Dus+wLy9HQYSPS/o121KdZBnovoXpMhwX1F7NhUX99q+7Rg+e?= =?us-ascii?Q?k5yM7ddwPxkHaBHferzCOtAwFrluSHKMdOYjZeCNMToB+q7S5idIUeHQKXO0?= =?us-ascii?Q?LCKfF2erkwtguzowC70Sm8OgVGIjS2fI3g9SmjuBj64KWw2MXyyGQKl+t26N?= =?us-ascii?Q?3woi2u4R1HNn4iTu6tzDDlnuPUnXpUH+DiNnoqfYSmQQsxMqrpz9JyNhc1C3?= =?us-ascii?Q?RofljEdf+NXTDCVbcblw8XDGT4egezFOhd6I9g5jVKrMvOU6SqtNvcHZB/Uc?= =?us-ascii?Q?flNoqamgTGjSu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VV6XQpYw3?= =?us-ascii?Q?RFS4wsvZSWyQ1CJAaABxGVI/v/G6jmyDm9szATJCjYPL1UXt5Ljon38I6fG2?= =?us-ascii?Q?B5m9JVpYG5tghl/G9R/Hj/xIP+1XdPQwt7qaVWyH7IOn+jIHiklrRoEspdVV?= =?us-ascii?Q?ZWLtOZSsJNQvry5UbVJJJRJcGX+6Vz5CtQTyX3F6jQxJ2Ut90f0Nss+a83Ph?= =?us-ascii?Q?RpsobL/TxV+x5ZjzgRy7JQ3wffMLkq+RTRIUaInrWeq5hT8w/2mlnjN6UGF5?= =?us-ascii?Q?8IZVdRHL/sfCl+wp9UIpsNzlT44keGW8+kdjnQSTdeLOIzt5XqKjjCc8vj0C?= =?us-ascii?Q?aQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: f856be79-a936-41ce-7155-08da6fb02b7d X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2022 09:12:46.3414 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: h9sfrI5VZDp+PheIuUJzsuHLkQdQUwR/Vt6dIWtnfcUZ61+XIMp9+OLlTZbE9zTzH8xszvwZ5/5UCzkISd88zSrtvY60hKX+vq9POW9m3T4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1623 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Jul 27, 2022 at 09:51:04AM +0800, fengchengwen wrote: > Hi Bruce, > > I think escape the string at begin (following function) seem more simple: > rte_tel_data_string > rte_tel_data_add_array_string > rte_tel_data_add_dict_string > > int > rte_tel_data_string(struct rte_tel_data *d, const char *str) > { > d->type = RTE_TEL_STRING; > d->data_len = strlcpy(d->data.str, str, sizeof(d->data.str)); > // e.g. do escape here! > if (d->data_len >= RTE_TEL_MAX_SINGLE_STRING_LEN) { > d->data_len = RTE_TEL_MAX_SINGLE_STRING_LEN - 1; > return E2BIG; /* not necessarily and error, just truncation */ > } > return 0; > } > > Advantages: > 1. simpler implementation > 2. application are directly visible the result (by judge API retval) without waiting for JSON encapsulation. > > Disadvantages: > 1. not friend for new output format, but currently telemetry deep depend on json, so I think it's OK for it. > I'm quite happy to implement things in a simpler way, however, in the past there was a great concern to keep things flexible enough for future changes to add other output formats. By that logic, keeping the escaping in the json layer is the correct design choice. However, adding escaping on addition to the return data structure may not be that much of an inconvience to other output formats too, so perhaps it's acceptable. Again, looking for more input and consensus from the community. I am happy to go with either approach for escaping - putting it in the data return layer or the json one. /Bruce