From: Simon Marchi Date: Tue, 13 Nov 2012 19:28:43 +0000 (-0500) Subject: Use the new functions for default subbuf sizes X-Git-Tag: v2.1.0-rc8~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3e230f922d67f7a47b66631f7a8cf458002b3727;p=lttng-tools.git Use the new functions for default subbuf sizes Use the functions added by the previous commit. All the occurences of the previous defines were replaced. Signed-off-by: Simon Marchi Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index 8b9adfba8..d07e1d901 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -54,7 +54,8 @@ struct lttng_channel *channel_new_default_attr(int dom) switch (dom) { case LTTNG_DOMAIN_KERNEL: - chan->attr.subbuf_size = DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE; + chan->attr.subbuf_size = + default_get_kernel_channel_subbuf_size(); chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT; break; @@ -64,7 +65,7 @@ struct lttng_channel *channel_new_default_attr(int dom) case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: case LTTNG_DOMAIN_UST_EXEC_NAME: #endif - chan->attr.subbuf_size = DEFAULT_UST_CHANNEL_SUBBUF_SIZE; + 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; break; diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index 7748b891f..4d2870add 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -272,7 +272,7 @@ struct ltt_kernel_metadata *trace_kernel_create_metadata(void) /* Set default attributes */ chan->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; - chan->attr.subbuf_size = DEFAULT_METADATA_SUBBUF_SIZE; + 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; diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 864a4b0d1..2dcc7c25d 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -311,7 +311,7 @@ struct ltt_ust_metadata *trace_ust_create_metadata(char *path) /* Set default attributes */ lum->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; - lum->attr.subbuf_size = DEFAULT_METADATA_SUBBUF_SIZE; + 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; diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index 18574775b..d9a3b022d 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -101,9 +101,9 @@ static void usage(FILE *ofp) fprintf(ofp, " --overwrite Flight recorder mode%s\n", DEFAULT_CHANNEL_OVERWRITE ? " (default)" : ""); fprintf(ofp, " --subbuf-size SIZE Subbuffer size in bytes\n"); - fprintf(ofp, " (default: %u, kernel default: %u)\n", - DEFAULT_CHANNEL_SUBBUF_SIZE, - DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE); + fprintf(ofp, " (default: %zu, kernel default: %zu)\n", + default_get_channel_subbuf_size(), + default_get_kernel_channel_subbuf_size()); fprintf(ofp, " Needs to be a power of 2 for\n"); fprintf(ofp, " kernel and ust tracers\n"); fprintf(ofp, " --num-subbuf NUM Number of subbufers\n"); diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 46338fb85..20bb8c6fa 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1344,7 +1344,7 @@ void lttng_channel_set_default_attr(struct lttng_domain *domain, attr->switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER; attr->read_timer_interval = DEFAULT_CHANNEL_READ_TIMER; - attr->subbuf_size = DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE; + attr->subbuf_size = default_get_kernel_channel_subbuf_size(); attr->num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; attr->output = DEFAULT_KERNEL_CHANNEL_OUTPUT; break; @@ -1358,7 +1358,7 @@ void lttng_channel_set_default_attr(struct lttng_domain *domain, attr->switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER; attr->read_timer_interval = DEFAULT_CHANNEL_READ_TIMER; - attr->subbuf_size = DEFAULT_UST_CHANNEL_SUBBUF_SIZE; + attr->subbuf_size = default_get_ust_channel_subbuf_size(); attr->num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; attr->output = DEFAULT_UST_CHANNEL_OUTPUT; break; diff --git a/tests/tools/Makefile.am b/tests/tools/Makefile.am index cd7ff3292..4fe494cec 100644 --- a/tests/tools/Makefile.am +++ b/tests/tools/Makefile.am @@ -27,7 +27,7 @@ test_sessions_LDADD = $(COMMON) $(HASHTABLE) $(SESSIOND_COMM) # Kernel trace data unit tests test_kernel_data_trace_SOURCES = test_kernel_data_trace.c $(UTILS) $(KERN_DATA_TRACE) -test_kernel_data_trace_LDADD = $(SESSIOND_COMM) $(HASHTABLE) +test_kernel_data_trace_LDADD = $(COMMON) $(SESSIOND_COMM) $(HASHTABLE) if HAVE_LIBLTTNG_UST_CTL noinst_PROGRAMS += test_ust_data_trace diff --git a/tests/tools/test_kernel_data_trace.c b/tests/tools/test_kernel_data_trace.c index c49d7ce54..1edd20d6e 100644 --- a/tests/tools/test_kernel_data_trace.c +++ b/tests/tools/test_kernel_data_trace.c @@ -99,7 +99,7 @@ static void create_kernel_metadata(void) assert(kern->metadata->conf->attr.overwrite == DEFAULT_CHANNEL_OVERWRITE); assert(kern->metadata->conf->attr.subbuf_size - == DEFAULT_METADATA_SUBBUF_SIZE); + == default_get_metadata_subbuf_size()); assert(kern->metadata->conf->attr.num_subbuf == DEFAULT_METADATA_SUBBUF_NUM); assert(kern->metadata->conf->attr.switch_timer_interval diff --git a/tests/tools/test_ust_data_trace.c b/tests/tools/test_ust_data_trace.c index 459520db1..69a73b2f2 100644 --- a/tests/tools/test_ust_data_trace.c +++ b/tests/tools/test_ust_data_trace.c @@ -107,7 +107,7 @@ static void create_ust_metadata(void) assert(metadata->attr.overwrite == DEFAULT_CHANNEL_OVERWRITE); assert(metadata->attr.subbuf_size - == DEFAULT_METADATA_SUBBUF_SIZE); + == default_get_metadata_subbuf_size()); assert(metadata->attr.num_subbuf == DEFAULT_METADATA_SUBBUF_NUM); assert(metadata->attr.switch_timer_interval