Move enabler APIs to internal header
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 May 2021 14:39:32 +0000 (10:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 4 May 2021 14:38:33 +0000 (10:38 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Idd0eee625ab10b17a412a6d0d777d64f71801582

include/lttng/events-internal.h
include/lttng/events.h

index df70273a5eaaa70ae3b2e988b64f060284f55722..a0d4fbc072f7861881fb47994c183f1fa13a38bb 100644 (file)
 
 #include <lttng/events.h>
 
+enum lttng_enabler_format_type {
+       LTTNG_ENABLER_FORMAT_STAR_GLOB,
+       LTTNG_ENABLER_FORMAT_NAME,
+};
+
+/*
+ * Objects in a linked-list of enablers, owned by an event.
+ */
+struct lttng_enabler_ref {
+       struct list_head node;                  /* enabler ref list */
+       struct lttng_enabler *ref;              /* backward ref */
+};
+
 struct lttng_kernel_event_common_private {
        struct lttng_kernel_event_common *pub;          /* Public event interface */
 
@@ -462,7 +475,123 @@ int lttng_cpuhp_perf_counter_dead(unsigned int cpu,
 }
 #endif
 
+struct lttng_event_enabler *lttng_event_enabler_create(
+               enum lttng_enabler_format_type format_type,
+               struct lttng_kernel_abi_event *event_param,
+               struct lttng_channel *chan);
+
+int lttng_event_enabler_enable(struct lttng_event_enabler *event_enabler);
+int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler);
+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_kernel_abi_event_notifier *event_notifier_param);
+
+int lttng_event_notifier_enabler_enable(
+               struct lttng_event_notifier_enabler *event_notifier_enabler);
+int lttng_event_notifier_enabler_disable(
+               struct lttng_event_notifier_enabler *event_notifier_enabler);
+
+int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler,
+               struct lttng_kernel_abi_filter_bytecode __user *bytecode);
+int lttng_event_notifier_enabler_attach_filter_bytecode(
+               struct lttng_event_notifier_enabler *event_notifier_enabler,
+               struct lttng_kernel_abi_filter_bytecode __user *bytecode);
+int lttng_event_notifier_enabler_attach_capture_bytecode(
+               struct lttng_event_notifier_enabler *event_notifier_enabler,
+               struct lttng_kernel_abi_capture_bytecode __user *bytecode);
+
+int lttng_desc_match_enabler(const struct lttng_kernel_event_desc *desc,
+               struct lttng_enabler *enabler);
+
+void lttng_enabler_link_bytecode(const struct lttng_kernel_event_desc *event_desc,
+               struct lttng_kernel_ctx *ctx,
+               struct list_head *instance_bytecode_runtime_head,
+               struct list_head *enabler_bytecode_runtime_head);
+
+#if defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
+int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler);
+int lttng_syscalls_unregister_channel(struct lttng_channel *chan);
+int lttng_syscalls_destroy_event(struct lttng_channel *chan);
+int lttng_syscall_filter_enable_event(
+               struct lttng_channel *chan,
+               struct lttng_kernel_event_recorder *event);
+int lttng_syscall_filter_disable_event(
+               struct lttng_channel *chan,
+               struct lttng_kernel_event_recorder *event);
+
+long lttng_channel_syscall_mask(struct lttng_channel *channel,
+               struct lttng_kernel_abi_syscall_mask __user *usyscall_mask);
+
+int lttng_syscalls_register_event_notifier(
+               struct lttng_event_notifier_enabler *event_notifier_enabler);
+int lttng_syscalls_create_matching_event_notifiers(
+               struct lttng_event_notifier_enabler *event_notifier_enabler);
+int lttng_syscalls_unregister_event_notifier_group(struct lttng_event_notifier_group *group);
+int lttng_syscall_filter_enable_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
+int lttng_syscall_filter_disable_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
+#else
+static inline int lttng_syscalls_register_event(
+               struct lttng_event_enabler *event_enabler)
+{
+       return -ENOSYS;
+}
+
+static inline int lttng_syscalls_unregister_channel(struct lttng_channel *chan)
+{
+       return 0;
+}
+
+static inline int lttng_syscalls_destroy(struct lttng_channel *chan)
+{
+       return 0;
+}
+
+static inline int lttng_syscall_filter_enable_event(struct lttng_channel *chan,
+               struct lttng_kernel_event_recorder *event);
+{
+       return -ENOSYS;
+}
+
+static inline int lttng_syscall_filter_disable_event(struct lttng_channel *chan,
+               struct lttng_kernel_event_recorder *event);
+{
+       return -ENOSYS;
+}
+
+static inline long lttng_channel_syscall_mask(struct lttng_channel *channel,
+               struct lttng_kernel_syscall_mask __user *usyscall_mask)
+{
+       return -ENOSYS;
+}
+
+static inline int lttng_syscalls_register_event_notifier(
+               struct lttng_event_notifier_group *group)
+{
+       return -ENOSYS;
+}
+
+static inline int lttng_syscalls_unregister_event_notifier_group(
+               struct lttng_event_notifier_group *group)
+{
+       return 0;
+}
+
+static inline int lttng_syscall_filter_enable_event_notifier(
+               struct lttng_event_notifier_group *group,
+               const char *name)
+{
+       return -ENOSYS;
+}
+
+static inline int lttng_syscall_filter_disable_event_notifier(
+               struct lttng_event_notifier_group *group,
+               const char *name)
+{
+       return -ENOSYS;
+}
 
+#endif
 
 #define lttng_kernel_static_ctx_field(_event_field, _get_size, _record, _get_value, _destroy, _priv)   \
        __LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_ctx_field, {                                 \
index 74e5f1bcbfa9c5413326e4aeadac65da340eb445..66c76d9819c42106ae456718627cfe7f0de3e17d 100644 (file)
@@ -318,14 +318,6 @@ struct lttng_kernel_probe_desc {
 
 struct lttng_krp;                              /* Kretprobe handling */
 
-/*
- * Objects in a linked-list of enablers, owned by an event.
- */
-struct lttng_enabler_ref {
-       struct list_head node;                  /* enabler ref list */
-       struct lttng_enabler *ref;              /* backward ref */
-};
-
 struct lttng_uprobe_handler {
        struct lttng_kernel_event_common *event;
        loff_t offset;
@@ -408,11 +400,6 @@ struct lttng_kernel_event_notifier {
                struct lttng_kernel_notification_ctx *notif_ctx);
 };
 
-enum lttng_enabler_format_type {
-       LTTNG_ENABLER_FORMAT_STAR_GLOB,
-       LTTNG_ENABLER_FORMAT_NAME,
-};
-
 struct lttng_channel_ops {
        struct channel *(*channel_create)(const char *name,
                                void *priv,
@@ -701,22 +688,6 @@ void lttng_unlock_sessions(void);
 
 struct list_head *lttng_get_probe_list_head(void);
 
-struct lttng_event_enabler *lttng_event_enabler_create(
-               enum lttng_enabler_format_type format_type,
-               struct lttng_kernel_abi_event *event_param,
-               struct lttng_channel *chan);
-
-int lttng_event_enabler_enable(struct lttng_event_enabler *event_enabler);
-int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler);
-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_kernel_abi_event_notifier *event_notifier_param);
-
-int lttng_event_notifier_enabler_enable(
-               struct lttng_event_notifier_enabler *event_notifier_enabler);
-int lttng_event_notifier_enabler_disable(
-               struct lttng_event_notifier_enabler *event_notifier_enabler);
 int lttng_fix_pending_events(void);
 int lttng_fix_pending_event_notifiers(void);
 int lttng_session_active(void);
@@ -836,106 +807,6 @@ int lttng_session_list_tracker_ids(struct lttng_session *session,
 void lttng_clock_ref(void);
 void lttng_clock_unref(void);
 
-int lttng_desc_match_enabler(const struct lttng_kernel_event_desc *desc,
-               struct lttng_enabler *enabler);
-
-#if defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
-int lttng_syscalls_register_event(struct lttng_event_enabler *event_enabler);
-int lttng_syscalls_unregister_channel(struct lttng_channel *chan);
-int lttng_syscalls_destroy_event(struct lttng_channel *chan);
-int lttng_syscall_filter_enable_event(
-               struct lttng_channel *chan,
-               struct lttng_kernel_event_recorder *event);
-int lttng_syscall_filter_disable_event(
-               struct lttng_channel *chan,
-               struct lttng_kernel_event_recorder *event);
-
-long lttng_channel_syscall_mask(struct lttng_channel *channel,
-               struct lttng_kernel_abi_syscall_mask __user *usyscall_mask);
-
-int lttng_syscalls_register_event_notifier(
-               struct lttng_event_notifier_enabler *event_notifier_enabler);
-int lttng_syscalls_create_matching_event_notifiers(
-               struct lttng_event_notifier_enabler *event_notifier_enabler);
-int lttng_syscalls_unregister_event_notifier_group(struct lttng_event_notifier_group *group);
-int lttng_syscall_filter_enable_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
-int lttng_syscall_filter_disable_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
-#else
-static inline int lttng_syscalls_register_event(
-               struct lttng_event_enabler *event_enabler)
-{
-       return -ENOSYS;
-}
-
-static inline int lttng_syscalls_unregister_channel(struct lttng_channel *chan)
-{
-       return 0;
-}
-
-static inline int lttng_syscalls_destroy(struct lttng_channel *chan)
-{
-       return 0;
-}
-
-static inline int lttng_syscall_filter_enable_event(struct lttng_channel *chan,
-               struct lttng_kernel_event_recorder *event);
-{
-       return -ENOSYS;
-}
-
-static inline int lttng_syscall_filter_disable_event(struct lttng_channel *chan,
-               struct lttng_kernel_event_recorder *event);
-{
-       return -ENOSYS;
-}
-
-static inline long lttng_channel_syscall_mask(struct lttng_channel *channel,
-               struct lttng_kernel_syscall_mask __user *usyscall_mask)
-{
-       return -ENOSYS;
-}
-
-static inline int lttng_syscalls_register_event_notifier(
-               struct lttng_event_notifier_group *group)
-{
-       return -ENOSYS;
-}
-
-static inline int lttng_syscalls_unregister_event_notifier_group(
-               struct lttng_event_notifier_group *group)
-{
-       return 0;
-}
-
-static inline int lttng_syscall_filter_enable_event_notifier(
-               struct lttng_event_notifier_group *group,
-               const char *name)
-{
-       return -ENOSYS;
-}
-
-static inline int lttng_syscall_filter_disable_event_notifier(
-               struct lttng_event_notifier_group *group,
-               const char *name)
-{
-       return -ENOSYS;
-}
-
-#endif
-
-int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler,
-               struct lttng_kernel_abi_filter_bytecode __user *bytecode);
-int lttng_event_notifier_enabler_attach_filter_bytecode(
-               struct lttng_event_notifier_enabler *event_notifier_enabler,
-               struct lttng_kernel_abi_filter_bytecode __user *bytecode);
-int lttng_event_notifier_enabler_attach_capture_bytecode(
-               struct lttng_event_notifier_enabler *event_notifier_enabler,
-               struct lttng_kernel_abi_capture_bytecode __user *bytecode);
-
-void lttng_enabler_link_bytecode(const struct lttng_kernel_event_desc *event_desc,
-               struct lttng_kernel_ctx *ctx,
-               struct list_head *instance_bytecode_runtime_head,
-               struct list_head *enabler_bytecode_runtime_head);
 void lttng_free_event_filter_runtime(struct lttng_kernel_event_common *event);
 
 int lttng_probes_init(void);
This page took 0.030274 seconds and 4 git commands to generate.