const struct lttng_event_ctx *ctx; /* context */
const struct lttng_event_field *fields; /* event payload */
unsigned int nr_fields;
+ struct module *owner;
};
struct lttng_probe_desc {
return NULL;
}
-/*
- * TODO: registration of probe descriptions in dynamically allocated memory (not
- * directly in a module memory) will require some care for refcounting: it's
- * currently done by just refcounting the module in event_get/put.
- */
int ltt_probe_register(struct lttng_probe_desc *desc)
{
int ret = 0;
mutex_unlock(&probe_mutex);
if (!event)
return NULL;
- ret = try_module_get(__module_text_address((unsigned long) event));
+ ret = try_module_get(event->owner);
WARN_ON_ONCE(!ret);
return event;
}
void ltt_event_put(const struct lttng_event_desc *event)
{
- module_put(__module_text_address((unsigned long) event));
+ module_put(event->owner);
}
EXPORT_SYMBOL_GPL(ltt_event_put);
.name = #_name, \
.probe_callback = (void *) &__event_probe__##_template,\
.nr_fields = ARRAY_SIZE(__event_fields___##_template), \
+ .owner = THIS_MODULE, \
},
#define TP_ID1(_token, _system) _token##_system
fields[1].type.u.basic.integer.base = 16;
fields[1].type.u.basic.integer.encoding = lttng_encode_none;
+ desc->owner = THIS_MODULE;
event->desc = desc;
return 0;
field->type.u.basic.integer.reverse_byte_order = 0;
field->type.u.basic.integer.base = 16;
field->type.u.basic.integer.encoding = lttng_encode_none;
+ desc->owner = THIS_MODULE;
event->desc = desc;
return 0;