DPDK 22.11.7
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#ifdef __cplusplus
9extern "C" {
10#endif
11
12#include <stdint.h>
13
15#define RTE_TEL_MAX_STRING_LEN 128
17#define RTE_TEL_MAX_SINGLE_STRING_LEN 8192
19#define RTE_TEL_MAX_DICT_ENTRIES 256
21#define RTE_TEL_MAX_ARRAY_ENTRIES 512
22
34struct rte_tel_data;
35
43 RTE_TEL_STRING_VAL,
47};
48
59int
60rte_tel_data_start_array(struct rte_tel_data *d, enum rte_tel_value_type type);
61
74int
75rte_tel_data_start_dict(struct rte_tel_data *d);
76
87int
88rte_tel_data_string(struct rte_tel_data *d, const char *str);
89
102int
103rte_tel_data_add_array_string(struct rte_tel_data *d, const char *str);
104
117int
118rte_tel_data_add_array_int(struct rte_tel_data *d, int x);
119
132int
133rte_tel_data_add_array_u64(struct rte_tel_data *d, uint64_t x);
134
152int
153rte_tel_data_add_array_container(struct rte_tel_data *d,
154 struct rte_tel_data *val, int keep);
155
171int
172rte_tel_data_add_dict_string(struct rte_tel_data *d, const char *name,
173 const char *val);
174
189int
190rte_tel_data_add_dict_int(struct rte_tel_data *d, const char *name, int val);
191
206int
207rte_tel_data_add_dict_u64(struct rte_tel_data *d,
208 const char *name, uint64_t val);
209
230int
231rte_tel_data_add_dict_container(struct rte_tel_data *d, const char *name,
232 struct rte_tel_data *val, int keep);
233
251typedef int (*telemetry_cb)(const char *cmd, const char *params,
252 struct rte_tel_data *info);
253
263typedef void * (*handler)(void *sock_id);
264
282int
283rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help);
284
285
293struct rte_tel_data *
295
304void
305rte_tel_data_free(struct rte_tel_data *data);
306
307#ifdef __cplusplus
308}
309#endif
310
311#endif
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)
int rte_tel_data_start_array(struct rte_tel_data *d, enum rte_tel_value_type type)
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_array_int(struct rte_tel_data *d, int x)
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_u64(struct rte_tel_data *d, uint64_t x)
int rte_tel_data_add_array_string(struct rte_tel_data *d, const char *str)
int rte_tel_data_add_dict_int(struct rte_tel_data *d, const char *name, int val)
rte_tel_value_type
Definition: rte_telemetry.h:42
@ RTE_TEL_INT_VAL
Definition: rte_telemetry.h:44
@ RTE_TEL_U64_VAL
Definition: rte_telemetry.h:45
@ RTE_TEL_CONTAINER
Definition: rte_telemetry.h:46