DPDK 22.11.5
rte_metrics_telemetry.h
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
3 */
4
5#ifdef RTE_HAS_JANSSON
6#include <jansson.h>
7#else
8#define json_t void *
9#endif
10
11#include <rte_compat.h>
12#include "rte_metrics.h"
13
14#ifndef _RTE_METRICS_TELEMETRY_H_
15#define _RTE_METRICS_TELEMETRY_H_
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21enum rte_telemetry_stats_type {
22 PORT_STATS = 0,
23 GLOBAL_STATS = 1
24};
25
26struct telemetry_encode_param {
27 enum rte_telemetry_stats_type type;
28 struct port_param {
29 int num_metric_ids;
30 uint32_t metric_ids[RTE_METRICS_MAX_METRICS];
31 int num_port_ids;
32 uint32_t port_ids[RTE_MAX_ETHPORTS];
33 } pp;
34};
35
36struct telemetry_metrics_data {
37 int reg_index[RTE_MAX_ETHPORTS];
38 int metrics_register_done;
39};
40
41__rte_experimental
42int32_t rte_metrics_tel_reg_all_ethdev(int *metrics_register_done,
43 int *reg_index_list);
44
45__rte_experimental
46int32_t
47rte_metrics_tel_encode_json_format(struct telemetry_encode_param *ep,
48 char **json_buffer);
49
50__rte_experimental
51int32_t
52rte_metrics_tel_get_global_stats(struct telemetry_encode_param *ep);
53
54__rte_experimental
55int32_t
56rte_metrics_tel_get_port_stats_ids(struct telemetry_encode_param *ep);
57
58__rte_experimental
59int32_t
60rte_metrics_tel_get_ports_stats_json(struct telemetry_encode_param *ep,
61 int *reg_index, char **json_buffer);
62
63__rte_experimental
64int32_t
65rte_metrics_tel_extract_data(struct telemetry_encode_param *ep, json_t *data);
66
67#ifdef __cplusplus
68}
69#endif
70
71#endif