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);
+ struct lttng_kernel_event_common *event_entry,
+ struct lttng_kernel_event_common *event_exit);
+void lttng_kretprobes_unregister(struct lttng_kernel_event_common *event);
+void lttng_kretprobes_destroy_private(struct lttng_kernel_event_common *event);
int lttng_kretprobes_event_enable_state(struct lttng_kernel_event_common *event,
int enable);
#else
const char *symbol_name,
uint64_t offset,
uint64_t addr,
- struct lttng_kernel_event_recorder *event_entry,
- struct lttng_kernel_event_recorder *event_exit)
+ struct lttng_kernel_event_common *event_entry,
+ struct lttng_kernel_event_common *event_exit)
{
return -ENOSYS;
}
static inline
-void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder *event)
+void lttng_kretprobes_unregister(struct lttng_kernel_event_common *event)
{
}
static inline
-void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder *event)
+void lttng_kretprobes_destroy_private(struct lttng_kernel_event_common *event)
{
}
event_param->u.kretprobe.symbol_name,
event_param->u.kretprobe.offset,
event_param->u.kretprobe.addr,
- event_recorder, event_recorder_return);
+ &event_recorder->parent, &event_recorder_return->parent);
if (ret) {
kmem_cache_free(event_recorder_private_cache, event_recorder_return_priv);
kmem_cache_free(event_recorder_cache, event_recorder_return);
break;
case LTTNG_KERNEL_ABI_KRETPROBE:
- lttng_kretprobes_unregister(event_recorder);
+ lttng_kretprobes_unregister(&event_recorder->parent);
ret = 0;
break;
case LTTNG_KERNEL_ABI_KRETPROBE:
module_put(event_priv->desc->owner);
- lttng_kretprobes_destroy_private(event_recorder);
+ lttng_kretprobes_destroy_private(&event_recorder->parent);
break;
case LTTNG_KERNEL_ABI_SYSCALL:
* Create event description
*/
static
-int lttng_create_kprobe_event(const char *name, struct lttng_kernel_event_recorder *event_recorder,
+int lttng_create_kprobe_event(const char *name, struct lttng_kernel_event_common *event,
enum lttng_kretprobe_type type)
{
struct lttng_kernel_event_desc *desc;
desc->event_name = alloc_name;
desc->tp_class = &tp_class;
desc->owner = THIS_MODULE;
- event_recorder->priv->parent.desc = desc;
+ event->priv->desc = desc;
return 0;
const char *symbol_name,
uint64_t offset,
uint64_t addr,
- struct lttng_kernel_event_recorder *event_recorder_entry,
- struct lttng_kernel_event_recorder *event_recorder_exit)
+ struct lttng_kernel_event_common *event_entry,
+ struct lttng_kernel_event_common *event_exit)
{
int ret;
struct lttng_krp *lttng_krp;
if (symbol_name[0] == '\0')
symbol_name = NULL;
- ret = lttng_create_kprobe_event(name, event_recorder_entry, EVENT_ENTRY);
+ ret = lttng_create_kprobe_event(name, event_entry, EVENT_ENTRY);
if (ret)
goto error;
- ret = lttng_create_kprobe_event(name, event_recorder_exit, EVENT_EXIT);
+ ret = lttng_create_kprobe_event(name, event_exit, EVENT_EXIT);
if (ret)
goto event_exit_error;
lttng_krp = kzalloc(sizeof(*lttng_krp), GFP_KERNEL);
ret = -ENOMEM;
goto name_error;
}
- lttng_krp->krp.kp.symbol_name =
- alloc_symbol;
- event_recorder_entry->priv->parent.u.kretprobe.symbol_name =
- alloc_symbol;
- event_recorder_exit->priv->parent.u.kretprobe.symbol_name =
- alloc_symbol;
+ lttng_krp->krp.kp.symbol_name = alloc_symbol;
+ event_entry->priv->u.kretprobe.symbol_name = alloc_symbol;
+ event_exit->priv->u.kretprobe.symbol_name = alloc_symbol;
}
lttng_krp->krp.kp.offset = offset;
lttng_krp->krp.kp.addr = (void *) (unsigned long) addr;
/* Allow probe handler to find event structures */
- lttng_krp->event[EVENT_ENTRY] = &event_recorder_entry->parent;
- lttng_krp->event[EVENT_EXIT] = &event_recorder_exit->parent;
- event_recorder_entry->priv->parent.u.kretprobe.lttng_krp = lttng_krp;
- event_recorder_exit->priv->parent.u.kretprobe.lttng_krp = lttng_krp;
+ lttng_krp->event[EVENT_ENTRY] = event_entry;
+ lttng_krp->event[EVENT_EXIT] = event_exit;
+ event_entry->priv->u.kretprobe.lttng_krp = lttng_krp;
+ event_exit->priv->u.kretprobe.lttng_krp = lttng_krp;
/*
* Both events must be unregistered before the kretprobe is
name_error:
kfree(lttng_krp);
krp_error:
- kfree(event_recorder_exit->priv->parent.desc->event_name);
- kfree(event_recorder_exit->priv->parent.desc);
+ kfree(event_exit->priv->desc->event_name);
+ kfree(event_exit->priv->desc);
event_exit_error:
- kfree(event_recorder_entry->priv->parent.desc->event_name);
- kfree(event_recorder_entry->priv->parent.desc);
+ kfree(event_entry->priv->desc->event_name);
+ kfree(event_entry->priv->desc);
error:
return ret;
}
unregister_kretprobe(<tng_krp->krp);
}
-void lttng_kretprobes_unregister(struct lttng_kernel_event_recorder *event_recorder)
+void lttng_kretprobes_unregister(struct lttng_kernel_event_common *event)
{
- kref_put(&event_recorder->priv->parent.u.kretprobe.lttng_krp->kref_register,
+ kref_put(&event->priv->u.kretprobe.lttng_krp->kref_register,
_lttng_kretprobes_unregister_release);
}
EXPORT_SYMBOL_GPL(lttng_kretprobes_unregister);
kfree(lttng_krp->krp.kp.symbol_name);
}
-void lttng_kretprobes_destroy_private(struct lttng_kernel_event_recorder *event_recorder)
+void lttng_kretprobes_destroy_private(struct lttng_kernel_event_common *event)
{
- kfree(event_recorder->priv->parent.desc->event_name);
- kfree(event_recorder->priv->parent.desc);
- kref_put(&event_recorder->priv->parent.u.kretprobe.lttng_krp->kref_alloc,
+ kfree(event->priv->desc->event_name);
+ kfree(event->priv->desc);
+ kref_put(&event->priv->u.kretprobe.lttng_krp->kref_alloc,
_lttng_kretprobes_release);
}
EXPORT_SYMBOL_GPL(lttng_kretprobes_destroy_private);