#include <ust/tracepoint.h>
#include <ust/core.h>
#include <ust/kcompat/kcompat.h>
-#include "usterr.h"
+#include "usterr_signal_safe.h"
#define _LGPL_SOURCE
#include <urcu-bp.h>
* is used.
*/
rcu_assign_pointer(elem->probes, (*entry)->probes);
- elem->state__imv = active;
+ elem->state = active;
}
/*
*/
static void disable_tracepoint(struct tracepoint *elem)
{
- elem->state__imv = 0;
+ elem->state = 0;
rcu_assign_pointer(elem->probes, NULL);
}
pthread_mutex_lock(&tracepoints_mutex);
for (iter = begin; iter < end; iter++) {
+ if (!*iter)
+ continue; /* skip dummy */
if (!(*iter)->name) {
disable_tracepoint(*iter);
continue;
//ust// __stop___tracepoints);
/* tracepoints in modules. */
lib_update_tracepoints();
- /* Update immediate values */
- core_imv_update();
-//ust// module_imv_update();
}
static struct probe *
int tracepoint_get_iter_range(struct tracepoint * const **tracepoint,
struct tracepoint * const *begin, struct tracepoint * const *end)
{
- if (!*tracepoint && begin != end) {
+ if (!*tracepoint && begin != end)
*tracepoint = begin;
- return 1;
+ while (*tracepoint >= begin && *tracepoint < end) {
+ if (!**tracepoint)
+ (*tracepoint)++; /* skip dummy */
+ else
+ return 1;
}
- if (*tracepoint >= begin && *tracepoint < end)
- return 1;
return 0;
}
//ust// EXPORT_SYMBOL_GPL(tracepoint_get_iter_range);
{
if (new_tracepoint_cb) {
struct tracepoint * const *t;
- for(t=start; t < end; t++) {
- new_tracepoint_cb(*t);
+
+ for(t = start; t < end; t++) {
+ if (*t)
+ new_tracepoint_cb(*t);
}
}
}
/* FIXME: update just the loaded lib */
lib_update_tracepoints();
- DBG("just registered a tracepoints section from %p and having %d tracepoints", tracepoints_start, tracepoints_count);
+ /* tracepoints_count - 1: skip dummy */
+ DBG("just registered a tracepoints section from %p and having %d tracepoints (minus dummy tracepoints)", tracepoints_start, tracepoints_count);
return 0;
}