From: David Goulet Date: Tue, 22 Jan 2013 19:09:21 +0000 (-0500) Subject: Remove UST abi cast on channel attribute X-Git-Tag: v2.2.0-rc1~94 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=2fe6e7f5adf0d6a84f0497e1006b3ae59f034805;hp=2223c96f0eecce28fe221eb19de4333156492337;p=lttng-tools.git Remove UST abi cast on channel attribute This clears out a TODO in the code. Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index f6f2c64ae..9e6d81f2a 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -367,7 +367,13 @@ struct ust_app_channel *alloc_ust_app_channel(char *name, /* Copy attributes */ if (attr) { - memcpy(&ua_chan->attr, attr, sizeof(ua_chan->attr)); + /* Translate from lttng_ust_channel to lttng_ust_channel_attr.*/ + ua_chan->attr.subbuf_size = attr->subbuf_size; + ua_chan->attr.num_subbuf = attr->num_subbuf; + ua_chan->attr.overwrite = attr->overwrite; + ua_chan->attr.switch_timer_interval = attr->switch_timer_interval; + ua_chan->attr.read_timer_interval = attr->read_timer_interval; + ua_chan->attr.output = attr->output; } DBG3("UST app channel %s allocated", ua_chan->name); @@ -841,8 +847,6 @@ static int create_ust_channel(struct ust_app *app, health_code_update(&health_thread_cmd); - /* TODO: remove cast and use lttng-ust-abi.h */ - /* We are going to receive 2 fds, we need to reserve them. */ ret = lttng_fd_get(LTTNG_FD_APPS, 2); if (ret < 0) { @@ -852,8 +856,8 @@ static int create_ust_channel(struct ust_app *app, health_code_update(&health_thread_cmd); - ret = ustctl_create_channel(app->sock, ua_sess->handle, - (struct lttng_ust_channel_attr *)&ua_chan->attr, &ua_chan->obj); + ret = ustctl_create_channel(app->sock, ua_sess->handle, &ua_chan->attr, + &ua_chan->obj); if (ret < 0) { ERR("Creating channel %s for app (pid: %d, sock: %d) " "and session handle %d with ret %d", diff --git a/src/bin/lttng-sessiond/ust-app.h b/src/bin/lttng-sessiond/ust-app.h index d4ed5a6f8..1d774a7b9 100644 --- a/src/bin/lttng-sessiond/ust-app.h +++ b/src/bin/lttng-sessiond/ust-app.h @@ -102,7 +102,7 @@ struct ust_app_channel { int enabled; int handle; char name[LTTNG_UST_SYM_NAME_LEN]; - struct lttng_ust_channel attr; + struct lttng_ust_channel_attr attr; struct lttng_ust_object_data *obj; struct ust_app_stream_list streams; struct lttng_ht *ctx;