X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Fust%2Fmarker.h;h=dbdbbe09f75bea1ddbedf8a4f00cb94205070c63;hb=2874fee50444405591974a7166313063b315efe1;hp=41ae10ab4a07301ed63fc998f8d592dffe2d61e0;hpb=535b0d0af1b6421ceb83e22821e85bc6919d16d9;p=ust.git diff --git a/include/ust/marker.h b/include/ust/marker.h index 41ae10a..dbdbbe0 100644 --- a/include/ust/marker.h +++ b/include/ust/marker.h @@ -26,12 +26,13 @@ */ #include +#include +#include #include #include -#include -#include struct ust_marker; +struct ust_marker_probe_array; /** * ust_marker_probe_func - Type of a marker probe function @@ -64,11 +65,11 @@ struct ust_marker { char state; /* State. */ char ptype; /* probe type : 0 : single, 1 : multi */ /* Probe wrapper */ - u16 channel_id; /* Numeric channel identifier, dynamic */ - u16 event_id; /* Numeric event identifier, dynamic */ + uint16_t channel_id; /* Numeric channel identifier, dynamic */ + uint16_t event_id; /* Numeric event identifier, dynamic */ void (*call)(const struct ust_marker *mdata, void *call_private, ...); struct ust_marker_probe_closure single; - struct ust_marker_probe_closure *multi; + struct ust_marker_probe_array *multi; const char *tp_name; /* Optional tracepoint name */ void *tp_cb; /* Optional tracepoint callback */ }; @@ -109,7 +110,7 @@ struct ust_marker { do { \ _DEFINE_UST_MARKER(channel, name, NULL, NULL, format); \ __ust_marker_check_format(format, ## args); \ - if (unlikely(__ust_marker_def_##name.state)) \ + if (__builtin_expect(!!(__ust_marker_def_##name.state), 0)) \ (__ust_marker_def_##name.call) \ (&__ust_marker_def_##name, call_private,\ ## args); \ @@ -126,11 +127,6 @@ struct ust_marker { #define ust_marker(name, format, args...) \ __ust_marker(ust, name, NULL, format, ## args) -static inline __attribute__((deprecated)) -void __trace_mark_is_deprecated() -{ -} - /** * UST_MARKER_NOARGS - Format string for a marker with no argument. */ @@ -138,7 +134,8 @@ void __trace_mark_is_deprecated() /* To be used for string format validity checking with gcc */ static inline -void __printf(1, 2) ___ust_marker_check_format(const char *fmt, ...) +void __attribute__((format(printf, 1, 2))) + ___ust_marker_check_format(const char *fmt, ...) { } @@ -194,7 +191,6 @@ int ust_marker_unregister_lib(struct ust_marker * const *ust_marker_start); * ust_marker(). */ #define trace_mark(channel, name, format, args...) \ - __trace_mark_is_deprecated(); \ ust_marker(name, format, ## args) static inline __attribute__((deprecated))