From: Mathieu Desnoyers Date: Mon, 11 Mar 2013 14:09:44 +0000 (-0400) Subject: Fix: default read timer values X-Git-Tag: v2.2.0-rc1~63 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6bb9e85f440e1ee6e54105b2f2c13035039ae64d;p=lttng-tools.git Fix: default read timer values Kernel read timer value should be 200ms (200000us), not 200us. UST default read timer value should be 0 (use write() system call from applications). Signed-off-by: Mathieu Desnoyers Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index 7ebe4b16e..91be4f41c 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -49,8 +49,6 @@ struct lttng_channel *channel_new_default_attr(int dom) } chan->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; - chan->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER; - chan->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER; switch (dom) { case LTTNG_DOMAIN_KERNEL: @@ -58,6 +56,8 @@ struct lttng_channel *channel_new_default_attr(int dom) default_get_kernel_channel_subbuf_size(); chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT; + chan->attr.switch_timer_interval = DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER; + chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; break; case LTTNG_DOMAIN_UST: #if 0 @@ -68,6 +68,8 @@ struct lttng_channel *channel_new_default_attr(int dom) chan->attr.subbuf_size = default_get_ust_channel_subbuf_size(); chan->attr.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT; + chan->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; + chan->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; break; default: goto error; /* Not implemented */ diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index 48be06576..990684be9 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -272,8 +272,8 @@ struct ltt_kernel_metadata *trace_kernel_create_metadata(void) chan->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; chan->attr.subbuf_size = default_get_metadata_subbuf_size(); chan->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; - chan->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER; - chan->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER; + chan->attr.switch_timer_interval = DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER; + chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT; /* Init metadata */ diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 5e06a8452..97a9c77e8 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -412,8 +412,8 @@ struct ltt_ust_metadata *trace_ust_create_metadata(char *path) 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_CHANNEL_SWITCH_TIMER; - lum->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER; + lum->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; + lum->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; lum->attr.output = LTTNG_UST_MMAP; lum->handle = -1; diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 72887633c..225d3f86a 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -1799,8 +1799,8 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, metadata->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; metadata->attr.subbuf_size = default_get_metadata_subbuf_size(); metadata->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; - metadata->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER; - metadata->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER; + metadata->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; + metadata->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; metadata->attr.output = LTTNG_UST_MMAP; metadata->attr.type = LTTNG_UST_CHAN_METADATA; diff --git a/src/common/defaults.h b/src/common/defaults.h index 83159d7d7..fca645870 100644 --- a/src/common/defaults.h +++ b/src/common/defaults.h @@ -121,7 +121,7 @@ /* DEFAULT_CHANNEL_SUBBUF_NUM must always be a power of 2 */ #define DEFAULT_CHANNEL_SUBBUF_NUM 4 #define DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */ -#define DEFAULT_CHANNEL_READ_TIMER 200 /* usec */ +#define DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */ #define DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP #define DEFAULT_METADATA_SUBBUF_SIZE 4096 @@ -139,6 +139,10 @@ /* See lttng-kernel.h enum lttng_kernel_output for channel output */ #define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE +#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER \ + DEFAULT_CHANNEL_SWITCH_TIMER +#define DEFAULT_KERNEL_CHANNEL_READ_TIMER 200000 /* usec */ + /* User space defaults */ /* Must be a power of 2 */ @@ -148,6 +152,10 @@ /* See lttng-ust.h enum lttng_ust_output */ #define DEFAULT_UST_CHANNEL_OUTPUT LTTNG_EVENT_MMAP +#define DEFAULT_UST_CHANNEL_SWITCH_TIMER \ + DEFAULT_CHANNEL_SWITCH_TIMER +#define DEFAULT_UST_CHANNEL_READ_TIMER 0 /* usec */ + /* * Default timeout value for the sem_timedwait() call. Blocking forever is not * wanted so a timeout is used to control the data flow and not freeze the