uint64_t user_token; /* User-provided token. */
};
-struct lttng_event_enabler {
+struct lttng_event_recorder_enabler {
struct lttng_event_enabler_common parent;
struct list_head node; /* per-session list of enablers */
bool published; /* published in per-session list. */
void *event_filter_ctx);
static inline
-struct lttng_event_enabler_common *lttng_event_enabler_as_enabler(
- struct lttng_event_enabler *event_enabler)
+struct lttng_event_enabler_common *lttng_event_recorder_enabler_as_enabler(
+ struct lttng_event_recorder_enabler *event_recorder_enabler)
{
- return &event_enabler->parent;
+ return &event_recorder_enabler->parent;
}
static inline
}
#endif
-struct lttng_event_enabler *lttng_event_enabler_create(
+struct lttng_event_recorder_enabler *lttng_event_recorder_enabler_create(
enum lttng_enabler_format_type format_type,
struct lttng_kernel_abi_event *event_param,
struct lttng_kernel_channel_buffer *chan);
void lttng_event_enabler_session_add(struct lttng_kernel_session *session,
- struct lttng_event_enabler *event_enabler);
-void lttng_event_enabler_destroy(struct lttng_event_enabler *event_enabler);
+ struct lttng_event_recorder_enabler *event_enabler);
+void lttng_event_enabler_destroy(struct lttng_event_recorder_enabler *event_enabler);
-int lttng_event_enabler_enable(struct lttng_event_enabler *event_enabler);
-int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler);
+int lttng_event_enabler_enable(struct lttng_event_recorder_enabler *event_enabler);
+int lttng_event_enabler_disable(struct lttng_event_recorder_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,
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,
+int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_recorder_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 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_register_event(struct lttng_event_recorder_enabler *event_enabler);
int lttng_syscalls_unregister_channel(struct lttng_kernel_channel_buffer *chan);
int lttng_syscalls_destroy_event(struct lttng_kernel_channel_buffer *chan);
int lttng_syscall_filter_enable_event(
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)
+ struct lttng_event_recorder_enabler *event_enabler)
{
return -ENOSYS;
}
unsigned int read_timer_interval);
void lttng_metadata_channel_destroy(struct lttng_kernel_channel_buffer *chan);
-struct lttng_kernel_event_recorder *lttng_kernel_event_recorder_create(struct lttng_event_enabler *event_enabler,
+struct lttng_kernel_event_recorder *lttng_kernel_event_recorder_create(struct lttng_event_recorder_enabler *event_enabler,
const struct lttng_kernel_event_desc *event_desc);
-struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_event_enabler *event_enabler,
+struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_event_recorder_enabler *event_enabler,
const struct lttng_kernel_event_desc *event_desc);
struct lttng_kernel_event_recorder *lttng_event_compat_old_create(struct lttng_kernel_channel_buffer *chan,
struct lttng_kernel_abi_old_event *old_event_param,
lttng_fallthrough;
case LTTNG_KERNEL_ABI_SYSCALL:
{
- struct lttng_event_enabler *event_enabler;
+ struct lttng_event_recorder_enabler *event_enabler;
if (strutils_is_star_glob_pattern(event_param->name)) {
/*
* If the event name is a star globbing pattern,
* we create the special star globbing enabler.
*/
- event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_STAR_GLOB,
+ event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_STAR_GLOB,
event_param, channel);
} else {
- event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_NAME,
+ event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME,
event_param, channel);
}
if (event_enabler)
case LTTNG_KERNEL_ABI_UPROBE:
{
struct lttng_kernel_event_recorder *event;
- struct lttng_event_enabler *event_enabler;
+ struct lttng_event_recorder_enabler *event_enabler;
- event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_NAME,
+ event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME,
event_param, channel);
if (!event_enabler) {
ret = -ENOMEM;
static
long lttng_event_recorder_enabler_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
- struct lttng_event_enabler *event_enabler = file->private_data;
+ struct lttng_event_recorder_enabler *event_enabler = file->private_data;
switch (cmd) {
case LTTNG_KERNEL_ABI_OLD_CONTEXT:
static
int lttng_event_recorder_enabler_release(struct inode *inode, struct file *file)
{
- struct lttng_event_enabler *event_enabler = file->private_data;
+ struct lttng_event_recorder_enabler *event_enabler = file->private_data;
if (event_enabler)
fput(event_enabler->chan->priv->parent.file);
struct lttng_kernel_channel_buffer_private *chan_priv, *tmpchan_priv;
struct lttng_kernel_event_recorder_private *event_recorder_priv, *tmpevent_recorder_priv;
struct lttng_metadata_stream *metadata_stream;
- struct lttng_event_enabler *event_enabler, *tmp_event_enabler;
+ struct lttng_event_recorder_enabler *event_enabler, *tmp_event_enabler;
int ret;
mutex_lock(&sessions_mutex);
* Supports event creation while tracing session is active.
* Needs to be called with sessions mutex held.
*/
-struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_event_enabler *event_enabler,
+struct lttng_kernel_event_recorder *_lttng_kernel_event_recorder_create(struct lttng_event_recorder_enabler *event_enabler,
const struct lttng_kernel_event_desc *event_desc)
{
struct lttng_kernel_channel_buffer *chan = event_enabler->chan;
return counter->ops->counter_clear(counter->counter, dim_indexes);
}
-struct lttng_kernel_event_recorder *lttng_kernel_event_recorder_create(struct lttng_event_enabler *event_enabler,
+struct lttng_kernel_event_recorder *lttng_kernel_event_recorder_create(struct lttng_event_recorder_enabler *event_enabler,
const struct lttng_kernel_event_desc *event_desc)
{
struct lttng_kernel_event_recorder *event;
}
static
-int lttng_event_enabler_match_event(struct lttng_event_enabler *event_enabler,
+int lttng_event_enabler_match_event(struct lttng_event_recorder_enabler *event_enabler,
struct lttng_kernel_event_recorder *event_recorder)
{
- struct lttng_event_enabler_common *base_enabler = lttng_event_enabler_as_enabler(
+ struct lttng_event_enabler_common *base_enabler = lttng_event_recorder_enabler_as_enabler(
event_enabler);
if (base_enabler->event_param.instrumentation != event_recorder->priv->parent.instrumentation)
}
static
-void lttng_create_tracepoint_event_if_missing(struct lttng_event_enabler *event_enabler)
+void lttng_create_tracepoint_event_if_missing(struct lttng_event_recorder_enabler *event_enabler)
{
struct lttng_kernel_session *session = event_enabler->chan->parent.session;
struct lttng_kernel_probe_desc *probe_desc;
desc = probe_desc->event_desc[i];
if (!lttng_desc_match_enabler(desc,
- lttng_event_enabler_as_enabler(event_enabler)))
+ lttng_event_recorder_enabler_as_enabler(event_enabler)))
continue;
/*
}
static
-void lttng_create_syscall_event_if_missing(struct lttng_event_enabler *event_enabler)
+void lttng_create_syscall_event_if_missing(struct lttng_event_recorder_enabler *event_enabler)
{
int ret;
* Should be called with sessions mutex held.
*/
static
-void lttng_create_event_if_missing(struct lttng_event_enabler *event_enabler)
+void lttng_create_event_if_missing(struct lttng_event_recorder_enabler *event_enabler)
{
switch (event_enabler->parent.event_param.instrumentation) {
case LTTNG_KERNEL_ABI_TRACEPOINT:
* Should be called with sessions mutex held.
*/
static
-int lttng_event_enabler_ref_events(struct lttng_event_enabler *event_enabler)
+int lttng_event_enabler_ref_events(struct lttng_event_recorder_enabler *event_enabler)
{
struct lttng_kernel_channel_buffer *chan = event_enabler->chan;
struct lttng_kernel_session *session = event_enabler->chan->parent.session;
- struct lttng_event_enabler_common *base_enabler = lttng_event_enabler_as_enabler(event_enabler);
+ struct lttng_event_enabler_common *base_enabler = lttng_event_recorder_enabler_as_enabler(event_enabler);
struct lttng_kernel_event_recorder_private *event_recorder_priv;
if (base_enabler->event_param.instrumentation == LTTNG_KERNEL_ABI_SYSCALL &&
if (!lttng_event_enabler_match_event(event_enabler, event_recorder))
continue;
enabler_ref = lttng_enabler_ref(&event_recorder_priv->parent.enablers_ref_head,
- lttng_event_enabler_as_enabler(event_enabler));
+ lttng_event_recorder_enabler_as_enabler(event_enabler));
if (!enabler_ref) {
/*
* If no backward ref, create it.
enabler_ref = kzalloc(sizeof(*enabler_ref), GFP_KERNEL);
if (!enabler_ref)
return -ENOMEM;
- enabler_ref->ref = lttng_event_enabler_as_enabler(event_enabler);
+ enabler_ref->ref = lttng_event_recorder_enabler_as_enabler(event_enabler);
list_add(&enabler_ref->node,
&event_recorder_priv->parent.enablers_ref_head);
}
lttng_enabler_link_bytecode(event_recorder_priv->parent.desc,
lttng_static_ctx,
&event_recorder_priv->parent.filter_bytecode_runtime_head,
- <tng_event_enabler_as_enabler(event_enabler)->filter_bytecode_head);
+ <tng_event_recorder_enabler_as_enabler(event_enabler)->filter_bytecode_head);
}
return 0;
}
return 0;
}
-struct lttng_event_enabler *lttng_event_enabler_create(
+struct lttng_event_recorder_enabler *lttng_event_recorder_enabler_create(
enum lttng_enabler_format_type format_type,
struct lttng_kernel_abi_event *event_param,
struct lttng_kernel_channel_buffer *chan)
{
- struct lttng_event_enabler *event_enabler;
+ struct lttng_event_recorder_enabler *event_enabler;
event_enabler = kzalloc(sizeof(*event_enabler), GFP_KERNEL);
if (!event_enabler)
}
void lttng_event_enabler_session_add(struct lttng_kernel_session *session,
- struct lttng_event_enabler *event_enabler)
+ struct lttng_event_recorder_enabler *event_enabler)
{
mutex_lock(&sessions_mutex);
list_add(&event_enabler->node, &session->priv->enablers_head);
mutex_unlock(&sessions_mutex);
}
-int lttng_event_enabler_enable(struct lttng_event_enabler *event_enabler)
+int lttng_event_enabler_enable(struct lttng_event_recorder_enabler *event_enabler)
{
mutex_lock(&sessions_mutex);
- lttng_event_enabler_as_enabler(event_enabler)->enabled = 1;
+ lttng_event_recorder_enabler_as_enabler(event_enabler)->enabled = 1;
lttng_session_lazy_sync_event_enablers(event_enabler->chan->parent.session);
mutex_unlock(&sessions_mutex);
return 0;
}
-int lttng_event_enabler_disable(struct lttng_event_enabler *event_enabler)
+int lttng_event_enabler_disable(struct lttng_event_recorder_enabler *event_enabler)
{
mutex_lock(&sessions_mutex);
- lttng_event_enabler_as_enabler(event_enabler)->enabled = 0;
+ lttng_event_recorder_enabler_as_enabler(event_enabler)->enabled = 0;
lttng_session_lazy_sync_event_enablers(event_enabler->chan->parent.session);
mutex_unlock(&sessions_mutex);
return 0;
return ret;
}
-int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_enabler *event_enabler,
+int lttng_event_enabler_attach_filter_bytecode(struct lttng_event_recorder_enabler *event_enabler,
struct lttng_kernel_abi_filter_bytecode __user *bytecode)
{
int ret;
ret = lttng_enabler_attach_filter_bytecode(
- lttng_event_enabler_as_enabler(event_enabler), bytecode);
+ lttng_event_recorder_enabler_as_enabler(event_enabler), bytecode);
if (ret)
goto error;
}
}
-void lttng_event_enabler_destroy(struct lttng_event_enabler *event_enabler)
+void lttng_event_enabler_destroy(struct lttng_event_recorder_enabler *event_enabler)
{
- lttng_enabler_destroy(lttng_event_enabler_as_enabler(event_enabler));
+ lttng_enabler_destroy(lttng_event_recorder_enabler_as_enabler(event_enabler));
if (event_enabler->published)
list_del(&event_enabler->node);
static
void lttng_session_sync_event_enablers(struct lttng_kernel_session *session)
{
- struct lttng_event_enabler *event_enabler;
+ struct lttng_event_recorder_enabler *event_enabler;
struct lttng_kernel_event_recorder_private *event_recorder_priv;
list_for_each_entry(event_enabler, &session->priv->enablers_head, node)
switch (event_enabler->enabler_type) {
case LTTNG_EVENT_ENABLER_TYPE_RECORDER:
{
- struct lttng_event_enabler *event_recorder_enabler =
- container_of(event_enabler, struct lttng_event_enabler, parent);
+ struct lttng_event_recorder_enabler *event_recorder_enabler =
+ container_of(event_enabler, struct lttng_event_recorder_enabler, parent);
return &event_recorder_enabler->chan->priv->parent.syscall_table;
}
case LTTNG_EVENT_ENABLER_TYPE_NOTIFIER:
*/
static
int lttng_create_syscall_event_if_missing(const struct trace_syscall_entry *table, size_t table_len,
- struct hlist_head *chan_table, struct lttng_event_enabler *syscall_event_enabler,
+ struct hlist_head *chan_table, struct lttng_event_recorder_enabler *syscall_event_enabler,
enum sc_type type)
{
struct lttng_kernel_syscall_table *syscall_table = get_syscall_table_from_enabler(&syscall_event_enabler->parent);
/* Allocate events for each syscall matching enabler, insert into table */
for (i = 0; i < table_len; i++) {
const struct lttng_kernel_event_desc *desc = table[i].desc;
- struct lttng_event_enabler *event_enabler;
+ struct lttng_event_recorder_enabler *event_enabler;
struct lttng_kernel_abi_event ev;
struct lttng_kernel_event_recorder_private *event_recorder_priv;
struct lttng_kernel_event_recorder *event_recorder;
continue;
}
if (lttng_desc_match_enabler(desc,
- lttng_event_enabler_as_enabler(syscall_event_enabler)) <= 0)
+ lttng_event_recorder_enabler_as_enabler(syscall_event_enabler)) <= 0)
continue;
/*
* Check if already created.
strncpy(ev.name, desc->event_name, LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1);
ev.name[LTTNG_KERNEL_ABI_SYM_NAME_LEN - 1] = '\0';
ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL;
- event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, chan);
+ event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, chan);
if (!event_enabler) {
return -ENOMEM;
}
/*
* Should be called with sessions lock held.
*/
-int lttng_syscalls_register_event(struct lttng_event_enabler *syscall_event_enabler)
+int lttng_syscalls_register_event(struct lttng_event_recorder_enabler *syscall_event_enabler)
{
struct lttng_kernel_syscall_table *syscall_table = get_syscall_table_from_enabler(&syscall_event_enabler->parent);
struct lttng_kernel_abi_event ev;
const struct lttng_kernel_event_desc *desc =
&__event_desc___syscall_entry_unknown;
struct lttng_kernel_event_recorder *event_recorder;
- struct lttng_event_enabler *event_enabler;
+ struct lttng_event_recorder_enabler *event_enabler;
memset(&ev, 0, sizeof(ev));
strncpy(ev.name, desc->event_name, LTTNG_KERNEL_ABI_SYM_NAME_LEN);
ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL;
ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY;
ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE;
- event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
+ event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
if (!event_enabler) {
return -ENOMEM;
}
const struct lttng_kernel_event_desc *desc =
&__event_desc___compat_syscall_entry_unknown;
struct lttng_kernel_event_recorder *event_recorder;
- struct lttng_event_enabler *event_enabler;
+ struct lttng_event_recorder_enabler *event_enabler;
memset(&ev, 0, sizeof(ev));
strncpy(ev.name, desc->event_name, LTTNG_KERNEL_ABI_SYM_NAME_LEN);
ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL;
ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_ENTRY;
ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT;
- event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
+ event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
if (!event_enabler) {
return -ENOMEM;
}
const struct lttng_kernel_event_desc *desc =
&__event_desc___compat_syscall_exit_unknown;
struct lttng_kernel_event_recorder *event_recorder;
- struct lttng_event_enabler *event_enabler;
+ struct lttng_event_recorder_enabler *event_enabler;
memset(&ev, 0, sizeof(ev));
strncpy(ev.name, desc->event_name, LTTNG_KERNEL_ABI_SYM_NAME_LEN);
ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL;
ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT;
ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_COMPAT;
- event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
+ event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
if (!event_enabler) {
return -ENOMEM;
}
const struct lttng_kernel_event_desc *desc =
&__event_desc___syscall_exit_unknown;
struct lttng_kernel_event_recorder *event_recorder;
- struct lttng_event_enabler *event_enabler;
+ struct lttng_event_recorder_enabler *event_enabler;
memset(&ev, 0, sizeof(ev));
strncpy(ev.name, desc->event_name, LTTNG_KERNEL_ABI_SYM_NAME_LEN);
ev.instrumentation = LTTNG_KERNEL_ABI_SYSCALL;
ev.u.syscall.entryexit = LTTNG_KERNEL_ABI_SYSCALL_EXIT;
ev.u.syscall.abi = LTTNG_KERNEL_ABI_SYSCALL_ABI_NATIVE;
- event_enabler = lttng_event_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
+ event_enabler = lttng_event_recorder_enabler_create(LTTNG_ENABLER_FORMAT_NAME, &ev, syscall_event_enabler->chan);
if (!event_enabler) {
return -ENOMEM;
}