/* * This part is compiled out, it is only here as a build time check * to make sure that if the tracepoint handling changes, the * bpf probe will fail to compile unless it too is updated.
*/ #define __DEFINE_EVENT(template, call, proto, args, size) \ staticinlinevoid bpf_test_probe_##call(void) \
{ \
check_trace_callback_type_##call(__bpf_trace_##template); \
} \ typedefvoid (*btf_trace_##call)(void *__data, proto); \ staticunion { \ struct bpf_raw_event_map event; \
btf_trace_##call handler; \
} __bpf_trace_tp_map_##call __used \
__section("__bpf_raw_tp_map") = { \
.event = { \
.tp = &__tracepoint_##call, \
.bpf_func = __bpf_trace_##template, \
.num_args = COUNT_ARGS(args), \
.writable_size = size, \
}, \
};
#define FIRST(x, ...) x
#define __CHECK_WRITABLE_BUF_SIZE(call, proto, args, size) \ staticinlinevoid bpf_test_buffer_##call(void) \
{ \ /* BUILD_BUG_ON() is ignored if the code is completely eliminated, but \ * BUILD_BUG_ON_ZERO() uses a different mechanism that is not \ * dead-code-eliminated. \
*/
FIRST(proto); \
(void)BUILD_BUG_ON_ZERO(size != sizeof(*FIRST(args))); \
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.