[v3,2/4] telemetry: extend valid command characters
Checks
Commit Message
The trace framework wants to reference trace point names as keys in
dicts. Those names can contain '.', so add it to the list of valid
characters in the telemetry library.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/telemetry/rte_telemetry.h | 10 +++++-----
lib/telemetry/telemetry_data.c | 1 +
2 files changed, 6 insertions(+), 5 deletions(-)
Comments
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Tuesday 25 October 2022 10:01
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Power, Ciara
> <ciara.power@intel.com>
> Subject: [PATCH v3 2/4] telemetry: extend valid command characters
>
> The trace framework wants to reference trace point names as keys in dicts.
> Those names can contain '.', so add it to the list of valid characters in the
> telemetry library.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> lib/telemetry/rte_telemetry.h | 10 +++++----- lib/telemetry/telemetry_data.c |
> 1 +
> 2 files changed, 6 insertions(+), 5 deletions(-)
Acked-by: Ciara Power <ciara.power@intel.com>
@@ -68,7 +68,7 @@ rte_tel_data_start_array(struct rte_tel_data *d, enum rte_tel_value_type type);
*
* Dictionaries consist of key-values pairs to be returned, where the keys,
* or names, are strings and the values can be any of the types supported by telemetry.
- * Name strings may only contain alphanumeric characters as well as '_' or '/'
+ * Name strings may only contain alphanumeric characters as well as '_', '/' or '.'
*
* @param d
* The data structure passed to the callback
@@ -181,7 +181,7 @@ rte_tel_data_add_array_bool(struct rte_tel_data *d, bool x);
* The data structure passed to the callback
* @param name
* The name the value is to be stored under in the dict
- * Must contain only alphanumeric characters or the symbols: '_' or '/'
+ * Must contain only alphanumeric characters or the symbols: '_', '/' or '.'
* @param val
* The string to be stored in the dict
* @return
@@ -200,7 +200,7 @@ rte_tel_data_add_dict_string(struct rte_tel_data *d, const char *name,
* The data structure passed to the callback
* @param name
* The name the value is to be stored under in the dict
- * Must contain only alphanumeric characters or the symbols: '_' or '/'
+ * Must contain only alphanumeric characters or the symbols: '_', '/' or '.'
* @param val
* The number to be stored in the dict
* @return
@@ -217,7 +217,7 @@ rte_tel_data_add_dict_int(struct rte_tel_data *d, const char *name, int val);
* The data structure passed to the callback
* @param name
* The name the value is to be stored under in the dict
- * Must contain only alphanumeric characters or the symbols: '_' or '/'
+ * Must contain only alphanumeric characters or the symbols: '_', '/' or '.'
* @param val
* The number to be stored in the dict
* @return
@@ -237,7 +237,7 @@ rte_tel_data_add_dict_u64(struct rte_tel_data *d,
* The data structure passed to the callback
* @param name
* The name the value is to be stored under in the dict.
- * Must contain only alphanumeric characters or the symbols: '_' or '/'
+ * Must contain only alphanumeric characters or the symbols: '_', '/' or '.'
* @param val
* The pointer to the container to be stored in the dict.
* @param keep
@@ -119,6 +119,7 @@ valid_name(const char *name)
['a' ... 'z'] = 1,
['_'] = 1,
['/'] = 1,
+ ['.'] = 1,
};
while (*name != '\0') {
if ((size_t)*name >= RTE_DIM(allowed) || allowed[(int)*name] == 0)