#ifndef _LTTNG_EVENTS_H
#define _LTTNG_EVENTS_H
+#include <linux/irq_work.h>
#include <linux/version.h>
#include <linux/list.h>
#include <linux/kprobes.h>
struct lttng_probe_ctx {
struct lttng_event *event;
+ struct lttng_event_notifier *event_notifier; // Not sure if we will ever need it.
uint8_t interruptible;
};
const struct lttng_event_field *fields; /* event payload */
unsigned int nr_fields;
struct module *owner;
+ void *event_notifier_callback;
};
struct lttng_probe_desc {
struct list_head node;
};
+struct lttng_kprobe {
+ struct kprobe kp;
+ char *symbol_name;
+};
+
enum lttng_syscall_entryexit {
LTTNG_SYSCALL_ENTRY,
LTTNG_SYSCALL_EXIT,
struct lttng_ctx *ctx;
enum lttng_kernel_instrumentation instrumentation;
union {
- struct {
- struct kprobe kp;
- char *symbol_name;
- } kprobe;
+ struct lttng_kprobe kprobe;
struct {
struct lttng_krp *lttng_krp;
char *symbol_name;
struct list_head bytecode_runtime_head;
int has_enablers_without_bytecode;
+ void (*send_notification)(struct lttng_event_notifier *event_notifier);
struct lttng_event_notifier_group *group; /* Weak ref */
};
struct lttng_event_notifier_group {
struct file *file; /* File associated to event notifier group */
+ struct file *notif_file; /* File used to expose notifications to userspace. */
struct list_head node; /* event notifier group list */
struct list_head enablers_head; /* List of enablers */
struct list_head event_notifiers_head; /* List of event notifier */
struct lttng_transport *transport;
struct channel *chan; /* Ring buffer channel for event notifier group. */
struct lib_ring_buffer *buf; /* Ring buffer for event notifier group. */
+ wait_queue_head_t read_wait;
+ struct irq_work wakeup_pending; /* Pending wakeup irq work. */
};
struct lttng_metadata_cache {
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);
+bool lttng_event_notifier_active(void);
struct lttng_session *lttng_session_create(void);
int lttng_session_enable(struct lttng_session *session);
extern int lttng_statedump_start(struct lttng_session *session);
#ifdef CONFIG_KPROBES
-int lttng_kprobes_register(const char *name,
+int lttng_kprobes_register_event(const char *name,
const char *symbol_name,
uint64_t offset,
uint64_t addr,
struct lttng_event *event);
-void lttng_kprobes_unregister(struct lttng_event *event);
-void lttng_kprobes_destroy_private(struct lttng_event *event);
+void lttng_kprobes_unregister_event(struct lttng_event *event);
+void lttng_kprobes_destroy_event_private(struct lttng_event *event);
#else
static inline
-int lttng_kprobes_register(const char *name,
+int lttng_kprobes_register_event(const char *name,
const char *symbol_name,
uint64_t offset,
uint64_t addr,
}
static inline
-void lttng_kprobes_unregister(struct lttng_event *event)
+void lttng_kprobes_unregister_event(struct lttng_event *event)
+{
+}
+
+static inline
+void lttng_kprobes_destroy_event_private(struct lttng_event *event)
{
}