1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2018 Intel Corporation 3 */ 4 5 #include <stdint.h> 6 7 #ifndef _RTE_TELEMETRY_H_ 8 #define _RTE_TELEMETRY_H_ 9 10 /** 11 * @file 12 * RTE Telemetry 13 * 14 * The telemetry library provides a method to retrieve statistics from 15 * DPDK by sending a JSON encoded message over a socket. DPDK will send 16 * a JSON encoded response containing telemetry data. 17 ***/ 18 19 /** 20 * @warning 21 * @b EXPERIMENTAL: this API may change without prior notice 22 * 23 * Initialize Telemetry 24 * 25 * @return 26 * 0 on successful initialisation. 27 * @return 28 * -ENOMEM on memory allocation error 29 * @return 30 * -EPERM on unknown error failure 31 * @return 32 * -EALREADY if Telemetry is already initialised. 33 */ 34 int32_t __rte_experimental 35 rte_telemetry_init(void); 36 37 /** 38 * @warning 39 * @b EXPERIMENTAL: this API may change without prior notice 40 * 41 * Clean up and free memory. 42 * 43 * @return 44 * 0 on success 45 * @return 46 * -EPERM on failure 47 */ 48 int32_t __rte_experimental 49 rte_telemetry_cleanup(void); 50 51 /** 52 * @warning 53 * @b EXPERIMENTAL: this API may change without prior notice 54 * 55 * Runs various tests to ensure telemetry initialisation and register/unregister 56 * functions are working correctly. 57 * 58 * @return 59 * 0 on success when all tests have passed 60 * @return 61 * -1 on failure when the test has failed 62 */ 63 int32_t __rte_experimental 64 rte_telemetry_selftest(void); 65 66 #endif 67