Skip to content

Commit 874e025

Browse files
lgdacunhigaw
authored andcommitted
plugins/solidigm: Removed Telemetry parser array to string conversion.
Keeping uint8_t arrays as arrays if it not clear it is a string. Signed-off-by: Leonardo da Cunha <leonardo.da.cunha@solidigm.com>
1 parent 4c975fd commit 874e025

1 file changed

Lines changed: 0 additions & 47 deletions

File tree

plugins/solidigm/solidigm-telemetry/data-area.c

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,6 @@
2323
#define MAX_ARRAY_RANK 16
2424
#define NLOG_HEADER_ID 101
2525

26-
static bool uint8_array_try_string(const struct telemetry_log *tl,
27-
uint64_t offset_bit, uint32_t size_bit,
28-
uint32_t array_size,
29-
struct json_object **str_obj)
30-
{
31-
uint32_t offset_byte = (uint32_t)offset_bit / NUM_BITS_IN_BYTE;
32-
33-
if (size_bit != 8) {
34-
*str_obj = json_object_new_string(
35-
"Error: Only UINT8 arrays can be converted to strings");
36-
return false;
37-
}
38-
39-
if (offset_byte > (tl->log_size - array_size)) {
40-
char err_msg[MAX_WARNING_SIZE];
41-
42-
snprintf(err_msg, MAX_WARNING_SIZE,
43-
"String offset greater than binary size (%u > %zu).",
44-
offset_byte, tl->log_size);
45-
*str_obj = json_object_new_string(err_msg);
46-
return false;
47-
}
48-
49-
// Get direct pointer to the UINT8 array in the telemetry log
50-
const uint8_t *data_ptr = (const uint8_t *)tl->log + offset_byte;
51-
52-
// Use the generic converter function
53-
return sldm_uint8_array_to_string(data_ptr, array_size, str_obj);
54-
}
55-
5626
static void reverse_string(char *buff, size_t len)
5727
{
5828
char *start = buff;
@@ -298,23 +268,6 @@ int sldm_telemetry_structure_parse(const struct telemetry_log *tl,
298268
sub_output = output;
299269

300270
if (array_size_dimension[0] > 1 || force_array) {
301-
// Check if this is a UINT8 array that should be treated as a string
302-
if (json_object_is_type(output, json_type_object) &&
303-
(strcmp(type, "UINT8") == 0 || strcmp(type, "uint8_t") == 0) && !force_array) {
304-
// Handle UINT8 arrays as strings
305-
struct json_object *str_obj = NULL;
306-
uint64_t offset = parent_offset_bit + offset_bit;
307-
308-
if (uint8_array_try_string(tl, offset, size_bit,
309-
array_size_dimension[0], &str_obj)) {
310-
json_object_object_add(output, name, str_obj);
311-
return 0;
312-
}
313-
314-
// If string conversion failed, fall back to normal array processing
315-
json_object_put(str_obj);
316-
}
317-
318271
/*
319272
* When output is already an array (from an outer
320273
* multi-dim call), fill it directly to avoid extra wrap.

0 commit comments

Comments
 (0)