From: Michael Jeanson Date: Tue, 23 Feb 2021 22:16:35 +0000 (-0500) Subject: Move context symbols to private header X-Git-Tag: v2.13.0-rc1~341 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fc80554e0cd4c7739c64fe8bc8b87a77d3c19d07;p=lttng-ust.git Move context symbols to private header 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: I5719866bf6041f683dc62b612c671051cc397d79 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index bcb623f8..c383bf65 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -721,9 +721,6 @@ struct lttng_channel *lttng_channel_create(struct lttng_session *session, int lttng_channel_enable(struct lttng_channel *channel); int lttng_channel_disable(struct lttng_channel *channel); -int lttng_attach_context(struct lttng_ust_context *context_param, - union ust_args *uargs, - struct lttng_ctx **ctx, struct lttng_session *session); void lttng_transport_register(struct lttng_transport *transport); void lttng_transport_unregister(struct lttng_transport *transport); @@ -733,50 +730,11 @@ void lttng_probe_provider_unregister_events(struct lttng_probe_desc *desc); int lttng_fix_pending_events(void); int lttng_probes_init(void); void lttng_probes_exit(void); -int lttng_find_context(struct lttng_ctx *ctx, const char *name); -int lttng_get_context_index(struct lttng_ctx *ctx, const char *name); -struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx_p); -void lttng_context_update(struct lttng_ctx *ctx); -void lttng_remove_context_field(struct lttng_ctx **ctx_p, - struct lttng_ctx_field *field); -void lttng_destroy_context(struct lttng_ctx *ctx); -int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx); -int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx); -int lttng_add_pthread_id_to_ctx(struct lttng_ctx **ctx); -int lttng_add_procname_to_ctx(struct lttng_ctx **ctx); -int lttng_add_ip_to_ctx(struct lttng_ctx **ctx); -int lttng_add_cpu_id_to_ctx(struct lttng_ctx **ctx); -int lttng_add_dyntest_to_ctx(struct lttng_ctx **ctx); -int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx); -int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx); -int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx); -int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx); -int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx); -int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx); -int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx); -int lttng_add_vuid_to_ctx(struct lttng_ctx **ctx); -int lttng_add_veuid_to_ctx(struct lttng_ctx **ctx); -int lttng_add_vsuid_to_ctx(struct lttng_ctx **ctx); -int lttng_add_vgid_to_ctx(struct lttng_ctx **ctx); -int lttng_add_vegid_to_ctx(struct lttng_ctx **ctx); -int lttng_add_vsgid_to_ctx(struct lttng_ctx **ctx); -void lttng_context_vtid_reset(void); -void lttng_context_vpid_reset(void); -void lttng_context_procname_reset(void); -void lttng_context_cgroup_ns_reset(void); -void lttng_context_ipc_ns_reset(void); -void lttng_context_mnt_ns_reset(void); -void lttng_context_net_ns_reset(void); -void lttng_context_pid_ns_reset(void); -void lttng_context_user_ns_reset(void); -void lttng_context_uts_ns_reset(void); -void lttng_context_vuid_reset(void); -void lttng_context_veuid_reset(void); -void lttng_context_vsuid_reset(void); -void lttng_context_vgid_reset(void); -void lttng_context_vegid_reset(void); -void lttng_context_vsgid_reset(void); +/* + * Can be used by applications that change their procname to clear the ust cached value. + */ +void lttng_context_procname_reset(void); struct lttng_transport *lttng_transport_find(const char *name); diff --git a/liblttng-ust/context-internal.h b/liblttng-ust/context-internal.h index 3f1f42e8..8c3861ec 100644 --- a/liblttng-ust/context-internal.h +++ b/liblttng-ust/context-internal.h @@ -13,10 +13,99 @@ LTTNG_HIDDEN int lttng_context_init_all(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_attach_context(struct lttng_ust_context *context_param, + union ust_args *uargs, + struct lttng_ctx **ctx, struct lttng_session *session); + +LTTNG_HIDDEN +int lttng_find_context(struct lttng_ctx *ctx, const char *name); +LTTNG_HIDDEN +int lttng_get_context_index(struct lttng_ctx *ctx, const char *name); +LTTNG_HIDDEN +struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx_p); +LTTNG_HIDDEN +void lttng_context_update(struct lttng_ctx *ctx); +LTTNG_HIDDEN +void lttng_remove_context_field(struct lttng_ctx **ctx_p, + struct lttng_ctx_field *field); +LTTNG_HIDDEN +void lttng_destroy_context(struct lttng_ctx *ctx); + +LTTNG_HIDDEN +void lttng_context_vtid_reset(void); +LTTNG_HIDDEN +void lttng_context_vpid_reset(void); +LTTNG_HIDDEN +void lttng_context_cgroup_ns_reset(void); +LTTNG_HIDDEN +void lttng_context_ipc_ns_reset(void); +LTTNG_HIDDEN +void lttng_context_mnt_ns_reset(void); +LTTNG_HIDDEN +void lttng_context_net_ns_reset(void); +LTTNG_HIDDEN +void lttng_context_pid_ns_reset(void); +LTTNG_HIDDEN +void lttng_context_user_ns_reset(void); +LTTNG_HIDDEN +void lttng_context_uts_ns_reset(void); LTTNG_HIDDEN void lttng_context_time_ns_reset(void); +LTTNG_HIDDEN +void lttng_context_vuid_reset(void); +LTTNG_HIDDEN +void lttng_context_veuid_reset(void); +LTTNG_HIDDEN +void lttng_context_vsuid_reset(void); +LTTNG_HIDDEN +void lttng_context_vgid_reset(void); +LTTNG_HIDDEN +void lttng_context_vegid_reset(void); +LTTNG_HIDDEN +void lttng_context_vsgid_reset(void); +LTTNG_HIDDEN +int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_pthread_id_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_procname_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_ip_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_cpu_id_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_dyntest_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx); LTTNG_HIDDEN int lttng_add_time_ns_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_vuid_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_veuid_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_vsuid_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_vgid_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_vegid_to_ctx(struct lttng_ctx **ctx); +LTTNG_HIDDEN +int lttng_add_vsgid_to_ctx(struct lttng_ctx **ctx); #endif /* _LTTNG_UST_CONTEXT_INTERNAL_H */ diff --git a/liblttng-ust/lttng-bytecode-specialize.c b/liblttng-ust/lttng-bytecode-specialize.c index 7a7c1e86..2bbcb197 100644 --- a/liblttng-ust/lttng-bytecode-specialize.c +++ b/liblttng-ust/lttng-bytecode-specialize.c @@ -10,8 +10,10 @@ #include #include -#include "lttng-bytecode.h" #include + +#include "context-internal.h" +#include "lttng-bytecode.h" #include "ust-events-internal.h" static int lttng_fls(int val) diff --git a/liblttng-ust/lttng-bytecode.c b/liblttng-ust/lttng-bytecode.c index 93cd02eb..9bb7f11f 100644 --- a/liblttng-ust/lttng-bytecode.c +++ b/liblttng-ust/lttng-bytecode.c @@ -12,6 +12,7 @@ #include +#include "context-internal.h" #include "lttng-bytecode.h" #include "ust-events-internal.h" diff --git a/liblttng-ust/lttng-context-cgroup-ns.c b/liblttng-ust/lttng-context-cgroup-ns.c index 191fa9a7..681eea49 100644 --- a/liblttng-ust/lttng-context-cgroup-ns.c +++ b/liblttng-ust/lttng-context-cgroup-ns.c @@ -17,6 +17,8 @@ #include #include #include + +#include "context-internal.h" #include "lttng-tracer-core.h" #include "ns.h" diff --git a/liblttng-ust/lttng-context-cpu-id.c b/liblttng-ust/lttng-context-cpu-id.c index 83c0626d..2a8f2812 100644 --- a/liblttng-ust/lttng-context-cpu-id.c +++ b/liblttng-ust/lttng-context-cpu-id.c @@ -21,6 +21,8 @@ #include #include "../libringbuffer/getcpu.h" +#include "context-internal.h" + static size_t cpu_id_get_size(struct lttng_ctx_field *field, size_t offset) { diff --git a/liblttng-ust/lttng-context-ip.c b/liblttng-ust/lttng-context-ip.c index d10c9b45..af4f02ac 100644 --- a/liblttng-ust/lttng-context-ip.c +++ b/liblttng-ust/lttng-context-ip.c @@ -14,6 +14,8 @@ #include #include +#include "context-internal.h" + static size_t ip_get_size(struct lttng_ctx_field *field, size_t offset) { diff --git a/liblttng-ust/lttng-context-ipc-ns.c b/liblttng-ust/lttng-context-ipc-ns.c index a40ad29d..f265c397 100644 --- a/liblttng-ust/lttng-context-ipc-ns.c +++ b/liblttng-ust/lttng-context-ipc-ns.c @@ -17,6 +17,8 @@ #include #include #include + +#include "context-internal.h" #include "lttng-tracer-core.h" #include "ns.h" diff --git a/liblttng-ust/lttng-context-mnt-ns.c b/liblttng-ust/lttng-context-mnt-ns.c index 0069e408..4ce93845 100644 --- a/liblttng-ust/lttng-context-mnt-ns.c +++ b/liblttng-ust/lttng-context-mnt-ns.c @@ -16,6 +16,7 @@ #include #include +#include "context-internal.h" #include "ns.h" /* diff --git a/liblttng-ust/lttng-context-net-ns.c b/liblttng-ust/lttng-context-net-ns.c index 3ae3860f..08b61340 100644 --- a/liblttng-ust/lttng-context-net-ns.c +++ b/liblttng-ust/lttng-context-net-ns.c @@ -17,6 +17,8 @@ #include #include #include + +#include "context-internal.h" #include "lttng-tracer-core.h" #include "ns.h" diff --git a/liblttng-ust/lttng-context-perf-counters.c b/liblttng-ust/lttng-context-perf-counters.c index 738a1d52..74e07dc5 100644 --- a/liblttng-ust/lttng-context-perf-counters.c +++ b/liblttng-ust/lttng-context-perf-counters.c @@ -29,6 +29,8 @@ #include #include #include "perf_event.h" + +#include "context-internal.h" #include "lttng-tracer-core.h" #include "ust-events-internal.h" diff --git a/liblttng-ust/lttng-context-pid-ns.c b/liblttng-ust/lttng-context-pid-ns.c index d41810bf..df7a764d 100644 --- a/liblttng-ust/lttng-context-pid-ns.c +++ b/liblttng-ust/lttng-context-pid-ns.c @@ -16,6 +16,7 @@ #include #include +#include "context-internal.h" #include "ns.h" /* diff --git a/liblttng-ust/lttng-context-procname.c b/liblttng-ust/lttng-context-procname.c index 9622d31c..ec89bd8a 100644 --- a/liblttng-ust/lttng-context-procname.c +++ b/liblttng-ust/lttng-context-procname.c @@ -15,6 +15,8 @@ #include #include "compat.h" +#include "context-internal.h" + /* Maximum number of nesting levels for the procname cache. */ #define PROCNAME_NESTING_MAX 2 diff --git a/liblttng-ust/lttng-context-provider.c b/liblttng-ust/lttng-context-provider.c index b3fc21de..46a18c9f 100644 --- a/liblttng-ust/lttng-context-provider.c +++ b/liblttng-ust/lttng-context-provider.c @@ -14,6 +14,7 @@ #include +#include "context-internal.h" #include "lttng-tracer-core.h" #include "jhash.h" #include "context-provider-internal.h" diff --git a/liblttng-ust/lttng-context-pthread-id.c b/liblttng-ust/lttng-context-pthread-id.c index ef82e857..2502f75f 100644 --- a/liblttng-ust/lttng-context-pthread-id.c +++ b/liblttng-ust/lttng-context-pthread-id.c @@ -13,6 +13,8 @@ #include #include +#include "context-internal.h" + static size_t pthread_id_get_size(struct lttng_ctx_field *field, size_t offset) { diff --git a/liblttng-ust/lttng-context-user-ns.c b/liblttng-ust/lttng-context-user-ns.c index 976b01f8..d2a79b52 100644 --- a/liblttng-ust/lttng-context-user-ns.c +++ b/liblttng-ust/lttng-context-user-ns.c @@ -16,6 +16,7 @@ #include #include +#include "context-internal.h" #include "ns.h" /* diff --git a/liblttng-ust/lttng-context-uts-ns.c b/liblttng-ust/lttng-context-uts-ns.c index b6150681..2cd23939 100644 --- a/liblttng-ust/lttng-context-uts-ns.c +++ b/liblttng-ust/lttng-context-uts-ns.c @@ -17,6 +17,8 @@ #include #include #include + +#include "context-internal.h" #include "lttng-tracer-core.h" #include "ns.h" diff --git a/liblttng-ust/lttng-context-vegid.c b/liblttng-ust/lttng-context-vegid.c index 255dc0c5..436b566a 100644 --- a/liblttng-ust/lttng-context-vegid.c +++ b/liblttng-ust/lttng-context-vegid.c @@ -15,6 +15,8 @@ #include #include #include + +#include "context-internal.h" #include "creds.h" diff --git a/liblttng-ust/lttng-context-veuid.c b/liblttng-ust/lttng-context-veuid.c index 5f1c0d34..3d630575 100644 --- a/liblttng-ust/lttng-context-veuid.c +++ b/liblttng-ust/lttng-context-veuid.c @@ -15,6 +15,8 @@ #include #include #include + +#include "context-internal.h" #include "creds.h" diff --git a/liblttng-ust/lttng-context-vgid.c b/liblttng-ust/lttng-context-vgid.c index ca2a5306..04933405 100644 --- a/liblttng-ust/lttng-context-vgid.c +++ b/liblttng-ust/lttng-context-vgid.c @@ -15,6 +15,8 @@ #include #include #include + +#include "context-internal.h" #include "creds.h" diff --git a/liblttng-ust/lttng-context-vpid.c b/liblttng-ust/lttng-context-vpid.c index d4b4a2cf..f41119f9 100644 --- a/liblttng-ust/lttng-context-vpid.c +++ b/liblttng-ust/lttng-context-vpid.c @@ -14,6 +14,8 @@ #include #include +#include "context-internal.h" + /* * We cache the result to ensure we don't trigger a system call for * each event. diff --git a/liblttng-ust/lttng-context-vsgid.c b/liblttng-ust/lttng-context-vsgid.c index 238c38b2..0778d875 100644 --- a/liblttng-ust/lttng-context-vsgid.c +++ b/liblttng-ust/lttng-context-vsgid.c @@ -15,6 +15,8 @@ #include #include #include + +#include "context-internal.h" #include "creds.h" diff --git a/liblttng-ust/lttng-context-vsuid.c b/liblttng-ust/lttng-context-vsuid.c index 93f40834..ecc239bc 100644 --- a/liblttng-ust/lttng-context-vsuid.c +++ b/liblttng-ust/lttng-context-vsuid.c @@ -15,6 +15,8 @@ #include #include #include + +#include "context-internal.h" #include "creds.h" diff --git a/liblttng-ust/lttng-context-vtid.c b/liblttng-ust/lttng-context-vtid.c index bdf0b309..15c11edd 100644 --- a/liblttng-ust/lttng-context-vtid.c +++ b/liblttng-ust/lttng-context-vtid.c @@ -15,6 +15,8 @@ #include #include #include + +#include "context-internal.h" #include "lttng-tracer-core.h" /* diff --git a/liblttng-ust/lttng-context-vuid.c b/liblttng-ust/lttng-context-vuid.c index 2344ce3d..f4bcb5c9 100644 --- a/liblttng-ust/lttng-context-vuid.c +++ b/liblttng-ust/lttng-context-vuid.c @@ -15,6 +15,8 @@ #include #include #include + +#include "context-internal.h" #include "creds.h" diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index a367168a..10d5bcbe 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -46,6 +46,7 @@ #include "lttng-tracer.h" #include "string-utils.h" #include "ust-events-internal.h" +#include "context-internal.h" #define OBJ_NAME_LEN 16