X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Flttng%2Ftracepoint.h;h=23f01547720b67a5068eb940df210c6714c6467e;hb=29d6f42146cb632bd8c8cee3d087aefc0f84dd91;hp=cbd01cb4f939d8885e12a496816799e9af5f9ea8;hpb=1d188af9688feee0ec4e34038113a0edccddd4ea;p=lttng-ust.git diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index cbd01cb4..23f01547 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -4,8 +4,8 @@ * Copyright (C) 2011-2012 Mathieu Desnoyers */ -#ifndef _LTTNG_TRACEPOINT_H -#define _LTTNG_TRACEPOINT_H +#ifndef _LTTNG_UST_TRACEPOINT_H +#define _LTTNG_UST_TRACEPOINT_H #include #include @@ -182,7 +182,8 @@ extern "C" { * address. */ #define LTTNG_UST__DECLARE_TRACEPOINT(_provider, _name, ...) \ -extern struct lttng_ust_tracepoint lttng_ust_tracepoint_##_provider##___##_name; \ +extern struct lttng_ust_tracepoint lttng_ust_tracepoint_##_provider##___##_name \ + LTTNG_UST__TRACEPOINT_DEFINITION_VISIBILITY; \ static inline \ void lttng_ust_tracepoint_cb_##_provider##___##_name(LTTNG_UST__TP_ARGS_PROTO(__VA_ARGS__)) \ __attribute__((always_inline, unused)) lttng_ust_notrace; \ @@ -482,7 +483,8 @@ extern struct lttng_ust_tracepoint * const __stop_lttng_ust_tracepoints_ptrs[] #define LTTNG_UST__DEFINE_TRACEPOINT(_provider, _name, _args) \ lttng_ust_tracepoint_validate_name_len(_provider, _name); \ - extern int lttng_ust_tracepoint_provider_##_provider; \ + extern int lttng_ust_tracepoint_provider_##_provider \ + LTTNG_UST__TRACEPOINT_PROVIDER_DEFINITION_VISIBILITY; \ static const char lttng_ust_tp_provider_strtab_##_provider##___##_name[] \ __attribute__((section("lttng_ust_tracepoints_strings"))) = \ #_provider; \ @@ -490,7 +492,8 @@ extern struct lttng_ust_tracepoint * const __stop_lttng_ust_tracepoints_ptrs[] __attribute__((section("lttng_ust_tracepoints_strings"))) = \ #_name; \ struct lttng_ust_tracepoint lttng_ust_tracepoint_##_provider##___##_name \ - __attribute__((section("lttng_ust_tracepoints"))) = { \ + __attribute__((section("lttng_ust_tracepoints"))) \ + LTTNG_UST__TRACEPOINT_DEFINITION_VISIBILITY = { \ sizeof(struct lttng_ust_tracepoint), \ lttng_ust_tp_provider_strtab_##_provider##___##_name, \ lttng_ust_tp_name_strtab_##_provider##___##_name, \ @@ -586,48 +589,49 @@ lttng_ust__tracepoints__ptrs_destroy(void) #define do_tracepoint lttng_ust_do_tracepoint #define tracepoint_enabled lttng_ust_tracepoint_enabled #define TP_ARGS LTTNG_UST_TP_ARGS -#define TP_FIELDS LTTNG_UST_TP_FIELDS - -#define ctf_integer lttng_ust_field_integer -#define ctf_integer_hex lttng_ust_field_integer_hex -#define ctf_integer_network lttng_ust_field_integer_network -#define ctf_integer_network_hex lttng_ust_field_integer_network_hex -#define ctf_integer_nowrite lttng_ust_field_integer_nowrite - -#define ctf_float lttng_ust_field_float -#define ctf_float_nowrite lttng_ust_field_float_nowrite - -#define ctf_array lttng_ust_field_array -#define ctf_array_hex lttng_ust_field_array_hex -#define ctf_array_network lttng_ust_field_array_network -#define ctf_array_network_hex lttng_ust_field_array_network_hex -#define ctf_array_text lttng_ust_field_array_text -#define ctf_array_nowrite lttng_ust_field_array_nowrite -#define ctf_array_nowrite_hex lttng_ust_field_array_nowrite_hex -#define ctf_array_network_nowrite lttng_ust_field_array_network_nowrite -#define ctf_array_network_nowrite_hex lttng_ust_field_array_network_nowrite_hex -#define ctf_array_text_nowrite lttng_ust_field_array_text_nowrite - -#define ctf_sequence lttng_ust_field_sequence -#define ctf_sequence_hex lttng_ust_field_sequence_hex -#define ctf_sequence_network lttng_ust_field_sequence_network -#define ctf_sequence_network_hex lttng_ust_field_sequence_network_hex -#define ctf_sequence_text lttng_ust_field_sequence_text -#define ctf_sequence_nowrite lttng_ust_field_sequence_nowrite -#define ctf_sequence_nowrite_hex lttng_ust_field_sequence_nowrite_hex -#define ctf_sequence_network_nowrite lttng_ust_field_sequence_network_nowrite -#define ctf_sequence_network_nowrite_hex lttng_ust_field_sequence_network_nowrite_hex -#define ctf_sequence_text_nowrite lttng_ust_field_sequence_text_nowrite #endif /* #if LTTNG_UST_COMPAT_API(0) */ #ifdef __cplusplus } #endif -#endif /* _LTTNG_TRACEPOINT_H */ +#endif /* _LTTNG_UST_TRACEPOINT_H */ /* The following declarations must be outside re-inclusion protection. */ +/* + * LTTNG_UST_TRACEPOINT_HIDDEN_DEFINITION: Define this before including + * a tracepoint instrumentation header to hide symbols associated with + * tracepoint module instrumentation. This is useful if all compile + * units using the lttng_ust_tracepoint(), + * lttng_ust_tracepoint_enabled() and lttng_ust_do_tracepoint() macros + * is within the same module as the compile unit including the + * tracepoint header after defining LTTNG_UST_TRACEPOINT_DEFINE. + */ + +#undef LTTNG_UST__TRACEPOINT_DEFINITION_VISIBILITY +#ifdef LTTNG_UST_TRACEPOINT_HIDDEN_DEFINITION +#define LTTNG_UST__TRACEPOINT_DEFINITION_VISIBILITY __attribute__((visibility("hidden"))) +#else +#define LTTNG_UST__TRACEPOINT_DEFINITION_VISIBILITY __attribute__((visibility("default"))) +#endif + +/* + * LTTNG_UST_TRACEPOINT_PROVIDER_HIDDEN_DEFINITION: Define this before + * including a tracepoint instrumentation header to hide symbols + * associated with the tracepoint provider. This is useful if the + * tracepoint definition (including the header after defining + * LTTNG_UST_TRACEPOINT_DEFINE) is in the same module as the provider + * (including the header after defining + * LTTNG_UST_TRACEPOINT_CREATE_PROBES). + */ +#undef LTTNG_UST__TRACEPOINT_PROVIDER_DEFINITION_VISIBILITY +#ifdef LTTNG_UST_TRACEPOINT_PROVIDER_HIDDEN_DEFINITION +#define LTTNG_UST__TRACEPOINT_PROVIDER_DEFINITION_VISIBILITY __attribute__((visibility("hidden"))) +#else +#define LTTNG_UST__TRACEPOINT_PROVIDER_DEFINITION_VISIBILITY __attribute__((visibility("default"))) +#endif + #ifndef LTTNG_UST_TRACEPOINT_ENUM /* @@ -641,18 +645,18 @@ lttng_ust__tracepoints__ptrs_destroy(void) * * LTTNG_UST_TRACEPOINT_ENUM(someproject_component, enumname, * LTTNG_UST_TP_ENUM_VALUES( - * ctf_enum_value("even", 0) - * ctf_enum_value("uneven", 1) - * ctf_enum_range("twoto4", 2, 4) - * ctf_enum_value("five", 5) + * lttng_ust_field_enum_value("even", 0) + * lttng_ust_field_enum_value("uneven", 1) + * lttng_ust_field_enum_range("twoto4", 2, 4) + * lttng_ust_field_enum_value("five", 5) * ) * ) * * Where "someproject_component" is the name of the component this enumeration * belongs to and "enumname" identifies this enumeration. Inside the * LTTNG_UST_TP_ENUM_VALUES macro is the actual mapping. Each string value can map - * to either a single value with ctf_enum_value or a range of values - * with ctf_enum_range. + * to either a single value with lttng_ust_field_enum_value or a range of values + * with lttng_ust_field_enum_range. * * Enumeration ranges may overlap, but the behavior is implementation-defined, * each trace reader will handle overlapping as it wishes. @@ -660,7 +664,7 @@ lttng_ust__tracepoints__ptrs_destroy(void) * That enumeration can then be used in a field inside the TP_FIELD macro using * the following line: * - * ctf_enum(someproject_component, enumname, enumtype, enumfield, enumval) + * lttng_ust_field_enum(someproject_component, enumname, enumtype, enumfield, enumval) * * Where "someproject_component" and "enumname" match those in the * LTTNG_UST_TRACEPOINT_ENUM, "enumtype" is a signed or unsigned integer type @@ -700,14 +704,14 @@ lttng_ust__tracepoints__ptrs_destroy(void) * lttng_ust_field_integer_hex(unsigned long, field_d, arg1) * * * Enumeration * - * ctf_enum(someproject_component, enum_name, int, field_e, arg0) + * lttng_ust_field_enum(someproject_component, enum_name, int, field_e, arg0) * * * Array Sequence, printed as UTF8-encoded array of bytes * * lttng_ust_field_array_text(char, field_b, string, FIXED_LEN) * lttng_ust_field_sequence_text(char, field_c, string, size_t, strlen) * * * String, printed as UTF8-encoded string * - * ctf_string(field_e, string) + * lttng_ust_field_string(field_e, string) * * * Array sequence of signed integer values * * lttng_ust_field_array(long, field_f, arg4, FIXED_LEN4)