#include <errno.h>
-#include "kernelcompat.h"
-#include "tracepoint.h"
+#include <ust/kernelcompat.h>
+#include <ust/tracepoint.h>
#include "usterr.h"
//#include "list.h"
#define _LGPL_SOURCE
-#include <urcu.h>
+#include <urcu-bp.h>
//extern struct tracepoint __start___tracepoints[] __attribute__((visibility("hidden")));
//extern struct tracepoint __stop___tracepoints[] __attribute__((visibility("hidden")));
static inline void *allocate_probes(int count)
{
- struct tp_probes *p = kmalloc(count * sizeof(void *)
- + sizeof(struct tp_probes), GFP_KERNEL);
+ struct tp_probes *p = malloc(count * sizeof(void *)
+ + sizeof(struct tp_probes));
return p == NULL ? NULL : p->probes;
}
struct tp_probes, probes[0]);
//ust// call_rcu_sched(&tp_probes->u.rcu, rcu_free_old_probes);
synchronize_rcu();
- kfree(tp_probes);
+ free(tp_probes);
}
}
return;
for (i = 0; entry->funcs[i]; i++)
- printk(KERN_DEBUG "Probe %d : %p\n", i, entry->funcs[i]);
+ DBG("Probe %d : %p", i, entry->funcs[i]);
}
static void *
head = &tracepoint_table[hash & (TRACEPOINT_TABLE_SIZE - 1)];
hlist_for_each_entry(e, node, head, hlist) {
if (!strcmp(name, e->name)) {
- printk(KERN_NOTICE
- "tracepoint %s busy\n", name);
+ DBG("tracepoint %s busy", name);
return ERR_PTR(-EEXIST); /* Already there */
}
}
* Using kmalloc here to allocate a variable length element. Could
* cause some memory fragmentation if overused.
*/
- e = kmalloc(sizeof(struct tracepoint_entry) + name_len, GFP_KERNEL);
+ e = malloc(sizeof(struct tracepoint_entry) + name_len);
if (!e)
return ERR_PTR(-ENOMEM);
memcpy(&e->name[0], name, name_len);
static inline void remove_tracepoint(struct tracepoint_entry *e)
{
hlist_del(&e->hlist);
- kfree(e);
+ free(e);
}
/*
list_del(&pos->u.list);
//ust// call_rcu_sched(&pos->u.rcu, rcu_free_old_probes);
synchronize_rcu();
- kfree(pos);
+ free(pos);
}
}
//ust// EXPORT_SYMBOL_GPL(tracepoint_probe_update_all);