From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 6CBB941DBF;
	Fri, 10 Mar 2023 20:08:37 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id E855E40FAE;
	Fri, 10 Mar 2023 20:08:36 +0100 (CET)
Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com
 [209.85.214.181])
 by mails.dpdk.org (Postfix) with ESMTP id 021B840A8B
 for <dev@dpdk.org>; Fri, 10 Mar 2023 20:08:35 +0100 (CET)
Received: by mail-pl1-f181.google.com with SMTP id a9so6657027plh.11
 for <dev@dpdk.org>; Fri, 10 Mar 2023 11:08:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678475315;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:subject:cc:to:from:date:from:to:cc:subject:date
 :message-id:reply-to;
 bh=mUgJmAP6Qs54wdZl7XQckyWNtB2EHwvVoiME69Cj2NE=;
 b=SKWyTbZDvqGiDC7cpfNJloxvEbBbNZiG1kuEYkXs32iHzsa2oA3Owxe0ItHXMYAneq
 XD+5lkFne8zCIN4NKZNmeijsrV4UdFHToBvzq2d6H8gG4Qx3tDCTKrzfLTAQQZMlkIsz
 UlBiF1Qa2474YTHLvBjztsuSlnvY4hNekwl/zMYettkkgCRwX9HXNFpBVzJnmQ1YZoUy
 E1zHNim1UVClaHvmk2sgU7VMk7OGcbNf2ocRmpVVOOKGrdujSmTEYvn+TkBckVRkoA/T
 4ibmaoJG+41kNTMjciCghMSeWYY+HXB7d92UPG/rczMEc5VIn1xz0Uhn8EME0nuW56HZ
 lS1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1678475315;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=mUgJmAP6Qs54wdZl7XQckyWNtB2EHwvVoiME69Cj2NE=;
 b=7H/d3i3DduLykpVANas7JVeqmv+M1v6Jur/entRZeinSFmvW9NZysDo3OhGVDnd1Zb
 jxE1MttDh9YfR5X2A6Bfv1KlvESS+eV0Y53ilG+VORCfb1ay12rjujj1V1oB7BWmwxgV
 ceAXDdDsUXZymSrKfRhtYuivQ/mGMEfWCp1xfYvLqMS5qDAADJTnabvSI7ucc1pM65l0
 FFJa5KNocZKcfWun5H7X0QF+/VDENs3CCNbZit+cVk1x2AgxhijtTNoUcUPZGBbclTxC
 eAwL1PMvYc4zImEC7XF2uQ6lxhTxUDfn+5rdyqFRWR41XjkxvQt6MRbxoaOmnT5NzjyP
 UsbA==
X-Gm-Message-State: AO0yUKUV5sSHp4NQgJZjE/yU20O4LizIKFA3K7ovKYtWbuEG8+zuFGJj
 k+6SVhXuVlzwzPNsHyjg6uY61Q==
X-Google-Smtp-Source: AK7set8FjkIQqZq+PTuxKXxCk4HCUp7pebtCgKZjL14KJzaQ/Tz/gy1ZGSXliAK1AxEyidxeUsI6QQ==
X-Received: by 2002:a17:90b:1b4e:b0:233:ee67:8eb3 with SMTP id
 nv14-20020a17090b1b4e00b00233ee678eb3mr27112670pjb.24.1678475314996; 
 Fri, 10 Mar 2023 11:08:34 -0800 (PST)
Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])
 by smtp.gmail.com with ESMTPSA id
 a15-20020a17090a740f00b0022be36be19asm245608pjg.53.2023.03.10.11.08.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 10 Mar 2023 11:08:34 -0800 (PST)
Date: Fri, 10 Mar 2023 11:08:32 -0800
From: Stephen Hemminger <stephen@networkplumber.org>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org, Ciara Power <ciara.power@intel.com>,
 Declan Doherty <declan.doherty@intel.com>, Radu Nicolau
 <radu.nicolau@intel.com>
Subject: Re: [PATCH] telemetry: fix autotest failures on Alpine
Message-ID: <20230310110832.1cfa47e5@hermes.local>
In-Reply-To: <20230310181836.162336-1-bruce.richardson@intel.com>
References: <20230310181836.162336-1-bruce.richardson@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
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>,
 <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>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On Fri, 10 Mar 2023 18:18:36 +0000
Bruce Richardson <bruce.richardson@intel.com> wrote:

> On Alpine linux, the telemetry_data_autotest was failing for the
> test where we had dictionaries embedded in other dictionaries up
> to three levels deep. Indications are that this issue is due to
> excess data being stored on the stack, so replace stack-allocated
> buffer data with dynamically allocated data in the case where we
> are doing recursive processing of telemetry data structures into
> json.
> 
> Bugzilla ID: 1177
> Fixes: c933bb5177ca ("telemetry: support array values in data object")
> Fixes: d2671e642a8e ("telemetry: support dict of dicts")
> Cc: stable@dpdk.org

Looking at the telemetry code:

- why so many temporary buffers, could this be streamed or redesigned
  so that an allocated buffer is returned.

- why is rte_tel_json_XXX all inline?  These should just be internal
  functions and not in a .h file.

FYI - if this library reused existing json writer it would have
been much simpler.  
https://github.com/shemminger/iproute2/blob/main/lib/json_writer.c