Hi Max,
On Mon, Oct 13, 2014 at 09:01:50PM +0200, ☎ wrote:
> Attached is a 2nd patch - it completely disables sqlite, all the configuration for
> osmo-trx is supplied through command-line options. This makes troubleshooting easier
> because now we have single source of truth: all the defaults are in one place.
Thanks for looking into this. I agree that the sqlite configuration should be
removed because it only causes confusion at this point. The original intention
was to have backwards compatibility with OpenBTS-style sqlite options, but the
number of users of that approach is approximately -1.
Logging is the other concern. Have you tried removing the configuration
table entirely? The existing queries are rarely, if ever, used. Without
sqlite, the table shouldn't exist at all.
Some general comments. Please remove code when you intend to remove it -
committing commented out lines makes code and the patch difficult to read.
Git will track the changes. Pull requests work well for large commits,
such as sqlite3.c removal.
> diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
> index 9215fa5..16ac7b9 100644
> --- a/Transceiver52M/osmo-trx.cpp
> +++ b/Transceiver52M/osmo-trx.cpp
> -
> +volatile bool gshutdown = false; // FIXME: what the ... is that for?
The shutdown variable is a relic from OpenBTS, and exists because of
the mess involving threads and shutdown. That issue is unrelated to logging or
sqlite.
> - refstr = config->extref ? "Enabled" : "Disabled";
> - fillstr = config->filler ? "Enabled" : "Disabled";
> - divstr = config->diversity ? "Enabled" : "Disabled";
> -
> std::ostringstream ost("");
> ost << "Config Settings" << std::endl;
> ost << " Log Level............... " << config->log_level << std::endl;
> @@ -176,9 +96,9 @@ bool trx_setup_config(struct trx_config *config)
> ost << " TRX Address............. " << config->addr << std::endl;
> ost << " Channels................ " << config->chans << std::endl;
> ost << " Samples-per-Symbol...... " << config->sps << std::endl;
> - ost << " External Reference...... " << refstr << std::endl;
> - ost << " C0 Filler Table......... " << fillstr << std::endl;
> - ost << " Diversity............... " << divstr << std::endl;
> + ost << " External Reference...... " << (config->extref ? "Enabled" : "Disabled") << std::endl;
> + ost << " C0 Filler Table......... " << (config->filler ? "Enabled" : "Disabled") << std::endl;
> + ost << " Diversity............... " << (config->diversity ? "Enabled" : "Disabled") << std::endl;
> ost << " Tuning offset........... " << config->offset << std::endl;
> std::cout << ost << std::endl;
Please put whitespace / formatting changes in a separate patch. Osmocom
projects generally use kernel style, which becomes somewhat odd and less
strict in the context of C++. In this case, the code change is fine, but don't
add it to an already massive patch.
-TT
"--disable-talloc" had the effect of a "--enable-system-talloc".
So the first patch fixes up all the link failures by adding -ltalloc
where needed, _for the case that one decides to use disable-talloc_.
Second patch will use pkg-config to determine the parameters for
a system talloc. These will be used unconditionally, because the
variables TALLOC_CFLAGS/TALLOC_LIBS will be empty when using the
bundled talloc.
===
The following changes since commit c60de4f35f3f73f3d79b4ff61d0a20b92f818702:
build: fix linker error with kasumi_test (2014-10-03 08:48:31 +0200)
are available in the git repository at:
git://git.inai.de/libosmocore HEAD
for you to fetch changes up to d6c1607a724a07416c7d39f9b43f7af7349de666:
build: default to system-provided talloc (2014-10-03 12:43:25 +0200)
----------------------------------------------------------------
Jan Engelhardt (3):
build: resolve link failure in libosmogsm when --disable-talloc is used
build: allow using a system-provided talloc properly
build: default to system-provided talloc
.gitignore | 1 +
configure.ac | 26 +++++++++++++++++++------
include/Makefile.am | 5 +++--
include/osmocom/core/talloc.h.in | 6 ++++++
include/osmocom/core/{talloc.h => talloc_int.h} | 0
src/Makefile.am | 7 ++++---
src/gsm/Makefile.am | 5 +++--
tests/Makefile.am | 12 ++++++------
tests/msgfile/msgfile_test.c | 1 +
9 files changed, 44 insertions(+), 19 deletions(-)
create mode 100644 include/osmocom/core/talloc.h.in
rename include/osmocom/core/{talloc.h => talloc_int.h} (100%)