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 09074428B3; Wed, 5 Apr 2023 03:20:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9664C40FDF; Wed, 5 Apr 2023 03:20:09 +0200 (CEST) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by mails.dpdk.org (Postfix) with ESMTP id 7E18540DDC for ; Wed, 5 Apr 2023 03:20:07 +0200 (CEST) Received: by mail-pg1-f179.google.com with SMTP id d22so20792479pgw.2 for ; Tue, 04 Apr 2023 18:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680657606; 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=kNj/OpRMmF2KnUGSQepLEEuRee8ExqFyyrLgj7ZBi6s=; b=yIAiT4/rNW4tuRrcp1szAmoU8DxVW8o6kbttfcfVEWDJB/cVolePzww3ZHdyDZV8PD 8vz1yyvWAJ8qrng6vg9b/rwDvbuzNjzMXjP/zBxF954x9isMjt73OQbRT+UFVgqWUz74 GiE7iAYEkxRlw4YnXhNCwGwJXqGHTpcva9gnM2FA3bntOjIvGohAc4b2aXNCSF7Q8LFi Ckc9Ze9urJXu8L0Vibk3Oa5+wFElqVn5p1Gseco0Q6zXJVZ/B58UW8rDv8uD3SpSthjn GmCVZcjZnoB2tqgyUtvDhuoX34WQLVTp8qfnv0NIdUyQ9Lsg056y+hamH0ZDA3++42L4 BqGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680657606; 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=kNj/OpRMmF2KnUGSQepLEEuRee8ExqFyyrLgj7ZBi6s=; b=J4fIkrdN5xTEVP9I2QkCaeyquHmuW33QEzyA0hcD5sevXB2RJlPAs16tdlrwUJJj7Z RNm6eQEe2XVbj9SNTwPOvTCeXVzK6nGSmqzlXYcu891KjoBW14rSoTfaCkJe5C1+X1Dj rcPp3tCw9X1uRXdfI841xaVv3z1+NTdKKjNdWugeW2iY7sNq4jq9j2u4BLYzUTwV8YF5 YxU30D/QfMksEWrwoWptva2Cc5ly0U7qWEY8S1iZLvDc01aukUYvNlx5eLoLHfjC8ecs /Mn8jM4kb3tBstiFaUtnGZzeKk9ZPX0NRVY0bHJjITPC8JtrSDuygspvK0XuOQwP6ffk 2ErA== X-Gm-Message-State: AAQBX9ektutpDDxrpyU9n1L2yQ6v9+UWEA1CPWBPlYTiB94dniVtRBgf Mnor26k5a8Te0uoy2JV6VvIEyQ== X-Google-Smtp-Source: AKy350agcJtBvNSOfYYejgwh2Rrjw0G/M9Ue0w7nGq2qa02/Ei3biDZi/DjUrHfdyTQ2euyYgXUxyQ== X-Received: by 2002:aa7:956d:0:b0:626:41b:2598 with SMTP id x13-20020aa7956d000000b00626041b2598mr3622082pfq.26.1680657606352; Tue, 04 Apr 2023 18:20:06 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id s3-20020aa78d43000000b005aa60d8545esm9364896pfe.61.2023.04.04.18.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 18:20:06 -0700 (PDT) Date: Tue, 4 Apr 2023 18:20:04 -0700 From: Stephen Hemminger To: Tyler Retzlaff Cc: Bruce Richardson , dev@dpdk.org, ciara.power@intel.com, david.marchand@redhat.com, thomas@monjalon.net Subject: Re: [PATCH 1/2] telemetry: use malloc instead of variable length array Message-ID: <20230404182004.43b3ff7e@hermes.local> In-Reply-To: <20230404173401.GA32118@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1680539424-20255-1-git-send-email-roretzla@linux.microsoft.com> <1680539424-20255-2-git-send-email-roretzla@linux.microsoft.com> <20230403131913.0aec54ce@hermes.local> <20230404162444.GB18560@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20230404164446.GF18560@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20230404173401.GA32118@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, 4 Apr 2023 10:34:01 -0700 Tyler Retzlaff wrote: > > > > I think suggestion #2 above should cover most cases, in which case using > > > > your original suggestion of malloc would be ok too for the rare case (if > > > > ever) where we don't just have one terminator on the end. > > > > > > maybe a dumb'd down compromise is to have a fixed stack limit and then > > > if it is exceeded always just go to malloc/free? > > > > > Perhaps. If you like, I have have a try at implementing my own suggestions > > above tomorrow. I'd like if we can get the "single-character-saving" option > > working, because that would be the most efficient method of all. > > that would be great, i'll take the help i can get. For the json print library in iproute2, it streams output using stdio, which avoids lots of string processing issues. Well, it moves them to be standard library.