From: Mathieu Desnoyers Date: Fri, 15 Jul 2011 18:44:09 +0000 (-0400) Subject: Add backward compatibility for tracepoints (qemu-kvm is using them) X-Git-Tag: v0.15~1 X-Git-Url: https://git.lttng.org/?p=ust.git;a=commitdiff_plain;h=2874fee50444405591974a7166313063b315efe1 Add backward compatibility for tracepoints (qemu-kvm is using them) Don't break compatibility needlessly before UST 2.0. Signed-off-by: Mathieu Desnoyers --- diff --git a/include/ust/marker.h b/include/ust/marker.h index e8608a9..dbdbbe0 100644 --- a/include/ust/marker.h +++ b/include/ust/marker.h @@ -127,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. */ @@ -196,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)) diff --git a/include/ust/tracepoint.h b/include/ust/tracepoint.h index 3d61f72..9463e40 100644 --- a/include/ust/tracepoint.h +++ b/include/ust/tracepoint.h @@ -124,6 +124,29 @@ struct tracepoint { { \ return __tracepoint_probe_unregister(#name, (void *)probe, \ data); \ + } \ + /* \ + * Backward-compatibility API (will be deprecated): \ + * trace_* \ + * register_trace_* \ + * unregister_trace_* \ + */ \ + static inline void trace_##name(proto) \ + { \ + __CHECK_TRACE(name, TP_PROTO(proto), \ + TP_ARGS(args)); \ + } \ + static inline int \ + register_trace_##name(void (*probe)(proto)) \ + { \ + return __tracepoint_probe_register(#name, (void *)probe,\ + NULL); \ + } \ + static inline int \ + unregister_trace_##name(void (*probe)(proto)) \ + { \ + return __tracepoint_probe_unregister(#name, (void *)probe, \ + NULL); \ } /* @@ -194,6 +217,16 @@ int tracepoint_register_lib(struct tracepoint * const *tracepoints_start, extern int tracepoint_unregister_lib(struct tracepoint * const *tracepoints_start); +/* + * Backward-compatibility API (will be deprecated): + * DEFINE_TRACE + * DECLARE_TRACE + * register_tracepoint + * unregister_tracepoint + */ +#define DEFINE_TRACE _DEFINE_TRACEPOINT +#define DECLARE_TRACE(name, proto, args) \ + _DECLARE_TRACEPOINT(name, TP_PARAMS(proto), TP_PARAMS(args)) #ifndef TRACEPOINT_EVENT /*