From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: ciara.power@intel.com, roretzla@linux.microsoft.com,
Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH v3 0/5] telemetry: remove variable length arrays
Date: Wed, 5 Apr 2023 17:03:21 +0100 [thread overview]
Message-ID: <20230405160326.186921-1-bruce.richardson@intel.com> (raw)
In-Reply-To: <20230310181836.162336-1-bruce.richardson@intel.com>
This patchset introduces a series of changes to remove variable-length
arrays from the telemetry code. The first patch replaces a VLA with
malloc memory for the serialization of the json objects contained within
the main response object, which fixes a crash observed on alpine linux.
Subsequent patches rework the json printing code to avoid the use of
temporary buffers where possible, or use malloc-allocated memory where
not.
Based off testing with the unit tests for telemetry, json serialization
for the telemetry callbacks should always use the path where a temporary
buffer is *not* used, but the allocation-case is kept to ensure that any
unexpected edge-cases are covered too.
V3: remove use of non-standard asprintf function in patch 2.
V2: expand from single fix for Alpine, to general cleanup to remove VLAs
Bruce Richardson (5):
telemetry: fix autotest failures on Alpine
telemetry: remove variable length array in printf fn
telemetry: split out body of json string format fn
telemetry: rename local variables
telemetry: remove VLA in json string format function
app/test/test_telemetry_json.c | 2 +-
lib/telemetry/telemetry.c | 21 ++++++-
lib/telemetry/telemetry_json.h | 111 +++++++++++++++++++++++++--------
3 files changed, 104 insertions(+), 30 deletions(-)
--
2.37.2
next prev parent reply other threads:[~2023-04-05 16:04 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 18:18 [PATCH] telemetry: fix autotest failures on Alpine Bruce Richardson
2023-03-10 19:08 ` Stephen Hemminger
2023-03-13 9:38 ` Bruce Richardson
2023-04-05 15:44 ` [PATCH v2 0/5] telemetry: remove variable length arrays Bruce Richardson
2023-04-05 15:44 ` [PATCH v2 1/5] telemetry: fix autotest failures on Alpine Bruce Richardson
2023-04-07 19:21 ` Tyler Retzlaff
2023-04-11 8:43 ` Bruce Richardson
2023-04-05 15:44 ` [PATCH v2 2/5] telemetry: remove variable length array in printf fn Bruce Richardson
2023-04-05 15:44 ` [PATCH v2 3/5] telemetry: split out body of json string format fn Bruce Richardson
2023-04-05 15:44 ` [PATCH v2 4/5] telemetry: rename local variables Bruce Richardson
2023-04-05 15:44 ` [PATCH v2 5/5] telemetry: remove VLA in json string format function Bruce Richardson
2023-04-05 16:03 ` Bruce Richardson [this message]
2023-04-05 16:03 ` [PATCH v3 1/5] telemetry: fix autotest failures on Alpine Bruce Richardson
2023-04-07 19:22 ` Tyler Retzlaff
2023-04-05 16:03 ` [PATCH v3 2/5] telemetry: remove variable length array in printf fn Bruce Richardson
2023-04-07 19:25 ` Tyler Retzlaff
2023-04-05 16:03 ` [PATCH v3 3/5] telemetry: split out body of json string format fn Bruce Richardson
2023-04-07 19:28 ` Tyler Retzlaff
2023-04-05 16:03 ` [PATCH v3 4/5] telemetry: rename local variables Bruce Richardson
2023-04-07 19:50 ` Tyler Retzlaff
2023-04-11 8:58 ` Bruce Richardson
2023-04-05 16:03 ` [PATCH v3 5/5] telemetry: remove VLA in json string format function Bruce Richardson
2023-04-07 19:54 ` Tyler Retzlaff
2023-05-25 7:12 ` David Marchand
2023-05-24 20:47 ` [PATCH v3 0/5] telemetry: remove variable length arrays Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230405160326.186921-1-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=ciara.power@intel.com \
--cc=dev@dpdk.org \
--cc=roretzla@linux.microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).