From bb7ad29d1e8a78e4f0f5f9c7f121fd5545c90acb Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 5 Mar 2021 12:09:58 -0500 Subject: [PATCH] Move ust-events.h private structs to internal 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. Change-Id: Icb7dd50ec33917799d0e26dbe792f32d00b5393e Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- include/lttng/ust-events.h | 80 +----------------- liblttng-ust-ctl/ustctl.c | 3 +- liblttng-ust/event-notifier-notification.c | 2 +- .../lttng-counter-client-percpu-32-modular.c | 2 +- .../lttng-counter-client-percpu-64-modular.c | 2 +- liblttng-ust/ust-core.c | 3 +- liblttng-ust/ust-events-internal.h | 81 +++++++++++++++++++ 7 files changed, 89 insertions(+), 84 deletions(-) diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 5b18fb45..9eea1e4d 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -351,26 +351,6 @@ struct lttng_probe_desc { /* Data structures used by the tracer. */ -struct tp_list_entry { - struct lttng_ust_tracepoint_iter tp; - struct cds_list_head head; -}; - -struct lttng_ust_tracepoint_list { - struct tp_list_entry *iter; - struct cds_list_head head; -}; - -struct tp_field_list_entry { - struct lttng_ust_field_iter field; - struct cds_list_head head; -}; - -struct lttng_ust_field_list { - struct tp_field_list_entry *iter; - struct cds_list_head head; -}; - /* * Bytecode interpreter return value masks. */ @@ -407,20 +387,6 @@ struct lttng_bytecode_runtime { struct lttng_ctx **pctx; }; -/* - * Objects in a linked-list of enablers, owned by an event or event_notifier. - * This is used because an event (or a event_notifier) can be enabled by more - * than one enabler and we want a quick way to iterate over all enablers of an - * object. - * - * For example, event rules "my_app:a*" and "my_app:ab*" will both match the - * event with the name "my_app:abc". - */ -struct lttng_enabler_ref { - struct cds_list_head node; /* enabler ref list */ - struct lttng_enabler *ref; /* backward ref */ -}; - /* * lttng_event structure is referred to by the tracing fast path. It * must be kept small. @@ -541,15 +507,7 @@ struct lttng_channel { int tstate:1; /* Transient enable state */ }; -#define LTTNG_COUNTER_DIMENSION_MAX 8 - -struct lttng_counter_dimension { - uint64_t size; - uint64_t underflow_index; - uint64_t overflow_index; - uint8_t has_underflow; - uint8_t has_overflow; -}; +struct lttng_counter_dimension; struct lttng_counter_ops { struct lib_counter *(*counter_create)(size_t nr_dimensions, @@ -628,42 +586,6 @@ struct lttng_session { struct lttng_ctx *ctx; /* contexts for filters. */ }; -struct lttng_counter { - int objd; - struct lttng_event_notifier_group *event_notifier_group; /* owner */ - struct lttng_counter_transport *transport; - struct lib_counter *counter; - struct lttng_counter_ops *ops; -}; - -struct lttng_event_notifier_group { - int objd; - void *owner; - int notification_fd; - struct cds_list_head node; /* Event notifier group handle list */ - struct cds_list_head enablers_head; - struct cds_list_head event_notifiers_head; /* list of event_notifiers */ - struct lttng_ust_event_notifier_ht event_notifiers_ht; /* hashtable of event_notifiers */ - struct lttng_ctx *ctx; /* contexts for filters. */ - - struct lttng_counter *error_counter; - size_t error_counter_len; -}; - -struct lttng_transport { - char *name; - struct cds_list_head node; - struct lttng_channel_ops ops; - const struct lttng_ust_lib_ring_buffer_config *client_config; -}; - -struct lttng_counter_transport { - char *name; - struct cds_list_head node; - struct lttng_counter_ops ops; - const struct lib_counter_config *client_config; -}; - int lttng_probe_register(struct lttng_probe_desc *desc); void lttng_probe_unregister(struct lttng_probe_desc *desc); diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index e31f8392..14299b23 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -15,8 +15,8 @@ #include #include #include -#include #include + #include #include #include @@ -24,6 +24,7 @@ #include "../libringbuffer/backend.h" #include "../libringbuffer/frontend.h" +#include "../liblttng-ust/ust-events-internal.h" #include "../liblttng-ust/wait.h" #include "../liblttng-ust/lttng-rb-clients.h" #include "../liblttng-ust/clock.h" diff --git a/liblttng-ust/event-notifier-notification.c b/liblttng-ust/event-notifier-notification.c index 96b91a9a..313339f1 100644 --- a/liblttng-ust/event-notifier-notification.c +++ b/liblttng-ust/event-notifier-notification.c @@ -8,10 +8,10 @@ #include #include -#include #include #include +#include "ust-events-internal.h" #include "../libmsgpack/msgpack.h" #include "lttng-bytecode.h" #include "ust-share.h" diff --git a/liblttng-ust/lttng-counter-client-percpu-32-modular.c b/liblttng-ust/lttng-counter-client-percpu-32-modular.c index fc36badc..abcdd480 100644 --- a/liblttng-ust/lttng-counter-client-percpu-32-modular.c +++ b/liblttng-ust/lttng-counter-client-percpu-32-modular.c @@ -8,7 +8,7 @@ * Copyright (C) 2020 Mathieu Desnoyers */ -#include +#include "ust-events-internal.h" #include "../libcounter/counter.h" #include "../libcounter/counter-api.h" #include "lttng-tracer-core.h" diff --git a/liblttng-ust/lttng-counter-client-percpu-64-modular.c b/liblttng-ust/lttng-counter-client-percpu-64-modular.c index b935986f..a572ec8c 100644 --- a/liblttng-ust/lttng-counter-client-percpu-64-modular.c +++ b/liblttng-ust/lttng-counter-client-percpu-64-modular.c @@ -8,7 +8,7 @@ * Copyright (C) 2020 Mathieu Desnoyers */ -#include +#include "ust-events-internal.h" #include "../libcounter/counter.h" #include "../libcounter/counter-api.h" #include "lttng-tracer-core.h" diff --git a/liblttng-ust/ust-core.c b/liblttng-ust/ust-core.c index 1ac726d9..28122262 100644 --- a/liblttng-ust/ust-core.c +++ b/liblttng-ust/ust-core.c @@ -8,7 +8,8 @@ #include #include #include -#include + +#include "ust-events-internal.h" #include #include "lttng-tracer-core.h" #include "jhash.h" diff --git a/liblttng-ust/ust-events-internal.h b/liblttng-ust/ust-events-internal.h index 70249cb0..24b56d3b 100644 --- a/liblttng-ust/ust-events-internal.h +++ b/liblttng-ust/ust-events-internal.h @@ -84,6 +84,87 @@ struct lttng_ust_excluder_node { struct lttng_ust_event_exclusion excluder; }; +/* Data structures used by the tracer. */ + +struct tp_list_entry { + struct lttng_ust_tracepoint_iter tp; + struct cds_list_head head; +}; + +struct lttng_ust_tracepoint_list { + struct tp_list_entry *iter; + struct cds_list_head head; +}; + +struct tp_field_list_entry { + struct lttng_ust_field_iter field; + struct cds_list_head head; +}; + +struct lttng_ust_field_list { + struct tp_field_list_entry *iter; + struct cds_list_head head; +}; + +/* + * Objects in a linked-list of enablers, owned by an event or event_notifier. + * This is used because an event (or a event_notifier) can be enabled by more + * than one enabler and we want a quick way to iterate over all enablers of an + * object. + * + * For example, event rules "my_app:a*" and "my_app:ab*" will both match the + * event with the name "my_app:abc". + */ +struct lttng_enabler_ref { + struct cds_list_head node; /* enabler ref list */ + struct lttng_enabler *ref; /* backward ref */ +}; + +#define LTTNG_COUNTER_DIMENSION_MAX 8 +struct lttng_counter_dimension { + uint64_t size; + uint64_t underflow_index; + uint64_t overflow_index; + uint8_t has_underflow; + uint8_t has_overflow; +}; + +struct lttng_counter { + int objd; + struct lttng_event_notifier_group *event_notifier_group; /* owner */ + struct lttng_counter_transport *transport; + struct lib_counter *counter; + struct lttng_counter_ops *ops; +}; + +struct lttng_event_notifier_group { + int objd; + void *owner; + int notification_fd; + struct cds_list_head node; /* Event notifier group handle list */ + struct cds_list_head enablers_head; + struct cds_list_head event_notifiers_head; /* list of event_notifiers */ + struct lttng_ust_event_notifier_ht event_notifiers_ht; /* hashtable of event_notifiers */ + struct lttng_ctx *ctx; /* contexts for filters. */ + + struct lttng_counter *error_counter; + size_t error_counter_len; +}; + +struct lttng_transport { + char *name; + struct cds_list_head node; + struct lttng_channel_ops ops; + const struct lttng_ust_lib_ring_buffer_config *client_config; +}; + +struct lttng_counter_transport { + char *name; + struct cds_list_head node; + struct lttng_counter_ops ops; + const struct lib_counter_config *client_config; +}; + static inline struct lttng_enabler *lttng_event_enabler_as_enabler( struct lttng_event_enabler *event_enabler) -- 2.34.1