Move kprobe, kretprobe, uprobe APIs to internal header
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 May 2021 14:41:45 +0000 (10:41 -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: I92c5a245c3e5f12b6d43b73e104a86e55e341817

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

index a0d4fbc072f7861881fb47994c183f1fa13a38bb..58e625df3022efb2256570aeb1d0c4f20ebdfb2e 100644 (file)
@@ -593,6 +593,159 @@ static inline int lttng_syscall_filter_disable_event_notifier(
 
 #endif
 
+#ifdef CONFIG_KPROBES
+int lttng_kprobes_register_event(const char *name,
+               const char *symbol_name,
+               uint64_t offset,
+               uint64_t addr,
+               struct lttng_kernel_event_recorder *event);
+void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder *event);
+void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder *event);
+int lttng_kprobes_register_event_notifier(const char *symbol_name,
+               uint64_t offset,
+               uint64_t addr,
+               struct lttng_kernel_event_notifier *event_notifier);
+void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
+void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier);
+#else
+static inline
+int lttng_kprobes_register_event(const char *name,
+               const char *symbol_name,
+               uint64_t offset,
+               uint64_t addr,
+               struct lttng_kernel_event_recorder *event)
+{
+       return -ENOSYS;
+}
+
+static inline
+void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder *event)
+{
+}
+
+static inline
+void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder *event)
+{
+}
+
+static inline
+int lttng_kprobes_register_event_notifier(const char *symbol_name,
+               uint64_t offset,
+               uint64_t addr,
+               struct lttng_kernel_event_notifier *event_notifier)
+{
+       return -ENOSYS;
+}
+
+static inline
+void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
+{
+}
+
+static inline
+void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier)
+{
+}
+#endif
+
+int lttng_event_add_callsite(struct lttng_kernel_event_common *event,
+       struct lttng_kernel_abi_event_callsite __user *callsite);
+
+#ifdef CONFIG_UPROBES
+int lttng_uprobes_register_event(const char *name,
+       int fd, struct lttng_kernel_event_recorder *event);
+int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common *event,
+       struct lttng_kernel_abi_event_callsite __user *callsite);
+void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder *event);
+void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder *event);
+int lttng_uprobes_register_event_notifier(const char *name,
+       int fd, struct lttng_kernel_event_notifier *event_notifier);
+void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
+void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier);
+#else
+static inline
+int lttng_uprobes_register_event(const char *name,
+       int fd, struct lttng_kernel_event_recorder *event)
+{
+       return -ENOSYS;
+}
+
+static inline
+int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common *event,
+       struct lttng_kernel_abi_event_callsite __user *callsite)
+{
+       return -ENOSYS;
+}
+
+static inline
+void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder *event)
+{
+}
+
+static inline
+void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder *event)
+{
+}
+
+static inline
+int lttng_uprobes_register_event_notifier(const char *name,
+       int fd, struct lttng_kernel_event_notifier *event_notifier)
+{
+       return -ENOSYS;
+}
+
+static inline
+void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
+{
+}
+
+static inline
+void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier)
+{
+}
+#endif
+
+#ifdef CONFIG_KRETPROBES
+int lttng_kretprobes_register(const char *name,
+               const char *symbol_name,
+               uint64_t offset,
+               uint64_t addr,
+               struct lttng_kernel_event_recorder *event_entry,
+               struct lttng_kernel_event_recorder *event_exit);
+void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder *event);
+void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder *event);
+int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common *event,
+       int enable);
+#else
+static inline
+int lttng_kretprobes_register(const char *name,
+               const char *symbol_name,
+               uint64_t offset,
+               uint64_t addr,
+               struct lttng_kernel_event_recorder *event_entry,
+               struct lttng_kernel_event_recorder *event_exit)
+{
+       return -ENOSYS;
+}
+
+static inline
+void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder *event)
+{
+}
+
+static inline
+void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder *event)
+{
+}
+
+static inline
+int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common *event,
+       int enable)
+{
+       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, {                                 \
                .event_field = (_event_field),                                                          \
index 676d2869cbfa47c28050ee3a22f3d2200a6ab6bf..942622fabc6a0c91a785156a70a7e7d95d4bb9b9 100644 (file)
@@ -816,159 +816,6 @@ void lttng_logger_exit(void);
 
 extern int lttng_statedump_start(struct lttng_session *session);
 
-#ifdef CONFIG_KPROBES
-int lttng_kprobes_register_event(const char *name,
-               const char *symbol_name,
-               uint64_t offset,
-               uint64_t addr,
-               struct lttng_kernel_event_recorder *event);
-void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder *event);
-void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder *event);
-int lttng_kprobes_register_event_notifier(const char *symbol_name,
-               uint64_t offset,
-               uint64_t addr,
-               struct lttng_kernel_event_notifier *event_notifier);
-void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
-void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier);
-#else
-static inline
-int lttng_kprobes_register_event(const char *name,
-               const char *symbol_name,
-               uint64_t offset,
-               uint64_t addr,
-               struct lttng_kernel_event_recorder *event)
-{
-       return -ENOSYS;
-}
-
-static inline
-void lttng_kprobes_unregister_event(struct lttng_kernel_event_recorder *event)
-{
-}
-
-static inline
-void lttng_kprobes_destroy_event_private(struct lttng_kernel_event_recorder *event)
-{
-}
-
-static inline
-int lttng_kprobes_register_event_notifier(const char *symbol_name,
-               uint64_t offset,
-               uint64_t addr,
-               struct lttng_kernel_event_notifier *event_notifier)
-{
-       return -ENOSYS;
-}
-
-static inline
-void lttng_kprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
-{
-}
-
-static inline
-void lttng_kprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier)
-{
-}
-#endif
-
-int lttng_event_add_callsite(struct lttng_kernel_event_common *event,
-       struct lttng_kernel_abi_event_callsite __user *callsite);
-
-#ifdef CONFIG_UPROBES
-int lttng_uprobes_register_event(const char *name,
-       int fd, struct lttng_kernel_event_recorder *event);
-int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common *event,
-       struct lttng_kernel_abi_event_callsite __user *callsite);
-void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder *event);
-void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder *event);
-int lttng_uprobes_register_event_notifier(const char *name,
-       int fd, struct lttng_kernel_event_notifier *event_notifier);
-void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier);
-void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier);
-#else
-static inline
-int lttng_uprobes_register_event(const char *name,
-       int fd, struct lttng_kernel_event_recorder *event)
-{
-       return -ENOSYS;
-}
-
-static inline
-int lttng_uprobes_event_add_callsite(struct lttng_kernel_event_common *event,
-       struct lttng_kernel_abi_event_callsite __user *callsite)
-{
-       return -ENOSYS;
-}
-
-static inline
-void lttng_uprobes_unregister_event(struct lttng_kernel_event_recorder *event)
-{
-}
-
-static inline
-void lttng_uprobes_destroy_event_private(struct lttng_kernel_event_recorder *event)
-{
-}
-
-static inline
-int lttng_uprobes_register_event_notifier(const char *name,
-       int fd, struct lttng_kernel_event_notifier *event_notifier)
-{
-       return -ENOSYS;
-}
-
-static inline
-void lttng_uprobes_unregister_event_notifier(struct lttng_kernel_event_notifier *event_notifier)
-{
-}
-
-static inline
-void lttng_uprobes_destroy_event_notifier_private(struct lttng_kernel_event_notifier *event_notifier)
-{
-}
-#endif
-
-#ifdef CONFIG_KRETPROBES
-int lttng_kretprobes_register(const char *name,
-               const char *symbol_name,
-               uint64_t offset,
-               uint64_t addr,
-               struct lttng_kernel_event_recorder *event_entry,
-               struct lttng_kernel_event_recorder *event_exit);
-void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder *event);
-void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder *event);
-int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common *event,
-       int enable);
-#else
-static inline
-int lttng_kretprobes_register(const char *name,
-               const char *symbol_name,
-               uint64_t offset,
-               uint64_t addr,
-               struct lttng_kernel_event_recorder *event_entry,
-               struct lttng_kernel_event_recorder *event_exit)
-{
-       return -ENOSYS;
-}
-
-static inline
-void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder *event)
-{
-}
-
-static inline
-void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder *event)
-{
-}
-
-static inline
-int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common *event,
-       int enable)
-{
-       return -ENOSYS;
-}
-#endif
-
 int lttng_calibrate(struct lttng_kernel_abi_calibrate *calibrate);
 
 extern const struct file_operations lttng_tracepoint_list_fops;
This page took 0.028837 seconds and 4 git commands to generate.