DPDK 21.11.9
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_metrics.h"
12
13#ifndef _RTE_METRICS_TELEMETRY_H_
14#define _RTE_METRICS_TELEMETRY_H_
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20enum rte_telemetry_stats_type {
21 PORT_STATS = 0,
22 GLOBAL_STATS = 1
23};
24
25struct telemetry_encode_param {
26 enum rte_telemetry_stats_type type;
27 struct port_param {
28 int num_metric_ids;
29 uint32_t metric_ids[RTE_METRICS_MAX_METRICS];
30 int num_port_ids;
31 uint32_t port_ids[RTE_MAX_ETHPORTS];
32 } pp;
33};
34
35struct telemetry_metrics_data {
36 int reg_index[RTE_MAX_ETHPORTS];
37 int metrics_register_done;
38};
39
40__rte_experimental
41int32_t rte_metrics_tel_reg_all_ethdev(int *metrics_register_done,
42 int *reg_index_list);
43
44__rte_experimental
45int32_t
46rte_metrics_tel_encode_json_format(struct telemetry_encode_param *ep,
47 char **json_buffer);
48
49__rte_experimental
50int32_t
51rte_metrics_tel_get_global_stats(struct telemetry_encode_param *ep);
52
53__rte_experimental
54int32_t
55rte_metrics_tel_get_port_stats_ids(struct telemetry_encode_param *ep);
56
57__rte_experimental
58int32_t
59rte_metrics_tel_get_ports_stats_json(struct telemetry_encode_param *ep,
60 int *reg_index, char **json_buffer);
61
62__rte_experimental
63int32_t
64rte_metrics_tel_extract_data(struct telemetry_encode_param *ep, json_t *data);
65
66#ifdef __cplusplus
67}
68#endif
69
70#endif