From: JP Ikaheimonen Date: Mon, 4 Nov 2013 13:08:59 +0000 (+0200) Subject: Add exclusion data to trace_ust_create_event X-Git-Tag: v2.4.0-rc1~36 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=561c68970ca461ccf8451aee47efc29da20ad8f1;p=lttng-tools.git Add exclusion data to trace_ust_create_event Add exclusion data to the prototype of trace_ust_create_event Copy exclusion data to the newly created ltt_ust_event structure Call trace_ust_create_event with exclusion data, wherever possible --- diff --git a/src/bin/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c index 791251e7d..8be9fc6c4 100644 --- a/src/bin/lttng-sessiond/event.c +++ b/src/bin/lttng-sessiond/event.c @@ -364,7 +364,7 @@ int event_ust_enable_all_tracepoints(struct ltt_ust_session *usess, } /* Create ust event */ - uevent = trace_ust_create_event(&events[i], filter); + uevent = trace_ust_create_event(&events[i], filter, NULL); if (uevent == NULL) { ret = LTTNG_ERR_FATAL; goto error_destroy; @@ -423,7 +423,7 @@ int event_ust_enable_tracepoint(struct ltt_ust_session *usess, uevent = trace_ust_find_event(uchan->events, event->name, filter, event->loglevel); if (uevent == NULL) { - uevent = trace_ust_create_event(event, filter); + uevent = trace_ust_create_event(event, filter, exclusion); if (uevent == NULL) { ret = LTTNG_ERR_UST_ENABLE_FAIL; goto error; diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index c0fc3a025..21197171c 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -330,7 +330,8 @@ error: * Return pointer to structure or NULL. */ struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev, - struct lttng_filter_bytecode *filter) + struct lttng_filter_bytecode *filter, + struct lttng_event_exclusion *exclusion) { struct ltt_ust_event *lue; @@ -384,6 +385,7 @@ struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev, /* Same layout. */ lue->filter = (struct lttng_ust_filter_bytecode *) filter; + lue->exclusion = (struct lttng_event_exclusion *) exclusion; /* Init node */ lttng_ht_node_init_str(&lue->node, lue->attr.name); diff --git a/src/bin/lttng-sessiond/trace-ust.h b/src/bin/lttng-sessiond/trace-ust.h index 06d0202d1..9d2b4571a 100644 --- a/src/bin/lttng-sessiond/trace-ust.h +++ b/src/bin/lttng-sessiond/trace-ust.h @@ -167,7 +167,8 @@ struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht, struct ltt_ust_session *trace_ust_create_session(uint64_t session_id); struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *attr); struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev, - struct lttng_filter_bytecode *filter); + struct lttng_filter_bytecode *filter, + struct lttng_event_exclusion *exclusion); struct ltt_ust_metadata *trace_ust_create_metadata(char *path); struct ltt_ust_context *trace_ust_create_context( struct lttng_event_context *ctx); @@ -214,7 +215,8 @@ struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *attr) } static inline struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev, - struct lttng_filter_bytecode *filter) + struct lttng_filter_bytecode *filter, + struct lttng_event_exclusion *exclusion) { return NULL; } diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c index ae8b1232a..7c48c5cb3 100644 --- a/tests/unit/test_ust_data.c +++ b/tests/unit/test_ust_data.c @@ -151,7 +151,7 @@ static void test_create_ust_event(void) ev.type = LTTNG_EVENT_TRACEPOINT; ev.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL; - event = trace_ust_create_event(&ev, NULL); + event = trace_ust_create_event(&ev, NULL, NULL); ok(event != NULL, "Create UST event");