DPDK 25.03.0-rc0
rte_telemetry.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
3 */
4
5#ifndef _RTE_TELEMETRY_H_
6#define _RTE_TELEMETRY_H_
7
8#include <stdint.h>
9#include <rte_compat.h>
10#include <rte_common.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
17#define RTE_TEL_MAX_STRING_LEN 128
19#define RTE_TEL_MAX_SINGLE_STRING_LEN 8192
21#define RTE_TEL_MAX_DICT_ENTRIES 256
23#define RTE_TEL_MAX_ARRAY_ENTRIES 512
24
36struct rte_tel_data;
37
45 RTE_TEL_STRING_VAL,
49};
50
51#define RTE_TEL_U64_VAL RTE_TEL_UINT_VAL
52
63int
64rte_tel_data_start_array(struct rte_tel_data *d, enum rte_tel_value_type type);
65
78int
79rte_tel_data_start_dict(struct rte_tel_data *d);
80
91int
92rte_tel_data_string(struct rte_tel_data *d, const char *str);
93
106int
107rte_tel_data_add_array_string(struct rte_tel_data *d, const char *str);
108
121int
122rte_tel_data_add_array_int(struct rte_tel_data *d, int64_t x);
123
136int
137rte_tel_data_add_array_uint(struct rte_tel_data *d, uint64_t x);
138
151int
152rte_tel_data_add_array_u64(struct rte_tel_data *d, uint64_t x)
153 __rte_deprecated_msg("use 'rte_tel_data_add_array_uint' instead");
154
172int
173rte_tel_data_add_array_container(struct rte_tel_data *d,
174 struct rte_tel_data *val, int keep);
175
193__rte_experimental
194int
195rte_tel_data_add_array_uint_hex(struct rte_tel_data *d, uint64_t val,
196 uint8_t display_bitwidth);
197
213int
214rte_tel_data_add_dict_string(struct rte_tel_data *d, const char *name,
215 const char *val);
216
231int
232rte_tel_data_add_dict_int(struct rte_tel_data *d, const char *name, int64_t val);
233
248int
249rte_tel_data_add_dict_uint(struct rte_tel_data *d,
250 const char *name, uint64_t val);
251
266int
267rte_tel_data_add_dict_u64(struct rte_tel_data *d,
268 const char *name, uint64_t val)
269 __rte_deprecated_msg("use 'rte_tel_data_add_dict_uint' instead");
270
291int
292rte_tel_data_add_dict_container(struct rte_tel_data *d, const char *name,
293 struct rte_tel_data *val, int keep);
294
314__rte_experimental
315int
316rte_tel_data_add_dict_uint_hex(struct rte_tel_data *d, const char *name,
317 uint64_t val, uint8_t display_bitwidth);
318
336typedef int (*telemetry_cb)(const char *cmd, const char *params,
337 struct rte_tel_data *info);
338
360typedef int (*telemetry_arg_cb)(const char *cmd, const char *params, void *arg,
361 struct rte_tel_data *info);
362
372typedef void * (*handler)(void *sock_id);
373
391int
392rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help);
393
413__rte_experimental
414int
415rte_telemetry_register_cmd_arg(const char *cmd, telemetry_arg_cb fn, void *arg, const char *help);
416
424struct rte_tel_data *
426
435void
436rte_tel_data_free(struct rte_tel_data *data);
437
438#ifdef __cplusplus
439}
440#endif
441
442#endif
int rte_tel_data_add_array_uint(struct rte_tel_data *d, uint64_t x)
struct rte_tel_data * rte_tel_data_alloc(void)
int rte_tel_data_add_dict_string(struct rte_tel_data *d, const char *name, const char *val)
int rte_tel_data_add_dict_u64(struct rte_tel_data *d, const char *name, uint64_t val) __rte_deprecated_msg("use 'rte_tel_data_add_dict_uint' instead")
int rte_tel_data_start_array(struct rte_tel_data *d, enum rte_tel_value_type type)
int rte_tel_data_add_array_int(struct rte_tel_data *d, int64_t x)
int rte_tel_data_string(struct rte_tel_data *d, const char *str)
int rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help)
int(* telemetry_cb)(const char *cmd, const char *params, struct rte_tel_data *info)
int rte_tel_data_add_dict_container(struct rte_tel_data *d, const char *name, struct rte_tel_data *val, int keep)
int rte_tel_data_add_dict_uint(struct rte_tel_data *d, const char *name, uint64_t val)
int rte_tel_data_add_array_container(struct rte_tel_data *d, struct rte_tel_data *val, int keep)
int rte_tel_data_start_dict(struct rte_tel_data *d)
int rte_tel_data_add_array_string(struct rte_tel_data *d, const char *str)
__rte_experimental int rte_tel_data_add_array_uint_hex(struct rte_tel_data *d, uint64_t val, uint8_t display_bitwidth)
__rte_experimental int rte_telemetry_register_cmd_arg(const char *cmd, telemetry_arg_cb fn, void *arg, const char *help)
int rte_tel_data_add_dict_int(struct rte_tel_data *d, const char *name, int64_t val)
rte_tel_value_type
Definition: rte_telemetry.h:44
@ RTE_TEL_INT_VAL
Definition: rte_telemetry.h:46
@ RTE_TEL_CONTAINER
Definition: rte_telemetry.h:48
@ RTE_TEL_UINT_VAL
Definition: rte_telemetry.h:47
int rte_tel_data_add_array_u64(struct rte_tel_data *d, uint64_t x) __rte_deprecated_msg("use 'rte_tel_data_add_array_uint' instead")
__rte_experimental int rte_tel_data_add_dict_uint_hex(struct rte_tel_data *d, const char *name, uint64_t val, uint8_t display_bitwidth)
int(* telemetry_arg_cb)(const char *cmd, const char *params, void *arg, struct rte_tel_data *info)