X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Ftracepoint.c;h=d7293dab31697d94164f785b0aace9f9824da898;hb=refs%2Fheads%2Fstable-2.1;hp=a14c8b34303e43dc40be48cd3aefcd89a31c2197;hpb=2253b139ffb6a4eca7291b60083cc5206a6e128d;p=lttng-ust.git diff --git a/liblttng-ust/tracepoint.c b/liblttng-ust/tracepoint.c index a14c8b34..d7293dab 100644 --- a/liblttng-ust/tracepoint.c +++ b/liblttng-ust/tracepoint.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -37,7 +38,7 @@ #include #include "tracepoint-internal.h" -#include "ltt-tracer-core.h" +#include "lttng-tracer-core.h" #include "jhash.h" #include "error.h" @@ -77,7 +78,7 @@ static CDS_LIST_HEAD(libs); * Tracepoint hash table, containing the active tracepoints. * Protected by tracepoint mutex. */ -#define TRACEPOINT_HASH_BITS 6 +#define TRACEPOINT_HASH_BITS 12 #define TRACEPOINT_TABLE_SIZE (1 << TRACEPOINT_HASH_BITS) static struct cds_hlist_head tracepoint_table[TRACEPOINT_TABLE_SIZE]; @@ -137,13 +138,15 @@ static void debug_print_probes(struct tracepoint_entry *entry) static void * tracepoint_entry_add_probe(struct tracepoint_entry *entry, - void *probe, void *data) + void (*probe)(void), void *data) { int nr_probes = 0; struct tracepoint_probe *old, *new; - WARN_ON(!probe); - + if (!probe) { + WARN_ON(1); + return ERR_PTR(-EINVAL); + } debug_print_probes(entry); old = entry->probes; if (old) { @@ -169,8 +172,8 @@ tracepoint_entry_add_probe(struct tracepoint_entry *entry, } static void * -tracepoint_entry_remove_probe(struct tracepoint_entry *entry, void *probe, - void *data) +tracepoint_entry_remove_probe(struct tracepoint_entry *entry, + void (*probe)(void), void *data) { int nr_probes = 0, nr_del = 0, i; struct tracepoint_probe *old, *new; @@ -390,7 +393,7 @@ static void tracepoint_update_probes(void) } static struct tracepoint_probe * -tracepoint_add_probe(const char *name, void *probe, void *data, +tracepoint_add_probe(const char *name, void (*probe)(void), void *data, const char *signature) { struct tracepoint_entry *entry; @@ -417,8 +420,8 @@ tracepoint_add_probe(const char *name, void *probe, void *data, * The probe address must at least be aligned on the architecture pointer size. * Called with the tracepoint mutex held. */ -int __tracepoint_probe_register(const char *name, void *probe, void *data, - const char *signature) +int __tracepoint_probe_register(const char *name, void (*probe)(void), + void *data, const char *signature) { void *old; int ret = 0; @@ -439,7 +442,8 @@ end: return ret; } -static void *tracepoint_remove_probe(const char *name, void *probe, void *data) +static void *tracepoint_remove_probe(const char *name, void (*probe)(void), + void *data) { struct tracepoint_entry *entry; void *old; @@ -461,7 +465,8 @@ static void *tracepoint_remove_probe(const char *name, void *probe, void *data) * @probe: probe function pointer * @probe: probe data pointer */ -int __tracepoint_probe_unregister(const char *name, void *probe, void *data) +int __tracepoint_probe_unregister(const char *name, void (*probe)(void), + void *data) { void *old; int ret = 0; @@ -498,7 +503,7 @@ static void tracepoint_add_old_probes(void *old) * * caller must call tracepoint_probe_update_all() */ -int tracepoint_probe_register_noupdate(const char *name, void *probe, +int tracepoint_probe_register_noupdate(const char *name, void (*probe)(void), void *data, const char *signature) { void *old; @@ -524,7 +529,7 @@ end: * caller must call tracepoint_probe_update_all() * Called with the tracepoint mutex held. */ -int tracepoint_probe_unregister_noupdate(const char *name, void *probe, +int tracepoint_probe_unregister_noupdate(const char *name, void (*probe)(void), void *data) { void *old;