{
struct cds_hlist_head *head;
struct ust_pending_probe *e;
- size_t name_len = strlen(name) + 1;
- uint32_t hash = jhash(name, name_len - 1, 0);
+ size_t name_len = strlen(name);
+ uint32_t hash;
+ if (name_len > LTTNG_UST_SYM_NAME_LEN - 1) {
+ WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN - 1);
+ name_len = LTTNG_UST_SYM_NAME_LEN - 1;
+ }
+ hash = jhash(name, name_len, 0);
head = &pending_probe_table[hash & (PENDING_PROBE_HASH_SIZE - 1)];
e = zmalloc(sizeof(struct ust_pending_probe) + name_len);
if (!e)
return -ENOMEM;
- memcpy(&e->name[0], name, name_len);
+ memcpy(&e->name[0], name, name_len + 1);
+ e->name[name_len] = '\0';
cds_hlist_add_head(&e->node, head);
e->event = event;
event->pending_probe = e;
struct cds_hlist_node *node, *p;
struct ust_pending_probe *e;
const char *name = desc->name;
- size_t name_len = strlen(name) + 1;
- uint32_t hash = jhash(name, name_len - 1, 0);
int ret = 0;
struct lttng_ust_event event_param;
+ size_t name_len = strlen(name);
+ uint32_t hash;
/*
* For this event, we need to lookup the loglevel. If active (in
}
}
+ if (name_len > LTTNG_UST_SYM_NAME_LEN - 1) {
+ WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name, LTTNG_UST_SYM_NAME_LEN - 1);
+ name_len = LTTNG_UST_SYM_NAME_LEN - 1;
+ }
+ hash = jhash(name, name_len, 0);
head = &pending_probe_table[hash & (PENDING_PROBE_HASH_SIZE - 1)];
cds_hlist_for_each_entry_safe(e, node, p, head, node) {
struct ltt_event *event;
struct ltt_channel *chan;
- if (strcmp(name, e->name))
+ if (strncmp(name, e->name, LTTNG_UST_SYM_NAME_LEN - 1))
continue;
event = e->event;
chan = event->chan;
cds_list_for_each_entry(chan, &session->chan, list) {
if (chan->header_type)
continue; /* don't change it if session stop/restart */
+ /*
+ * Because we don't use any timer in the application, we
+ * currently cannot guarantee that we have frequent
+ * events that let us detect 27-bit overflows.
+ * Therefore, for now, we force large event headers,
+ * which contain 64-bit timestamps.
+ */
+ chan->header_type = 2; /* large */
+#if 0
if (chan->free_event_id < 31)
chan->header_type = 1; /* compact */
else
chan->header_type = 2; /* large */
+#endif //0
}
CMM_ACCESS_ONCE(session->active) = 1;
size_t subbuf_size, size_t num_subbuf,
unsigned int switch_timer_interval,
unsigned int read_timer_interval,
- int *shm_fd, int *wait_fd,
- uint64_t *memory_map_size,
+ int **shm_fd, int **wait_fd,
+ uint64_t **memory_map_size,
struct ltt_channel *chan_priv_init)
{
struct ltt_channel *chan = NULL;
* creation). Might require a hash if we have lots of events.
*/
cds_list_for_each_entry(event, &chan->session->events, list) {
- if (event->desc && !strcmp(event->desc->name, event_param->name)) {
+ if (event->desc && !strncmp(event->desc->name,
+ event_param->name,
+ LTTNG_UST_SYM_NAME_LEN - 1)) {
ret = -EEXIST;
goto exist;
}