struct cds_lfht_iter iter;
rcu_read_lock();
- node = hashtable_lookup(ht, (void *) name, strlen(name), &iter);
+ node = hashtable_lookup(ht, (void *)name, strlen(name), &iter);
if (node == NULL) {
rcu_read_unlock();
goto error;
}
/* Init data structure */
- lus->consumer_fds_sent = 0;
lus->uid = uid;
lus->start_trace = 0;
}
/* Copy channel name */
- strncpy(luc->name, chan->name, sizeof(&luc->name));
+ strncpy(luc->name, chan->name, sizeof(luc->name));
luc->name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0';
/* Init node */
hashtable_node_init(&luc->node, (void *) luc->name, strlen(luc->name));
/* Alloc hash tables */
luc->events = hashtable_new_str(0);
- luc->ctx = hashtable_new_str(0);
+ luc->ctx = hashtable_new(0);
/* Set trace output path */
ret = snprintf(luc->pathname, PATH_MAX, "%s", path);
case LTTNG_EVENT_TRACEPOINT:
lue->attr.instrumentation = LTTNG_UST_TRACEPOINT;
break;
+ case LTTNG_EVENT_TRACEPOINT_LOGLEVEL:
+ lue->attr.instrumentation = LTTNG_UST_TRACEPOINT_LOGLEVEL;
+ break;
default:
ERR("Unknown ust instrumentation type (%d)", ev->type);
goto error_free_event;
hashtable_node_init(&lue->node, (void *) lue->attr.name,
strlen(lue->attr.name));
/* Alloc context hash tables */
- lue->ctx = hashtable_new_str(0);
+ lue->ctx = hashtable_new(0);
DBG2("Trace UST event %s created", lue->attr.name);
return NULL;
}
+/*
+ * Allocate and initialize an UST context.
+ *
+ * Return pointer to structure or NULL.
+ */
+struct ltt_ust_context *trace_ust_create_context(
+ struct lttng_event_context *ctx)
+{
+ struct ltt_ust_context *uctx;
+
+ uctx = zmalloc(sizeof(struct ltt_ust_context));
+ if (uctx == NULL) {
+ PERROR("zmalloc ltt_ust_context");
+ goto error;
+ }
+
+ uctx->ctx.ctx = ctx->ctx;
+ hashtable_node_init(&uctx->node, (void *)((unsigned long) uctx->ctx.ctx),
+ sizeof(void *));
+
+ return uctx;
+
+error:
+ return NULL;
+}
+
/*
* RCU safe free context structure.
*/