From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7D1A8A00BE; Fri, 12 Jun 2020 15:14:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 003DE14583; Fri, 12 Jun 2020 15:14:10 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id B3261375B for ; Fri, 12 Jun 2020 15:14:09 +0200 (CEST) IronPort-SDR: i4mAtCp9CI4/3UlwHljYWuTFx3biJSbzGbVLQiJ6ifAhZf88rPLZSIeinxZJPz5zPElOQF4bUJ yQUjB537t5qw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2020 06:14:08 -0700 IronPort-SDR: ZfzsTXlz2NglGMC5EV1kCBAnv/6Q+j8Z7S+O3VFiyU5q9nHHDEmZcF4mjTQlSvw4rdX1/GGbH8 Mt/FcvKdJ9LA== X-IronPort-AV: E=Sophos;i="5.73,503,1583222400"; d="scan'208";a="275735336" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.13.196]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 12 Jun 2020 06:14:06 -0700 Date: Fri, 12 Jun 2020 14:14:03 +0100 From: Bruce Richardson To: Ciara Power Cc: kevin.laatz@intel.com, thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com, keith.wiles@intel.com, dev@dpdk.org Message-ID: <20200612131403.GD1607@bricha3-MOBL.ger.corp.intel.com> References: <20200612105344.15383-1-ciara.power@intel.com> <20200612105344.15383-2-ciara.power@intel.com> <20200612130706.GB1607@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200612130706.GB1607@bricha3-MOBL.ger.corp.intel.com> Subject: Re: [dpdk-dev] [RFC 1/2] telemetry: support some recursive data objects X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jun 12, 2020 at 02:07:06PM +0100, Bruce Richardson wrote: > On Fri, Jun 12, 2020 at 11:53:43AM +0100, Ciara Power wrote: > > Dict data objects now support uint64_t array data object values. > > Only one level of recursion supported. > > > > Signed-off-by: Ciara Power > > --- > > static void > > output_json(const char *cmd, const struct rte_tel_data *d, int s) > > { > > @@ -166,6 +189,17 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s) > > buf_len, used, > > v->name, v->value.u64val); > > break; > > + case RTE_TEL_DATA_VAL: > > + { > > + char temp[buf_len]; > > + if (recursive_data_json(v->value.dataval, > > + temp, buf_len) != 0) > > + used = rte_tel_json_add_obj_json( > > + cb_data_buf, > > + buf_len, used, > > + v->name, temp); > > + free(v->value.dataval); Are there cases where we want to preserve the structure across calls rather than doing an alloc and free each time?