/* * File can be included directly by headers who only want to access * tracepoint->key to guard out of line trace calls, or the definition of * trace_print_flags{_u64}. Otherwise linux/tracepoint.h should be used.
*/
/* * If a tracepoint needs to be called from a header file, it is not * recommended to call it directly, as tracepoints in header files * may cause side-effects and bloat the kernel. Instead, use * tracepoint_enabled() to test if the tracepoint is enabled, then if * it is, call a wrapper function defined in a C file that will then * call the tracepoint. * * For "trace_foo_bar()", you would need to create a wrapper function * in a C file to call trace_foo_bar(): * void do_trace_foo_bar(args) { trace_foo_bar(args); } * Then in the header file, declare the tracepoint: * DECLARE_TRACEPOINT(foo_bar); * And call your wrapper: * static inline void some_inlined_function() { * [..] * if (tracepoint_enabled(foo_bar)) * do_trace_foo_bar(args); * [..] * } * * Note: tracepoint_enabled(foo_bar) is equivalent to trace_foo_bar_enabled() * but is safe to have in headers, where trace_foo_bar_enabled() is not.
*/ #define DECLARE_TRACEPOINT(tp) \ externstruct tracepoint __tracepoint_##tp
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.