* MUST be acquired before calling this.
*/
struct ltt_ust_event *trace_ust_find_event(struct lttng_ht *ht,
- char *name, struct lttng_filter_bytecode *filter, int loglevel)
+ char *name, struct lttng_filter_bytecode *filter, int loglevel,
+ struct lttng_event_exclusion *exclusion)
{
struct lttng_ht_node_str *node;
struct lttng_ht_iter iter;
key.name = name;
key.filter = filter;
key.loglevel = loglevel;
+ key.exclusion = exclusion;
cds_lfht_lookup(ht->ht, ht->hash_fct((void *) name, lttng_ht_seed),
trace_ust_ht_match_event, &key, &iter.iter);
lus->id = session_id;
lus->start_trace = 0;
+ /* Set default metadata channel attribute. */
+ lus->metadata_attr.overwrite = DEFAULT_CHANNEL_OVERWRITE;
+ lus->metadata_attr.subbuf_size = default_get_metadata_subbuf_size();
+ lus->metadata_attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM;
+ lus->metadata_attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER;
+ lus->metadata_attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER;
+ lus->metadata_attr.output = LTTNG_UST_MMAP;
+
/*
* Default buffer type. This can be changed through an enable channel
* requesting a different type. Note that this can only be changed once
* Return pointer to structure or NULL.
*/
struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev,
+ char *filter_expression,
struct lttng_filter_bytecode *filter,
struct lttng_event_exclusion *exclusion)
{
}
/* Same layout. */
+ lue->filter_expression = filter_expression;
lue->filter = (struct lttng_ust_filter_bytecode *) filter;
lue->exclusion = (struct lttng_event_exclusion *) exclusion;
return NULL;
}
-/*
- * Allocate and initialize a ust metadata.
- *
- * Return pointer to structure or NULL.
- */
-struct ltt_ust_metadata *trace_ust_create_metadata(char *path)
-{
- int ret;
- struct ltt_ust_metadata *lum;
-
- assert(path);
-
- lum = zmalloc(sizeof(struct ltt_ust_metadata));
- if (lum == NULL) {
- PERROR("ust metadata zmalloc");
- goto error;
- }
-
- /* Set default attributes */
- lum->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE;
- lum->attr.subbuf_size = default_get_metadata_subbuf_size();
- lum->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM;
- lum->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER;
- lum->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER;
- lum->attr.output = LTTNG_UST_MMAP;
-
- lum->handle = -1;
- /* Set metadata trace path */
- ret = snprintf(lum->pathname, PATH_MAX, "%s/" DEFAULT_METADATA_NAME, path);
- if (ret < 0) {
- PERROR("asprintf ust metadata");
- goto error_free_metadata;
- }
-
- return lum;
-
-error_free_metadata:
- free(lum);
-error:
- return NULL;
-}
-
/*
* Allocate and initialize an UST context.
*
assert(event);
DBG2("Trace destroy UST event %s", event->attr.name);
+ free(event->filter_expression);
free(event->filter);
+ free(event->exclusion);
free(event);
}
assert(!ret);
}
-/*
- * Cleanup ust metadata structure.
- */
-void trace_ust_destroy_metadata(struct ltt_ust_metadata *metadata)
-{
- assert(metadata);
-
- if (!metadata->handle) {
- return;
- }
- DBG2("Trace UST destroy metadata %d", metadata->handle);
- free(metadata);
-}
-
/*
* Iterate over a hash table containing channels and cleanup safely.
*/