From 36c52fffa1beb46c7c15bb6ac4a4179cae373b98 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 2 Apr 2021 20:22:42 -0400 Subject: [PATCH] Split ust-events-internal.h between common and liblttng-ust Split ust-events-internal.h into a common private header containing the types and ABI functions and a header internal to liblttng-ust containing the declaration of the private symbols. Change-Id: I8ec2a5c8aad9ba85557b5a727ffc3615172e375d Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- src/common/Makefile.am | 1 + .../ust-events-internal.h => common/events.h} | 330 +---------------- src/common/ustcomm.c | 2 +- src/lib/lttng-ust-ctl/ustctl.c | 2 +- src/lib/lttng-ust-dl/lttng-ust-dl.c | 3 +- src/lib/lttng-ust/Makefile.am | 2 +- src/lib/lttng-ust/context-internal.h | 2 +- .../lttng-ust/event-notifier-notification.c | 2 +- src/lib/lttng-ust/events.h | 339 ++++++++++++++++++ .../lttng-ust/lttng-bytecode-interpreter.c | 2 +- src/lib/lttng-ust/lttng-bytecode-specialize.c | 2 +- src/lib/lttng-ust/lttng-bytecode-validator.c | 2 +- src/lib/lttng-ust/lttng-bytecode.c | 2 +- src/lib/lttng-ust/lttng-bytecode.h | 2 +- .../lttng-ust/lttng-context-perf-counters.c | 2 +- .../lttng-counter-client-percpu-32-modular.c | 2 +- .../lttng-counter-client-percpu-64-modular.c | 2 +- src/lib/lttng-ust/lttng-events.c | 2 +- src/lib/lttng-ust/lttng-probes.c | 2 +- .../lttng-ring-buffer-client-template.h | 2 +- ...tng-ring-buffer-metadata-client-template.h | 2 +- src/lib/lttng-ust/lttng-ust-abi.c | 2 +- src/lib/lttng-ust/lttng-ust-comm.c | 2 +- src/lib/lttng-ust/lttng-ust-statedump.c | 2 +- src/lib/lttng-ust/ust-core.c | 2 +- 25 files changed, 365 insertions(+), 350 deletions(-) rename src/{lib/lttng-ust/ust-events-internal.h => common/events.h} (61%) create mode 100644 src/lib/lttng-ust/events.h diff --git a/src/common/Makefile.am b/src/common/Makefile.am index e75ee250..e450f8c8 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -13,6 +13,7 @@ noinst_HEADERS = \ clock.h \ dynamic-type.h \ elf.h \ + events.h \ logging.h \ macros.h \ patient.h \ diff --git a/src/lib/lttng-ust/ust-events-internal.h b/src/common/events.h similarity index 61% rename from src/lib/lttng-ust/ust-events-internal.h rename to src/common/events.h index 21d40e17..b3e11bb3 100644 --- a/src/lib/lttng-ust/ust-events-internal.h +++ b/src/common/events.h @@ -4,8 +4,8 @@ * Copyright 2019 (c) Francis Deslauriers */ -#ifndef _LTTNG_UST_EVENTS_INTERNAL_H -#define _LTTNG_UST_EVENTS_INTERNAL_H +#ifndef _UST_COMMON_UST_EVENTS_H +#define _UST_COMMON_UST_EVENTS_H #include #include @@ -565,263 +565,7 @@ struct lttng_enabler *lttng_event_notifier_enabler_as_enabler( return &event_notifier_enabler->base; } -/* - * Allocate and initialize a `struct lttng_event_enabler` object. - * - * On success, returns a `struct lttng_event_enabler`, - * On memory error, returns NULL. - */ -struct lttng_event_enabler *lttng_event_enabler_create( - enum lttng_enabler_format_type format_type, - struct lttng_ust_abi_event *event_param, - struct lttng_ust_channel_buffer *chan) - __attribute__((visibility("hidden"))); - -/* - * Destroy a `struct lttng_event_enabler` object. - */ -void lttng_event_enabler_destroy(struct lttng_event_enabler *enabler) - __attribute__((visibility("hidden"))); - -/* - * Enable a `struct lttng_event_enabler` object and all events related to this - * enabler. - */ -int lttng_event_enabler_enable(struct lttng_event_enabler *enabler) - __attribute__((visibility("hidden"))); - -/* - * Disable a `struct lttng_event_enabler` object and all events related to this - * enabler. - */ -int lttng_event_enabler_disable(struct lttng_event_enabler *enabler) - __attribute__((visibility("hidden"))); - -/* - * Attach filter bytecode program to `struct lttng_event_enabler` and all - * events related to this enabler. - */ -int lttng_event_enabler_attach_filter_bytecode( - struct lttng_event_enabler *enabler, - struct lttng_ust_bytecode_node **bytecode) - __attribute__((visibility("hidden"))); - -/* - * Attach an application context to an event enabler. - * - * Not implemented. - */ -int lttng_event_enabler_attach_context(struct lttng_event_enabler *enabler, - struct lttng_ust_abi_context *ctx) - __attribute__((visibility("hidden"))); - -/* - * Attach exclusion list to `struct lttng_event_enabler` and all - * events related to this enabler. - */ -int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler *enabler, - struct lttng_ust_excluder_node **excluder) - __attribute__((visibility("hidden"))); - -/* - * Synchronize bytecodes for the enabler and the instance (event or - * event_notifier). - * - * This function goes over all bytecode programs of the enabler (event or - * event_notifier enabler) to ensure each is linked to the provided instance. - */ -void lttng_enabler_link_bytecode(const struct lttng_ust_event_desc *event_desc, - struct lttng_ust_ctx **ctx, - struct cds_list_head *instance_bytecode_runtime_head, - struct cds_list_head *enabler_bytecode_runtime_head) - __attribute__((visibility("hidden"))); - -/* - * Allocate and initialize a `struct lttng_event_notifier_group` object. - * - * On success, returns a `struct lttng_triggre_group`, - * on memory error, returns NULL. - */ -struct lttng_event_notifier_group *lttng_event_notifier_group_create(void) - __attribute__((visibility("hidden"))); -/* - * Destroy a `struct lttng_event_notifier_group` object. - */ -void lttng_event_notifier_group_destroy( - struct lttng_event_notifier_group *event_notifier_group) - __attribute__((visibility("hidden"))); - -/* - * Allocate and initialize a `struct lttng_event_notifier_enabler` object. - * - * On success, returns a `struct lttng_event_notifier_enabler`, - * On memory error, returns NULL. - */ -struct lttng_event_notifier_enabler *lttng_event_notifier_enabler_create( - struct lttng_event_notifier_group *event_notifier_group, - enum lttng_enabler_format_type format_type, - struct lttng_ust_abi_event_notifier *event_notifier_param) - __attribute__((visibility("hidden"))); - -/* - * Destroy a `struct lttng_event_notifier_enabler` object. - */ -void lttng_event_notifier_enabler_destroy( - struct lttng_event_notifier_enabler *event_notifier_enabler) - __attribute__((visibility("hidden"))); - -/* - * Enable a `struct lttng_event_notifier_enabler` object and all event - * notifiers related to this enabler. - */ -int lttng_event_notifier_enabler_enable( - struct lttng_event_notifier_enabler *event_notifier_enabler) - __attribute__((visibility("hidden"))); - -/* - * Disable a `struct lttng_event_notifier_enabler` object and all event - * notifiers related to this enabler. - */ -int lttng_event_notifier_enabler_disable( - struct lttng_event_notifier_enabler *event_notifier_enabler) - __attribute__((visibility("hidden"))); - -/* - * Attach filter bytecode program to `struct lttng_event_notifier_enabler` and - * all event notifiers related to this enabler. - */ -int lttng_event_notifier_enabler_attach_filter_bytecode( - struct lttng_event_notifier_enabler *event_notifier_enabler, - struct lttng_ust_bytecode_node **bytecode) - __attribute__((visibility("hidden"))); - -/* - * Attach capture bytecode program to `struct lttng_event_notifier_enabler` and - * all event_notifiers related to this enabler. - */ -int lttng_event_notifier_enabler_attach_capture_bytecode( - struct lttng_event_notifier_enabler *event_notifier_enabler, - struct lttng_ust_bytecode_node **bytecode) - __attribute__((visibility("hidden"))); - -/* - * Attach exclusion list to `struct lttng_event_notifier_enabler` and all - * event notifiers related to this enabler. - */ -int lttng_event_notifier_enabler_attach_exclusion( - struct lttng_event_notifier_enabler *event_notifier_enabler, - struct lttng_ust_excluder_node **excluder) - __attribute__((visibility("hidden"))); - -void lttng_free_event_filter_runtime(struct lttng_ust_event_common *event) - __attribute__((visibility("hidden"))); - -/* - * Connect the probe on all enablers matching this event description. - * Called on library load. - */ -int lttng_fix_pending_event_notifiers(void) - __attribute__((visibility("hidden"))); - -struct lttng_counter *lttng_ust_counter_create( - const char *counter_transport_name, - size_t number_dimensions, const struct lttng_counter_dimension *dimensions) - __attribute__((visibility("hidden"))); - -#ifdef HAVE_LINUX_PERF_EVENT_H - -int lttng_add_perf_counter_to_ctx(uint32_t type, - uint64_t config, - const char *name, - struct lttng_ust_ctx **ctx) - __attribute__((visibility("hidden"))); - -int lttng_perf_counter_init(void) - __attribute__((visibility("hidden"))); - -void lttng_perf_counter_exit(void) - __attribute__((visibility("hidden"))); - -#else /* #ifdef HAVE_LINUX_PERF_EVENT_H */ - -static inline -int lttng_add_perf_counter_to_ctx(uint32_t type, - uint64_t config, - const char *name, - struct lttng_ust_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_LINUX_PERF_EVENT_H */ - -int lttng_probes_get_event_list(struct lttng_ust_tracepoint_list *list) - __attribute__((visibility("hidden"))); - -void lttng_probes_prune_event_list(struct lttng_ust_tracepoint_list *list) - __attribute__((visibility("hidden"))); - -int lttng_probes_get_field_list(struct lttng_ust_field_list *list) - __attribute__((visibility("hidden"))); - -void lttng_probes_prune_field_list(struct lttng_ust_field_list *list) - __attribute__((visibility("hidden"))); - -struct lttng_ust_abi_tracepoint_iter * - lttng_ust_tracepoint_list_get_iter_next(struct lttng_ust_tracepoint_list *list) - __attribute__((visibility("hidden"))); - -struct lttng_ust_abi_field_iter * - lttng_ust_field_list_get_iter_next(struct lttng_ust_field_list *list) - __attribute__((visibility("hidden"))); - -struct lttng_ust_session *lttng_session_create(void) - __attribute__((visibility("hidden"))); - -int lttng_session_enable(struct lttng_ust_session *session) - __attribute__((visibility("hidden"))); - -int lttng_session_disable(struct lttng_ust_session *session) - __attribute__((visibility("hidden"))); - -int lttng_session_statedump(struct lttng_ust_session *session) - __attribute__((visibility("hidden"))); - -void lttng_session_destroy(struct lttng_ust_session *session) - __attribute__((visibility("hidden"))); - -/* - * Called with ust lock held. - */ -int lttng_session_active(void) - __attribute__((visibility("hidden"))); - -struct cds_list_head *lttng_get_sessions(void) - __attribute__((visibility("hidden"))); - -void lttng_handle_pending_statedump(void *owner) - __attribute__((visibility("hidden"))); - -int lttng_channel_enable(struct lttng_ust_channel_common *lttng_channel) - __attribute__((visibility("hidden"))); - -int lttng_channel_disable(struct lttng_ust_channel_common *lttng_channel) - __attribute__((visibility("hidden"))); - -void lttng_transport_register(struct lttng_transport *transport) - __attribute__((visibility("hidden"))); - -void lttng_transport_unregister(struct lttng_transport *transport) - __attribute__((visibility("hidden"))); /* This is ABI between liblttng-ust and liblttng-ust-ctl */ struct lttng_transport *lttng_ust_transport_find(const char *name); @@ -829,77 +573,9 @@ struct lttng_transport *lttng_ust_transport_find(const char *name); /* This is ABI between liblttng-ust and liblttng-ust-dl */ void lttng_ust_dl_update(void *ip); -void lttng_probe_provider_unregister_events(const struct lttng_ust_probe_desc *desc) - __attribute__((visibility("hidden"))); - -int lttng_fix_pending_events(void) - __attribute__((visibility("hidden"))); - -struct cds_list_head *lttng_get_probe_list_head(void) - __attribute__((visibility("hidden"))); - struct lttng_enum *lttng_ust_enum_get_from_desc(struct lttng_ust_session *session, const struct lttng_ust_enum_desc *enum_desc) __attribute__((visibility("hidden"))); -int lttng_abi_create_root_handle(void) - __attribute__((visibility("hidden"))); - -const struct lttng_ust_abi_objd_ops *lttng_ust_abi_objd_ops(int id) - __attribute__((visibility("hidden"))); - -int lttng_ust_abi_objd_unref(int id, int is_owner) - __attribute__((visibility("hidden"))); - -void lttng_ust_abi_exit(void) - __attribute__((visibility("hidden"))); - -void lttng_ust_abi_events_exit(void) - __attribute__((visibility("hidden"))); - -void lttng_ust_abi_objd_table_owner_cleanup(void *owner) - __attribute__((visibility("hidden"))); - -struct lttng_ust_channel_buffer *lttng_ust_alloc_channel_buffer(void) - __attribute__((visibility("hidden"))); - -void lttng_ust_free_channel_common(struct lttng_ust_channel_common *chan) - __attribute__((visibility("hidden"))); - -int lttng_ust_interpret_event_filter(struct lttng_ust_event_common *event, - const char *interpreter_stack_data, - void *filter_ctx) - __attribute__((visibility("hidden"))); - -int lttng_ust_session_uuid_validate(struct lttng_ust_session *session, - unsigned char *uuid) - __attribute__((visibility("hidden"))); - -bool lttng_ust_validate_event_name(const struct lttng_ust_event_desc *desc) - __attribute__((visibility("hidden"))); - -void lttng_ust_format_event_name(const struct lttng_ust_event_desc *desc, - char *name) - __attribute__((visibility("hidden"))); - -int lttng_ust_add_app_context_to_ctx_rcu(const char *name, struct lttng_ust_ctx **ctx) - __attribute__((visibility("hidden"))); - -int lttng_ust_context_set_provider_rcu(struct lttng_ust_ctx **_ctx, - const char *name, - size_t (*get_size)(void *priv, size_t offset), - void (*record)(void *priv, struct lttng_ust_lib_ring_buffer_ctx *ctx, - struct lttng_ust_channel_buffer *chan), - void (*get_value)(void *priv, struct lttng_ust_ctx_value *value), - void *priv) - __attribute__((visibility("hidden"))); - -void lttng_ust_context_set_session_provider(const char *name, - size_t (*get_size)(void *priv, size_t offset), - void (*record)(void *priv, struct lttng_ust_lib_ring_buffer_ctx *ctx, - struct lttng_ust_channel_buffer *chan), - void (*get_value)(void *priv, struct lttng_ust_ctx_value *value), - void *priv) - __attribute__((visibility("hidden"))); -#endif /* _LTTNG_UST_EVENTS_INTERNAL_H */ +#endif /* _UST_COMMON_UST_EVENTS_H */ diff --git a/src/common/ustcomm.c b/src/common/ustcomm.c index d6588992..80346ce1 100644 --- a/src/common/ustcomm.c +++ b/src/common/ustcomm.c @@ -27,7 +27,7 @@ #include "common/dynamic-type.h" #include "common/logging.h" -#include "lib/lttng-ust/ust-events-internal.h" +#include "common/events.h" #include "common/compat/pthread.h" #define USTCOMM_CODE_OFFSET(code) \ diff --git a/src/lib/lttng-ust-ctl/ustctl.c b/src/lib/lttng-ust-ctl/ustctl.c index 96107fe7..7c169fe1 100644 --- a/src/lib/lttng-ust-ctl/ustctl.c +++ b/src/lib/lttng-ust-ctl/ustctl.c @@ -24,7 +24,7 @@ #include "common/ringbuffer/backend.h" #include "common/ringbuffer/frontend.h" -#include "lib/lttng-ust/ust-events-internal.h" +#include "common/events.h" #include "common/wait.h" #include "lib/lttng-ust/lttng-rb-clients.h" #include "common/clock.h" diff --git a/src/lib/lttng-ust-dl/lttng-ust-dl.c b/src/lib/lttng-ust-dl/lttng-ust-dl.c index 42e8ec3c..2b767e47 100644 --- a/src/lib/lttng-ust-dl/lttng-ust-dl.c +++ b/src/lib/lttng-ust-dl/lttng-ust-dl.c @@ -21,8 +21,7 @@ #include #include "common/macros.h" #include "common/logging.h" - -#include "lib/lttng-ust/ust-events-internal.h" +#include "common/events.h" /* Include link.h last else it conflicts with ust-dlfcn. */ #include diff --git a/src/lib/lttng-ust/Makefile.am b/src/lib/lttng-ust/Makefile.am index 51a18352..77c91067 100644 --- a/src/lib/lttng-ust/Makefile.am +++ b/src/lib/lttng-ust/Makefile.am @@ -78,7 +78,7 @@ liblttng_ust_runtime_la_SOURCES = \ context-internal.h \ context-provider-internal.h \ tracepoint-internal.h \ - ust-events-internal.h \ + events.h \ clock.h \ jhash.h \ lttng-ust-uuid.h \ diff --git a/src/lib/lttng-ust/context-internal.h b/src/lib/lttng-ust/context-internal.h index 87e3bbf5..874b6d73 100644 --- a/src/lib/lttng-ust/context-internal.h +++ b/src/lib/lttng-ust/context-internal.h @@ -8,7 +8,7 @@ #define _LTTNG_UST_CONTEXT_INTERNAL_H #include -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "common/ust-context-provider.h" int lttng_context_init_all(struct lttng_ust_ctx **ctx) diff --git a/src/lib/lttng-ust/event-notifier-notification.c b/src/lib/lttng-ust/event-notifier-notification.c index 32886fdb..4cfd1b15 100644 --- a/src/lib/lttng-ust/event-notifier-notification.c +++ b/src/lib/lttng-ust/event-notifier-notification.c @@ -15,7 +15,7 @@ #include #include "lttng-tracer-core.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "common/msgpack/msgpack.h" #include "lttng-bytecode.h" #include "common/patient.h" diff --git a/src/lib/lttng-ust/events.h b/src/lib/lttng-ust/events.h new file mode 100644 index 00000000..9e28b4c3 --- /dev/null +++ b/src/lib/lttng-ust/events.h @@ -0,0 +1,339 @@ +/* + * SPDX-License-Identifier: MIT + * + * Copyright 2019 (c) Francis Deslauriers + */ + +#ifndef _LTTNG_UST_EVENTS_INTERNAL_H +#define _LTTNG_UST_EVENTS_INTERNAL_H + +#include "common/events.h" + +/* + * Allocate and initialize a `struct lttng_event_enabler` object. + * + * On success, returns a `struct lttng_event_enabler`, + * On memory error, returns NULL. + */ +struct lttng_event_enabler *lttng_event_enabler_create( + enum lttng_enabler_format_type format_type, + struct lttng_ust_abi_event *event_param, + struct lttng_ust_channel_buffer *chan) + __attribute__((visibility("hidden"))); + +/* + * Destroy a `struct lttng_event_enabler` object. + */ +void lttng_event_enabler_destroy(struct lttng_event_enabler *enabler) + __attribute__((visibility("hidden"))); + +/* + * Enable a `struct lttng_event_enabler` object and all events related to this + * enabler. + */ +int lttng_event_enabler_enable(struct lttng_event_enabler *enabler) + __attribute__((visibility("hidden"))); + +/* + * Disable a `struct lttng_event_enabler` object and all events related to this + * enabler. + */ +int lttng_event_enabler_disable(struct lttng_event_enabler *enabler) + __attribute__((visibility("hidden"))); + +/* + * Attach filter bytecode program to `struct lttng_event_enabler` and all + * events related to this enabler. + */ +int lttng_event_enabler_attach_filter_bytecode( + struct lttng_event_enabler *enabler, + struct lttng_ust_bytecode_node **bytecode) + __attribute__((visibility("hidden"))); + +/* + * Attach an application context to an event enabler. + * + * Not implemented. + */ +int lttng_event_enabler_attach_context(struct lttng_event_enabler *enabler, + struct lttng_ust_abi_context *ctx) + __attribute__((visibility("hidden"))); + +/* + * Attach exclusion list to `struct lttng_event_enabler` and all + * events related to this enabler. + */ +int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler *enabler, + struct lttng_ust_excluder_node **excluder) + __attribute__((visibility("hidden"))); + +/* + * Synchronize bytecodes for the enabler and the instance (event or + * event_notifier). + * + * This function goes over all bytecode programs of the enabler (event or + * event_notifier enabler) to ensure each is linked to the provided instance. + */ +void lttng_enabler_link_bytecode(const struct lttng_ust_event_desc *event_desc, + struct lttng_ust_ctx **ctx, + struct cds_list_head *instance_bytecode_runtime_head, + struct cds_list_head *enabler_bytecode_runtime_head) + __attribute__((visibility("hidden"))); + +/* + * Allocate and initialize a `struct lttng_event_notifier_group` object. + * + * On success, returns a `struct lttng_triggre_group`, + * on memory error, returns NULL. + */ +struct lttng_event_notifier_group *lttng_event_notifier_group_create(void) + __attribute__((visibility("hidden"))); + +/* + * Destroy a `struct lttng_event_notifier_group` object. + */ +void lttng_event_notifier_group_destroy( + struct lttng_event_notifier_group *event_notifier_group) + __attribute__((visibility("hidden"))); + +/* + * Allocate and initialize a `struct lttng_event_notifier_enabler` object. + * + * On success, returns a `struct lttng_event_notifier_enabler`, + * On memory error, returns NULL. + */ +struct lttng_event_notifier_enabler *lttng_event_notifier_enabler_create( + struct lttng_event_notifier_group *event_notifier_group, + enum lttng_enabler_format_type format_type, + struct lttng_ust_abi_event_notifier *event_notifier_param) + __attribute__((visibility("hidden"))); + +/* + * Destroy a `struct lttng_event_notifier_enabler` object. + */ +void lttng_event_notifier_enabler_destroy( + struct lttng_event_notifier_enabler *event_notifier_enabler) + __attribute__((visibility("hidden"))); + +/* + * Enable a `struct lttng_event_notifier_enabler` object and all event + * notifiers related to this enabler. + */ +int lttng_event_notifier_enabler_enable( + struct lttng_event_notifier_enabler *event_notifier_enabler) + __attribute__((visibility("hidden"))); + +/* + * Disable a `struct lttng_event_notifier_enabler` object and all event + * notifiers related to this enabler. + */ +int lttng_event_notifier_enabler_disable( + struct lttng_event_notifier_enabler *event_notifier_enabler) + __attribute__((visibility("hidden"))); + +/* + * Attach filter bytecode program to `struct lttng_event_notifier_enabler` and + * all event notifiers related to this enabler. + */ +int lttng_event_notifier_enabler_attach_filter_bytecode( + struct lttng_event_notifier_enabler *event_notifier_enabler, + struct lttng_ust_bytecode_node **bytecode) + __attribute__((visibility("hidden"))); + +/* + * Attach capture bytecode program to `struct lttng_event_notifier_enabler` and + * all event_notifiers related to this enabler. + */ +int lttng_event_notifier_enabler_attach_capture_bytecode( + struct lttng_event_notifier_enabler *event_notifier_enabler, + struct lttng_ust_bytecode_node **bytecode) + __attribute__((visibility("hidden"))); + +/* + * Attach exclusion list to `struct lttng_event_notifier_enabler` and all + * event notifiers related to this enabler. + */ +int lttng_event_notifier_enabler_attach_exclusion( + struct lttng_event_notifier_enabler *event_notifier_enabler, + struct lttng_ust_excluder_node **excluder) + __attribute__((visibility("hidden"))); + +void lttng_free_event_filter_runtime(struct lttng_ust_event_common *event) + __attribute__((visibility("hidden"))); + +/* + * Connect the probe on all enablers matching this event description. + * Called on library load. + */ +int lttng_fix_pending_event_notifiers(void) + __attribute__((visibility("hidden"))); + +struct lttng_counter *lttng_ust_counter_create( + const char *counter_transport_name, + size_t number_dimensions, const struct lttng_counter_dimension *dimensions) + __attribute__((visibility("hidden"))); + +#ifdef HAVE_LINUX_PERF_EVENT_H + +int lttng_add_perf_counter_to_ctx(uint32_t type, + uint64_t config, + const char *name, + struct lttng_ust_ctx **ctx) + __attribute__((visibility("hidden"))); + +int lttng_perf_counter_init(void) + __attribute__((visibility("hidden"))); + +void lttng_perf_counter_exit(void) + __attribute__((visibility("hidden"))); + +#else /* #ifdef HAVE_LINUX_PERF_EVENT_H */ + +static inline +int lttng_add_perf_counter_to_ctx(uint32_t type, + uint64_t config, + const char *name, + struct lttng_ust_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_LINUX_PERF_EVENT_H */ + +int lttng_probes_get_event_list(struct lttng_ust_tracepoint_list *list) + __attribute__((visibility("hidden"))); + +void lttng_probes_prune_event_list(struct lttng_ust_tracepoint_list *list) + __attribute__((visibility("hidden"))); + +int lttng_probes_get_field_list(struct lttng_ust_field_list *list) + __attribute__((visibility("hidden"))); + +void lttng_probes_prune_field_list(struct lttng_ust_field_list *list) + __attribute__((visibility("hidden"))); + +struct lttng_ust_abi_tracepoint_iter * + lttng_ust_tracepoint_list_get_iter_next(struct lttng_ust_tracepoint_list *list) + __attribute__((visibility("hidden"))); + +struct lttng_ust_abi_field_iter * + lttng_ust_field_list_get_iter_next(struct lttng_ust_field_list *list) + __attribute__((visibility("hidden"))); + +struct lttng_ust_session *lttng_session_create(void) + __attribute__((visibility("hidden"))); + +int lttng_session_enable(struct lttng_ust_session *session) + __attribute__((visibility("hidden"))); + +int lttng_session_disable(struct lttng_ust_session *session) + __attribute__((visibility("hidden"))); + +int lttng_session_statedump(struct lttng_ust_session *session) + __attribute__((visibility("hidden"))); + +void lttng_session_destroy(struct lttng_ust_session *session) + __attribute__((visibility("hidden"))); + +/* + * Called with ust lock held. + */ +int lttng_session_active(void) + __attribute__((visibility("hidden"))); + +struct cds_list_head *lttng_get_sessions(void) + __attribute__((visibility("hidden"))); + +void lttng_handle_pending_statedump(void *owner) + __attribute__((visibility("hidden"))); + +int lttng_channel_enable(struct lttng_ust_channel_common *lttng_channel) + __attribute__((visibility("hidden"))); + +int lttng_channel_disable(struct lttng_ust_channel_common *lttng_channel) + __attribute__((visibility("hidden"))); + +void lttng_transport_register(struct lttng_transport *transport) + __attribute__((visibility("hidden"))); + +void lttng_transport_unregister(struct lttng_transport *transport) + __attribute__((visibility("hidden"))); + +void lttng_probe_provider_unregister_events(const struct lttng_ust_probe_desc *desc) + __attribute__((visibility("hidden"))); + +int lttng_fix_pending_events(void) + __attribute__((visibility("hidden"))); + +struct cds_list_head *lttng_get_probe_list_head(void) + __attribute__((visibility("hidden"))); + +int lttng_abi_create_root_handle(void) + __attribute__((visibility("hidden"))); + +const struct lttng_ust_abi_objd_ops *lttng_ust_abi_objd_ops(int id) + __attribute__((visibility("hidden"))); + +int lttng_ust_abi_objd_unref(int id, int is_owner) + __attribute__((visibility("hidden"))); + +void lttng_ust_abi_exit(void) + __attribute__((visibility("hidden"))); + +void lttng_ust_abi_events_exit(void) + __attribute__((visibility("hidden"))); + +void lttng_ust_abi_objd_table_owner_cleanup(void *owner) + __attribute__((visibility("hidden"))); + +struct lttng_ust_channel_buffer *lttng_ust_alloc_channel_buffer(void) + __attribute__((visibility("hidden"))); + +void lttng_ust_free_channel_common(struct lttng_ust_channel_common *chan) + __attribute__((visibility("hidden"))); + +int lttng_ust_interpret_event_filter(struct lttng_ust_event_common *event, + const char *interpreter_stack_data, + void *filter_ctx) + __attribute__((visibility("hidden"))); + +int lttng_ust_session_uuid_validate(struct lttng_ust_session *session, + unsigned char *uuid) + __attribute__((visibility("hidden"))); + +bool lttng_ust_validate_event_name(const struct lttng_ust_event_desc *desc) + __attribute__((visibility("hidden"))); + +void lttng_ust_format_event_name(const struct lttng_ust_event_desc *desc, + char *name) + __attribute__((visibility("hidden"))); + +int lttng_ust_add_app_context_to_ctx_rcu(const char *name, struct lttng_ust_ctx **ctx) + __attribute__((visibility("hidden"))); + +int lttng_ust_context_set_provider_rcu(struct lttng_ust_ctx **_ctx, + const char *name, + size_t (*get_size)(void *priv, size_t offset), + void (*record)(void *priv, struct lttng_ust_lib_ring_buffer_ctx *ctx, + struct lttng_ust_channel_buffer *chan), + void (*get_value)(void *priv, struct lttng_ust_ctx_value *value), + void *priv) + __attribute__((visibility("hidden"))); + +void lttng_ust_context_set_session_provider(const char *name, + size_t (*get_size)(void *priv, size_t offset), + void (*record)(void *priv, struct lttng_ust_lib_ring_buffer_ctx *ctx, + struct lttng_ust_channel_buffer *chan), + void (*get_value)(void *priv, struct lttng_ust_ctx_value *value), + void *priv) + __attribute__((visibility("hidden"))); + +#endif /* _LTTNG_UST_EVENTS_INTERNAL_H */ diff --git a/src/lib/lttng-ust/lttng-bytecode-interpreter.c b/src/lib/lttng-ust/lttng-bytecode-interpreter.c index cb128a69..c5f75629 100644 --- a/src/lib/lttng-ust/lttng-bytecode-interpreter.c +++ b/src/lib/lttng-ust/lttng-bytecode-interpreter.c @@ -14,7 +14,7 @@ #include #include #include -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "lttng-bytecode.h" #include "string-utils.h" diff --git a/src/lib/lttng-ust/lttng-bytecode-specialize.c b/src/lib/lttng-ust/lttng-bytecode-specialize.c index 3d7b5c2a..bf7af5d5 100644 --- a/src/lib/lttng-ust/lttng-bytecode-specialize.c +++ b/src/lib/lttng-ust/lttng-bytecode-specialize.c @@ -15,7 +15,7 @@ #include "context-internal.h" #include "lttng-bytecode.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "common/macros.h" static int lttng_fls(int val) diff --git a/src/lib/lttng-ust/lttng-bytecode-validator.c b/src/lib/lttng-ust/lttng-bytecode-validator.c index 91c4cace..34657d00 100644 --- a/src/lib/lttng-ust/lttng-bytecode-validator.c +++ b/src/lib/lttng-ust/lttng-bytecode-validator.c @@ -16,7 +16,7 @@ #include "lttng-bytecode.h" #include "lttng-hash-helper.h" #include "string-utils.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "common/macros.h" /* diff --git a/src/lib/lttng-ust/lttng-bytecode.c b/src/lib/lttng-ust/lttng-bytecode.c index 68108192..8d3971bf 100644 --- a/src/lib/lttng-ust/lttng-bytecode.c +++ b/src/lib/lttng-ust/lttng-bytecode.c @@ -14,7 +14,7 @@ #include "context-internal.h" #include "lttng-bytecode.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "common/macros.h" static const char *opnames[] = { diff --git a/src/lib/lttng-ust/lttng-bytecode.h b/src/lib/lttng-ust/lttng-bytecode.h index a72369e1..46f72120 100644 --- a/src/lib/lttng-ust/lttng-bytecode.h +++ b/src/lib/lttng-ust/lttng-bytecode.h @@ -23,7 +23,7 @@ #include #include "common/logging.h" #include "bytecode.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" /* Interpreter stack length, in number of entries */ #define INTERPRETER_STACK_LEN 10 /* includes 2 dummy */ diff --git a/src/lib/lttng-ust/lttng-context-perf-counters.c b/src/lib/lttng-ust/lttng-context-perf-counters.c index 5f5b5cbf..2f145220 100644 --- a/src/lib/lttng-ust/lttng-context-perf-counters.c +++ b/src/lib/lttng-ust/lttng-context-perf-counters.c @@ -34,7 +34,7 @@ #include "context-internal.h" #include "lttng-tracer-core.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" /* * We use a global perf counter key and iterate on per-thread RCU lists diff --git a/src/lib/lttng-ust/lttng-counter-client-percpu-32-modular.c b/src/lib/lttng-ust/lttng-counter-client-percpu-32-modular.c index df087c4d..0f9f5fe4 100644 --- a/src/lib/lttng-ust/lttng-counter-client-percpu-32-modular.c +++ b/src/lib/lttng-ust/lttng-counter-client-percpu-32-modular.c @@ -8,7 +8,7 @@ * Copyright (C) 2020 Mathieu Desnoyers */ -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "common/counter/counter.h" #include "common/counter/counter-api.h" #include "lttng-tracer-core.h" diff --git a/src/lib/lttng-ust/lttng-counter-client-percpu-64-modular.c b/src/lib/lttng-ust/lttng-counter-client-percpu-64-modular.c index 021146e6..62ddfe5d 100644 --- a/src/lib/lttng-ust/lttng-counter-client-percpu-64-modular.c +++ b/src/lib/lttng-ust/lttng-counter-client-percpu-64-modular.c @@ -8,7 +8,7 @@ * Copyright (C) 2020 Mathieu Desnoyers */ -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "common/counter/counter.h" #include "common/counter/counter-api.h" #include "lttng-tracer-core.h" diff --git a/src/lib/lttng-ust/lttng-events.c b/src/lib/lttng-ust/lttng-events.c index d5e08849..13becb91 100644 --- a/src/lib/lttng-ust/lttng-events.c +++ b/src/lib/lttng-ust/lttng-events.c @@ -49,7 +49,7 @@ #include "lttng-tracer-core.h" #include "lttng-ust-statedump.h" #include "context-internal.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "wait.h" #include "common/ringbuffer/shm.h" #include "common/ringbuffer/frontend_types.h" diff --git a/src/lib/lttng-ust/lttng-probes.c b/src/lib/lttng-ust/lttng-probes.c index 553770ea..2dff30f4 100644 --- a/src/lib/lttng-ust/lttng-probes.c +++ b/src/lib/lttng-ust/lttng-probes.c @@ -21,7 +21,7 @@ #include "lttng-tracer-core.h" #include "jhash.h" #include "error.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" /* * probe list is protected by ust_lock()/ust_unlock(). diff --git a/src/lib/lttng-ust/lttng-ring-buffer-client-template.h b/src/lib/lttng-ust/lttng-ring-buffer-client-template.h index 880ae94c..fea1774f 100644 --- a/src/lib/lttng-ust/lttng-ring-buffer-client-template.h +++ b/src/lib/lttng-ust/lttng-ring-buffer-client-template.h @@ -10,7 +10,7 @@ #include #include -#include +#include "lib/lttng-ust/events.h" #include #include "common/bitfield.h" #include "common/align.h" diff --git a/src/lib/lttng-ust/lttng-ring-buffer-metadata-client-template.h b/src/lib/lttng-ust/lttng-ring-buffer-metadata-client-template.h index 954fc020..a2ea1b02 100644 --- a/src/lib/lttng-ust/lttng-ring-buffer-metadata-client-template.h +++ b/src/lib/lttng-ust/lttng-ring-buffer-metadata-client-template.h @@ -10,7 +10,7 @@ #include #include -#include +#include "lib/lttng-ust/events.h" #include "common/bitfield.h" #include "common/align.h" #include "lttng-tracer.h" diff --git a/src/lib/lttng-ust/lttng-ust-abi.c b/src/lib/lttng-ust/lttng-ust-abi.c index f1096d06..f8e0f5bb 100644 --- a/src/lib/lttng-ust/lttng-ust-abi.c +++ b/src/lib/lttng-ust/lttng-ust-abi.c @@ -46,7 +46,7 @@ #include "tracepoint-internal.h" #include "lttng-tracer.h" #include "string-utils.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "context-internal.h" #include "common/macros.h" diff --git a/src/lib/lttng-ust/lttng-ust-comm.c b/src/lib/lttng-ust/lttng-ust-comm.c index 2f6fe18f..6f5be120 100644 --- a/src/lib/lttng-ust/lttng-ust-comm.c +++ b/src/lib/lttng-ust/lttng-ust-comm.c @@ -52,7 +52,7 @@ #include "clock.h" #include "lib/lttng-ust/getcpu.h" #include "common/getenv.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "context-internal.h" #include "common/align.h" #include "lttng-counter-client.h" diff --git a/src/lib/lttng-ust/lttng-ust-statedump.c b/src/lib/lttng-ust/lttng-ust-statedump.c index 2dae71f9..1873fa4c 100644 --- a/src/lib/lttng-ust/lttng-ust-statedump.c +++ b/src/lib/lttng-ust/lttng-ust-statedump.c @@ -22,7 +22,7 @@ #include "lttng-ust-statedump.h" #include "jhash.h" #include "common/getenv.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #define TRACEPOINT_DEFINE #include "ust_lib.h" /* Only define. */ diff --git a/src/lib/lttng-ust/ust-core.c b/src/lib/lttng-ust/ust-core.c index d4829904..88330a1e 100644 --- a/src/lib/lttng-ust/ust-core.c +++ b/src/lib/lttng-ust/ust-core.c @@ -10,7 +10,7 @@ #include #include "context-internal.h" -#include "ust-events-internal.h" +#include "lib/lttng-ust/events.h" #include "common/logging.h" #include "lttng-tracer-core.h" #include "lttng-rb-clients.h" -- 2.34.1