Fix: liblttng-ust-fork Makefile flags mismatch
[lttng-ust.git] / liblttng-ust / tracepoint.c
index a93f286364550e1cf29a3388fa2f5b4a09d5adbf..d7293dab31697d94164f785b0aace9f9824da898 100644 (file)
@@ -38,7 +38,7 @@
 #include <helper.h>
 
 #include "tracepoint-internal.h"
-#include "ltt-tracer-core.h"
+#include "lttng-tracer-core.h"
 #include "jhash.h"
 #include "error.h"
 
@@ -78,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];
 
@@ -138,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) {
@@ -170,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;
@@ -391,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;
@@ -418,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;
@@ -440,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;
@@ -462,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;
@@ -499,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;
@@ -525,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;
This page took 0.025523 seconds and 4 git commands to generate.