Move perf counter symbols to private header
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 3 Mar 2021 22:32:55 +0000 (17:32 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 4 Mar 2021 19:11:52 +0000 (14:11 -0500)
This is an API change but the major SONAME bump to '1' gives us the
opportunity to hide symbols that should have been private from the
start.

This also allows to stop exposing LTTNG_UST_HAVE_PERF_EVENT in the
public headers.

Change-Id: I43893b7bad6d447e86af33ad99def6c76689123f
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac
include/lttng/ust-config.h.in
include/lttng/ust-events.h
liblttng-ust-ctl/ustctl.c
liblttng-ust/lttng-context-perf-counters.c
liblttng-ust/lttng-tracer-core.h
liblttng-ust/ust-events-internal.h

index 3c92b40749492b05ccdfefc87e6764fb58dfcde1..0bd11f36ff20e666b8a4d78aa849b196b3b71737 100644 (file)
@@ -217,7 +217,6 @@ AS_CASE([$host_os],
 # Configuration options, which will be installed in the config.h
 AH_TEMPLATE([LTTNG_UST_HAVE_EFFICIENT_UNALIGNED_ACCESS], [Use efficient unaligned access.])
 AH_TEMPLATE([LTTNG_UST_HAVE_SDT_INTEGRATION], [SystemTap integration via sdt.h])
-AH_TEMPLATE([LTTNG_UST_HAVE_PERF_EVENT], [Perf event integration via perf_event.h])
 
 # Checks for libraries.
 AC_CHECK_LIB([dl], [dlopen], [
@@ -283,8 +282,9 @@ AC_CHECK_HEADERS([linux/perf_event.h], [have_perf_event=yes], [])
 # perf, using the read system call as fallback.
 AM_CONDITIONAL([HAVE_PERF_EVENT], [test "x$have_perf_event" = "xyes"])
 
+AH_TEMPLATE([HAVE_PERF_EVENT], ["Perf event integration via perf_event.h"])
 AS_IF([test "x$have_perf_event" = "xyes"], [
-       AC_DEFINE([LTTNG_UST_HAVE_PERF_EVENT], [1])
+       AC_DEFINE([HAVE_PERF_EVENT], [1])
 ])
 
 AS_IF([test "x$NO_UNALIGNED_ACCESS" = "x"], [
index 632131c790191cebd256965e6cf77fd8d597ddf0..92cdf2dd4cdd8dd5fcfc4880eaeddfe641aa127e 100644 (file)
@@ -9,6 +9,3 @@
 
 /* DTrace/GDB/SystemTap integration via sdt.h */
 #undef LTTNG_UST_HAVE_SDT_INTEGRATION
-
-/* Perf event integration via perf_event.h */
-#undef LTTNG_UST_HAVE_PERF_EVENT
index a2d6a585d8924e8b8e62443a0e8795f1ae63f05b..01617574eb95f9af1aa318e5772ebce23f097ab4 100644 (file)
@@ -13,7 +13,6 @@
 #include <urcu/hlist.h>
 #include <stddef.h>
 #include <stdint.h>
-#include <lttng/ust-config.h>
 #include <lttng/ust-abi.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ust-endian.h>
@@ -778,32 +777,6 @@ void lttng_context_vgid_reset(void);
 void lttng_context_vegid_reset(void);
 void lttng_context_vsgid_reset(void);
 
-#ifdef LTTNG_UST_HAVE_PERF_EVENT
-int lttng_add_perf_counter_to_ctx(uint32_t type,
-                                 uint64_t config,
-                                 const char *name,
-                                 struct lttng_ctx **ctx);
-int lttng_perf_counter_init(void);
-void lttng_perf_counter_exit(void);
-#else /* #ifdef LTTNG_UST_HAVE_PERF_EVENT */
-static inline
-int lttng_add_perf_counter_to_ctx(uint32_t type,
-                                 uint64_t config,
-                                 const char *name,
-                                 struct lttng_ctx **ctx)
-{
-       return -ENOSYS;
-}
-static inline
-int lttng_perf_counter_init(void)
-{
-       return 0;
-}
-static inline
-void lttng_perf_counter_exit(void)
-{
-}
-#endif /* #else #ifdef LTTNG_UST_HAVE_PERF_EVENT */
 
 extern const struct lttng_ust_client_lib_ring_buffer_client_cb *lttng_client_callbacks_metadata;
 extern const struct lttng_ust_client_lib_ring_buffer_client_cb *lttng_client_callbacks_discard;
index a149e9d6ba6d875878f4a15860820d9e9d8a19d3..e31f8392500a0713547afdd27b1c0c0272596a65 100644 (file)
@@ -1998,7 +1998,7 @@ int ustctl_get_instance_id(struct ustctl_consumer_stream *stream,
        return client_cb->instance_id(buf, handle, id);
 }
 
-#ifdef LTTNG_UST_HAVE_PERF_EVENT
+#ifdef HAVE_PERF_EVENT
 
 int ustctl_has_perf_counters(void)
 {
index c7dc2ecbe03cd10442af063ef3e4b77ebaeb8e52..738a1d5250b781124fd93905ce920e305efb0c1d 100644 (file)
@@ -30,6 +30,7 @@
 #include <urcu/tls-compat.h>
 #include "perf_event.h"
 #include "lttng-tracer-core.h"
+#include "ust-events-internal.h"
 
 /*
  * We use a global perf counter key and iterate on per-thread RCU lists
index 9042a3036ac890c6b733ca6ecf7ca0d6048dca7a..392325f30f8d8273926a35dc343d16a97e043242 100644 (file)
@@ -86,11 +86,11 @@ void lttng_counter_transport_register(struct lttng_counter_transport *transport)
 LTTNG_HIDDEN
 void lttng_counter_transport_unregister(struct lttng_counter_transport *transport);
 
-#ifdef LTTNG_UST_HAVE_PERF_EVENT
+#ifdef HAVE_PERF_EVENT
 void lttng_ust_fixup_perf_counter_tls(void);
 void lttng_perf_lock(void);
 void lttng_perf_unlock(void);
-#else /* #ifdef LTTNG_UST_HAVE_PERF_EVENT */
+#else /* #ifdef HAVE_PERF_EVENT */
 static inline
 void lttng_ust_fixup_perf_counter_tls(void)
 {
@@ -103,6 +103,6 @@ static inline
 void lttng_perf_unlock(void)
 {
 }
-#endif /* #else #ifdef LTTNG_UST_HAVE_PERF_EVENT */
+#endif /* #else #ifdef HAVE_PERF_EVENT */
 
 #endif /* _LTTNG_TRACER_CORE_H */
index bd30e00a258b48b4901d80463ab8fb44a9164d36..e46a8b7cd25932264dc3b43ac09c908499a4ab2a 100644 (file)
@@ -242,4 +242,37 @@ struct lttng_counter *lttng_ust_counter_create(
                const char *counter_transport_name,
                size_t number_dimensions, const struct lttng_counter_dimension *dimensions);
 
+#ifdef HAVE_PERF_EVENT
+
+LTTNG_HIDDEN
+int lttng_add_perf_counter_to_ctx(uint32_t type,
+                                 uint64_t config,
+                                 const char *name,
+                                 struct lttng_ctx **ctx);
+LTTNG_HIDDEN
+int lttng_perf_counter_init(void);
+LTTNG_HIDDEN
+void lttng_perf_counter_exit(void);
+
+#else /* #ifdef HAVE_PERF_EVENT */
+
+static inline
+int lttng_add_perf_counter_to_ctx(uint32_t type,
+                                 uint64_t config,
+                                 const char *name,
+                                 struct lttng_ctx **ctx)
+{
+       return -ENOSYS;
+}
+static inline
+int lttng_perf_counter_init(void)
+{
+       return 0;
+}
+static inline
+void lttng_perf_counter_exit(void)
+{
+}
+#endif /* #else #ifdef HAVE_PERF_EVENT */
+
 #endif /* _LTTNG_UST_EVENTS_INTERNAL_H */
This page took 0.02886 seconds and 4 git commands to generate.