X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Fust%2Fmarker.h;h=009548fb533ecf5f1da5732dc8b6280af16e56b1;hb=7a05c99d86cae6ab93f9122125f632ba9063f498;hp=99bb724cb789b3d0e429f7b65863725917266dd2;hpb=b521931e0000388ff9080d46719936be98af54c6;p=ust.git diff --git a/include/ust/marker.h b/include/ust/marker.h index 99bb724..009548f 100644 --- a/include/ust/marker.h +++ b/include/ust/marker.h @@ -8,8 +8,8 @@ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * License as published by the Free Software Foundation; + * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -25,7 +25,6 @@ #define _UST_MARKER_H #include -#include #include #include #include @@ -64,7 +63,7 @@ struct ust_marker { const char *format; /* Marker format string, describing the * variable argument list. */ - DEFINE_IMV(char, state);/* Immediate value state. */ + char state; /* State. */ char ptype; /* probe type : 0 : single, 1 : multi */ /* Probe wrapper */ u16 channel_id; /* Numeric channel identifier, dynamic */ @@ -125,7 +124,7 @@ struct ust_marker { _ASM_PTR "(1f)\n\t" /* location */ \ ".previous\n\t" \ /*".section __ust_marker_ptrs\n\t"*/ \ - ".section __ust_marker_ptrs,\"a\"\n\t" \ + ".section __ust_marker_ptrs,\"aw\"\n\t" \ _ASM_PTR "(2b)\n\t" \ ".previous\n\t" \ "1:\n\t" \ @@ -161,27 +160,18 @@ struct ust_marker { * Make sure the alignment of the structure in the __ust_marker section will * not add unwanted padding between the beginning of the section and the * structure. Force alignment to the same alignment as the section start. - * - * The "generic" argument controls which marker enabling mechanism must be used. - * If generic is true, a variable read is used. - * If generic is false, immediate values are used. */ -#define __ust_marker(generic, channel, name, call_private, format, args...) \ - __ust_marker_counter(generic, channel, name, __LINE__, call_private, format, ## args) +#define __ust_marker(channel, name, call_private, format, args...) \ + __ust_marker_counter(channel, name, __LINE__, call_private, format, ## args) -#define __ust_marker_counter(generic, channel, name, unique, call_private, format, args...) \ +#define __ust_marker_counter(channel, name, unique, call_private, format, args...) \ do { \ struct ust_marker *__ust_marker_counter_ptr; \ _DEFINE_UST_MARKER(channel, name, NULL, NULL, format, unique, __ust_marker_counter_ptr); \ __ust_marker_check_format(format, ## args); \ - if (!generic) { \ - if (unlikely(imv_read(__ust_marker_counter_ptr->state))) \ - (__ust_marker_counter_ptr->call)(__ust_marker_counter_ptr, call_private, &__ust_marker_regs, ## args); \ - } else { \ - if (unlikely(_imv_read(__ust_marker_counter_ptr->state))) \ - (__ust_marker_counter_ptr->call)(__ust_marker_counter_ptr, call_private, &__ust_marker_regs, ## args); \ - } \ + if (unlikely(__ust_marker_counter_ptr->state)) \ + (__ust_marker_counter_ptr->call)(__ust_marker_counter_ptr, call_private, &__ust_marker_regs, ## args); \ } while (0) #define __ust_marker_tp(channel, name, call_private, tp_name, tp_cb, format, args...) \ @@ -209,24 +199,24 @@ extern void ust_marker_update_probe_range(struct ust_marker * const *begin, * @format: format string * @args...: variable argument list * - * Places a marker using optimized code patching technique (imv_read()) - * to be enabled when immediate values are present. + * Places a marker at caller site. */ #define ust_marker(name, format, args...) \ - __ust_marker(0, ust, name, NULL, format, ## args) + __ust_marker(ust, name, NULL, format, ## args) -/** - * _ust_marker - Marker using variable read + +/* + * trace_mark() -- TO BE DEPRECATED + * @channel: name prefix, not quoted. Ignored. * @name: marker name, not quoted. * @format: format string * @args...: variable argument list * - * Places a marker using a standard memory read (_imv_read()) to be - * enabled. Should be used for markers in code paths where instruction - * modification based enabling is not welcome. + * Kept as a compatibility API and will be *DEPRECATED* in favor of + * ust_marker(). */ -#define _ust_marker(name, format, args...) \ - __ust_marker(1, ust, name, NULL, format, ## args) +#define trace_mark(channel, name, format, args...) \ + ust_marker(name, format, ## args) /** * ust_marker_tp - Marker in a tracepoint callback @@ -247,6 +237,12 @@ extern void ust_marker_update_probe_range(struct ust_marker * const *begin, */ #define UST_MARKER_NOARGS " " +/** + * MARKER_NOARGS - Compatibility API. Will be *DEPRECATED*. Use + * UST_MARKER_NOARGS instead. + */ +#define MARK_NOARGS UST_MARKER_NOARGS + extern void lock_ust_marker(void); extern void unlock_ust_marker(void); @@ -357,6 +353,12 @@ extern int ust_marker_unregister_lib(struct ust_marker * const *ust_marker_start ust_marker_unregister_lib(__start___ust_marker_ptrs); \ } +/* + * MARKER_LIB is kept for backward compatibility and will be + * *DEPRECATED*. Use UST_MARKER_LIB instead. + */ +#define MARKER_LIB UST_MARKER_LIB + extern void ust_marker_set_new_ust_marker_cb(void (*cb)(struct ust_marker *)); extern void init_ust_marker(void);