1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2020 Marvell International Ltd.
8 #include <rte_spinlock.h>
10 #include <rte_trace_point.h>
13 #define trace_err(fmt, args...) \
14 RTE_LOG(ERR, EAL, "%s():%u " fmt "\n", __func__, __LINE__, ## args)
16 #define trace_crit(fmt, args...) \
17 RTE_LOG(CRIT, EAL, "%s():%u " fmt "\n", __func__, __LINE__, ## args)
19 #define TRACE_PREFIX_LEN 12
20 #define TRACE_DIR_STR_LEN (sizeof("YYYY-mm-dd-AM-HH-MM-SS") + TRACE_PREFIX_LEN)
21 #define TRACE_CTF_FIELD_SIZE 384
22 #define TRACE_POINT_NAME_SIZE 64
25 STAILQ_ENTRY(trace_point) next;
26 rte_trace_point_t *handle;
27 char name[TRACE_POINT_NAME_SIZE];
28 char ctf_field[TRACE_CTF_FIELD_SIZE];
36 enum rte_trace_mode mode;
39 uint32_t nb_trace_points;
43 /* Helper functions */
44 static inline uint16_t
45 trace_id_get(rte_trace_point_t *trace)
47 return (*trace & __RTE_TRACE_FIELD_ID_MASK) >>
48 __RTE_TRACE_FIELD_ID_SHIFT;
51 /* Trace object functions */
52 struct trace *trace_obj_get(void);
54 /* Trace point list functions */
55 STAILQ_HEAD(trace_point_head, trace_point);
56 struct trace_point_head *trace_list_head_get(void);
59 bool trace_has_duplicate_entry(void);
60 void trace_uuid_generate(void);
61 int trace_mkdir(void);
64 int eal_trace_init(void);
65 void eal_trace_fini(void);
67 #endif /* __EAL_TRACE_H */