# 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], [
# 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"], [
/* 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
#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>
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;
return client_cb->instance_id(buf, handle, id);
}
-#ifdef LTTNG_UST_HAVE_PERF_EVENT
+#ifdef HAVE_PERF_EVENT
int ustctl_has_perf_counters(void)
{
#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
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)
{
void lttng_perf_unlock(void)
{
}
-#endif /* #else #ifdef LTTNG_UST_HAVE_PERF_EVENT */
+#endif /* #else #ifdef HAVE_PERF_EVENT */
#endif /* _LTTNG_TRACER_CORE_H */
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 */