Skip to content

telemetry: remove variable length arrays

Bruce Richardson dpdk-dev 3 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 8 repliesApplied
  2. v25 patches 2 repliesSuperseded
  3. v11 patch 2 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/5telemetry: fix autotest failures on Alpinelib/telemetry/telemetry.c+18 -31 reply
2/5telemetry: remove variable length array in printf fnlib/telemetry/telemetry_json.h+32 -41 reply
3/5telemetry: split out body of json string format fnlib/telemetry/telemetry_json.h+24 -81 reply
4/5telemetry: rename local variableslib/telemetry/telemetry_json.h+16 -162 replies
5/5telemetry: remove VLA in json string format functionapp/test/test_telemetry_json.c lib/telemetry/telemetry_json.h+18 -32 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchTyler Retzlaff
1/5A-b
2/5A-b
3/5A-b
4/5A-b
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/5] telemetry: remove variable length arrays

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