projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle refcount of modules having dynamically alloc event description
[lttng-modules.git]
/
ltt-probes.c
diff --git
a/ltt-probes.c
b/ltt-probes.c
index ad7f7c2b5a539ce46516b81270f5315b3823a593..0efc23c5c61b749c996783f604c26a537d822416 100644
(file)
--- a/
ltt-probes.c
+++ b/
ltt-probes.c
@@
-30,11
+30,6
@@
const struct lttng_event_desc *find_event(const char *name)
return NULL;
}
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;
int ltt_probe_register(struct lttng_probe_desc *desc)
{
int ret = 0;
@@
-76,7
+71,7
@@
const struct lttng_event_desc *ltt_event_get(const char *name)
mutex_unlock(&probe_mutex);
if (!event)
return NULL;
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;
}
WARN_ON_ONCE(!ret);
return event;
}
@@
-84,6
+79,6
@@
EXPORT_SYMBOL_GPL(ltt_event_get);
void ltt_event_put(const struct lttng_event_desc *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);
}
EXPORT_SYMBOL_GPL(ltt_event_put);
This page took
0.023628 seconds
and
4
git commands to generate.