trace: implement register API
[dpdk.git] / lib / librte_eal / common / eal_trace.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2020 Marvell International Ltd.
3  */
4
5 #ifndef __EAL_TRACE_H
6 #define __EAL_TRACE_H
7
8 #include <rte_trace.h>
9 #include <rte_trace_point.h>
10
11 #define trace_err(fmt, args...) \
12         RTE_LOG(ERR, EAL, "%s():%u " fmt "\n", __func__, __LINE__, ## args)
13
14 #define trace_crit(fmt, args...) \
15         RTE_LOG(CRIT, EAL, "%s():%u " fmt "\n", __func__, __LINE__, ## args)
16
17 #define TRACE_CTF_FIELD_SIZE 384
18 #define TRACE_POINT_NAME_SIZE 64
19
20 struct trace_point {
21         STAILQ_ENTRY(trace_point) next;
22         rte_trace_point_t *handle;
23         char name[TRACE_POINT_NAME_SIZE];
24         char ctf_field[TRACE_CTF_FIELD_SIZE];
25 };
26
27 struct trace {
28         int register_errno;
29         uint32_t nb_trace_points;
30 };
31
32 /* Trace point list functions */
33 STAILQ_HEAD(trace_point_head, trace_point);
34
35 #endif /* __EAL_TRACE_H */