From 993016f83d9e868d655c0a76a753a4e955aa0ae9 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 29 Nov 2012 12:57:10 -0500 Subject: [PATCH] Use the new functions for default subbuf sizes commit 3e230f922d67f7a47b66631f7a8cf458002b3727 upstream. Use the functions added by the previous commit. All the occurences of the previous defines were replaced. [ Edit by Christian Babeux: Changes to tests/tools/Makefile.am were not applied because this file is not present in the stable 2.0 branch. Also added the relevant *_LDADD = $(top_builddir)/src/common/libcommon.la to the differents Makefile.am where the new functions are used. ] Signed-off-by: Simon Marchi Signed-off-by: David Goulet Signed-off-by: Christian Babeux --- src/bin/lttng-sessiond/channel.c | 5 +++-- src/bin/lttng-sessiond/trace-kernel.c | 2 +- src/bin/lttng-sessiond/trace-ust.c | 2 +- src/bin/lttng/Makefile.am | 3 ++- src/bin/lttng/commands/enable_channels.c | 6 +++--- src/lib/lttng-ctl/Makefile.am | 4 +++- src/lib/lttng-ctl/lttng-ctl.c | 4 ++-- tests/Makefile.am | 5 +++++ tests/test_kernel_data_trace.c | 2 +- tests/test_ust_data_trace.c | 2 +- 10 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index 4ec12302b..f45f9ccd5 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 293ca381b..3df39ecab 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -253,7 +253,7 @@ struct ltt_kernel_metadata *trace_kernel_create_metadata(char *path) /* 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 ed635f960..97ef1708d 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -285,7 +285,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/Makefile.am b/src/bin/lttng/Makefile.am index e2040d8c3..c80fe5160 100644 --- a/src/bin/lttng/Makefile.am +++ b/src/bin/lttng/Makefile.am @@ -11,4 +11,5 @@ lttng_SOURCES = command.h conf.c conf.h commands/start.c \ commands/calibrate.c commands/view.c \ utils.c utils.h lttng.c -lttng_LDADD = $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la +lttng_LDADD = $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ + $(top_builddir)/src/common/libcommon.la diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index 9b5f8d64d..3ad2baff7 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -102,9 +102,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/Makefile.am b/src/lib/lttng-ctl/Makefile.am index 6bc5432aa..f8f520373 100644 --- a/src/lib/lttng-ctl/Makefile.am +++ b/src/lib/lttng-ctl/Makefile.am @@ -3,4 +3,6 @@ lib_LTLIBRARIES = liblttng-ctl.la liblttng_ctl_la_SOURCES = lttng-ctl.c liblttng_ctl_la_LIBADD = \ - $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la + $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ + $(top_builddir)/src/common/libcommon.la \ + $(top_builddir)/src/common/hashtable/libhashtable.la diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 356fb34c4..cfb0f43b3 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -898,7 +898,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; @@ -912,7 +912,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/Makefile.am b/tests/Makefile.am index cc6d9ff27..af51dc88a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -19,10 +19,13 @@ test_sessions_LDADD = $(top_builddir)/src/common/libcommon.la \ $(top_builddir)/src/common/hashtable/libhashtable.la test_kernel_data_trace_SOURCES = test_kernel_data_trace.c $(UTILS) $(KERN_DATA_TRACE) +test_kernel_data_trace_LDADD = $(top_builddir)/src/common/libcommon.la kernel_all_events_basic_SOURCES = lttng/kernel_all_events_basic.c $(UTILS) $(LIBLTTNG) +kernel_all_events_basic_LDADD = $(top_builddir)/src/common/libcommon.la kernel_event_basic_SOURCES = lttng/kernel_event_basic.c $(UTILS) $(LIBLTTNG) +kernel_event_basic_LDADD = $(top_builddir)/src/common/libcommon.la if HAVE_LIBLTTNG_UST_CTL SUBDIRS += ust-nevents ust-nprocesses @@ -36,8 +39,10 @@ test_ust_data_trace_LDADD = $(top_builddir)/src/common/libcommon.la \ $(top_builddir)/src/common/hashtable/libhashtable.la ust_global_all_events_basic_SOURCES = lttng/ust_global_all_events_basic.c $(UTILS) $(LIBLTTNG) +ust_global_all_events_basic_LDADD = $(top_builddir)/src/common/libcommon.la ust_global_event_basic_SOURCES = lttng/ust_global_event_basic.c $(UTILS) $(LIBLTTNG) +ust_global_event_basic_LDADD = $(top_builddir)/src/common/libcommon.la endif # HAVE_LIBLTTNG_UST_CTL check-am: diff --git a/tests/test_kernel_data_trace.c b/tests/test_kernel_data_trace.c index 6d7f291be..045f2a5cc 100644 --- a/tests/test_kernel_data_trace.c +++ b/tests/test_kernel_data_trace.c @@ -101,7 +101,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/test_ust_data_trace.c b/tests/test_ust_data_trace.c index 459520db1..69a73b2f2 100644 --- a/tests/test_ust_data_trace.c +++ b/tests/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 -- 2.34.1