XenevaOS
Loading...
Searching...
No Matches
tracepoint.h
Go to the documentation of this file.
1/*
2 * DCL tracepoint.h -- TRACE_EVENT becomes an empty static inline.
3 *
4 * drm_trace.h and trace/events/dma_fence.h declare events the drm/dma-fence
5 * .c files emit at runtime. The declarations keep the call sites parsing;
6 * the bodies do nothing (Xeneva has no ftrace). CREATE_TRACE_POINTS and
7 * DEFINE_TRACE/EXPORT_TRACEPOINT_SYMBOL expand to nothing, so the
8 * define_trace.h include at the bottom of those headers is inert too.
9 *
10 * TP_PROTO parenthesizes and the three generators do *not* add a second
11 * pair: `static inline void trace_##name proto { }` with proto expanding to
12 * `(struct dma_fence *fence)` is the declaration. Adding parens around
13 * `proto` as well produced `trace_fence_signaled((struct dma_fence *fence))`
14 * -- a parameter *expression* in parentheses, which has no name and so no
15 * type, and clang reported every one of trace/events/dma_fence.h's seven
16 * events as "type specifier missing ... implicit int".
17 *
18 * Each generator emits the call stub *and* mainline's `_enabled()` companion
19 * (tracepoint.h:222, which mainline builds on static_key_false). Every
20 * call site is `if (trace_x_enabled()) trace_x(...)`, and without the
21 * companion the condition is an implicit call at link time -- dma-fence.c:555
22 * is the one that did it, `trace_dma_fence_wait_end_enabled()` inside
23 * dma_fence_wait_timeout(). `false` rather than a static key: there is no
24 * ftrace to flip it on, which is the same reason the bodies are empty.
25 */
26#ifndef _LINUX_TRACEPOINT_H
27#define _LINUX_TRACEPOINT_H
28
29#include <stdbool.h>
30
31#define TP_PROTO(...) (__VA_ARGS__)
32#define TP_ARGS(...) (__VA_ARGS__)
33#define TP_CONDITION(c) (c)
34
35#define TRACE_EVENT(name, proto, args, ...) \
36 static inline void trace_##name proto { } \
37 static inline bool trace_##name##_enabled(void) { return false; }
38#define DEFINE_EVENT(class, name, proto, args, ...) \
39 static inline void trace_##name proto { } \
40 static inline bool trace_##name##_enabled(void) { return false; }
41#define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print, ...)
42#define DECLARE_TRACE(name, proto, args) \
43 static inline void trace_##name proto { } \
44 static inline bool trace_##name##_enabled(void) { return false; }
45#define DEFINE_TRACE(name)
46#define DECLARE_TRACE_CONDITION(name, proto, args, cond)
47
48#define EXPORT_TRACEPOINT_SYMBOL(name)
49#define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
50
51#define CREATE_TRACE_POINTS
52
53#endif /* _LINUX_TRACEPOINT_H */