Commit Graph

8 Commits

Author SHA1 Message Date
Vasil Velichkov 499510bd52 Add code coverage support
The coverage report shows what code is covered by tests and what is not
and the ratio could be tracked over time. These reports will allow us
to identify code that is not being tested and improve the test suites.

To enable the reports configure with --enable-code-coverage and execute
"make check-code-coverage". The HTML report will be generated in a
subdirectory with name libosmocore-$(PACKAGE_VERSION)-coverage/index.html

The report is generated using gcov, lcov and lcov_cobertura tools and
the OSMO_AC_CODE_COVERAGE macro. The osmo_ax_code_coverage.m4 is a copy of
ax_code_coverage.m4 taken from autoconf-archive v2018.03.13. It was
copied to avoid the additional external dependency and renamed to avoid
overwriting it in case autoconf-archive is already installed as we are
going to install it in $(datadir)/aclocal in order to be reused in other
osmocom's projects.

Closes: OS#1987
Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c
2019-11-30 02:17:23 +00:00
Pau Espin d12f698dbb logging: Introduce mutex API to manage log_target in multi-thread envs
log_enable_multithread() enables use of locks inside the
implementation. Lock use is disabled by default, this way only
multi-thread processes need to enable it and suffer related
complexity/performance penalties.

Locks are required around osmo_log_target_list and items inside it,
since targets can be used, modified and deleted by different threads
concurrently (for instance, user writing "logging disable" in VTY while
another thread is willing to write into that target).

Multithread apps and libraries aiming at being used in multithread apps
should update their code to use the locks introduced here when
containing code iterating over osmo_log_target_list explictly or
implicitly by obtaining a log_target (eg. osmo_log_vty2tgt()).

Related: OS#4088
Change-Id: Id7711893b34263baacac6caf4d489467053131bb
2019-10-09 14:19:52 +02:00
Pau Espin afce89dac1 configure: Allow disabling workaround for TLS bug in old ARM gcc versions
Some toolchains (such as sysmobts 201705 one) containing the TLS bug on
old ARM gcc versions (<7.3.0) also crash if the initial workaround found
is aplied (CFLAGS="-mtls-dialect=gnu2"). In that scenario, let's provide
a way to disable the workaround (to avoid "ld" crashing) and warn the
user about requirement to build with -O0 to avoid runtime crashes.

Related: OS#4062
Related: SYS#4628
Change-Id: I04ff8c702eabcf4f6e7b59e11aece2744267cefe
2019-08-06 12:50:26 +02:00
Pau Espin e188b8cd98 configure: Autodetect TLS bug on ARM with old gcc and apply workaround
Check if compiler being used contains the bug. GCC 7.3.0 is the oldest
version containing the fix, and version 6.3.0 is known to contain the
bug. Bug is only known to appear so far only on ARM32. If the bug is
present, gcc will generate a wrong binary which wil lend up segfaulting
when accessing TLS (__thread) variables under certain conditions.

Related: OS#4062
Related: SYS#4628
Change-Id: I8acc2cf41b73da0c3290f1cefd79f2bc68b0e77d
2019-08-06 08:10:48 +00:00
Harald Welte b93f60f7cd conv_acc: Our code requires SSSE3, not just SSE3
The accelerated convolutional decoder uses SSSE3 instructions such
as PSIGNW (via _mm_sign_epi16) which go beyond what SSE3 offers.  So
let's make sure we use the right compiler flag (-mssse3) and also the
right runtime check.

Without this patch, we would use illegal instructions e.g. on Opteron
Gen3 such as Opteron 2427, which are also used as build.opensuse.org
build hosts (build31 through build36) where we wouldn't pass "make
check" as a result.

Change-Id: I2754164384109f2821fd98ffb48f625893f2923d
Fixes: OS#2386
2017-11-17 11:44:22 +01:00
Vadim Yanitskiy 13f4762827 configure.ac: fix build on systems without SIMD support
HAVE_AVX2, HAVE_SSE3 and HAVE_SSE4_1 were never defined if CPU
architecture doesn't match the (86*|x86_64*|amd64*) condition.

Change-Id: If0c3128f9768f95c1f5f955db242e71c81384c6c
2017-05-11 15:20:03 +00:00
Vadim Yanitskiy 2c3066e5da configure.ac: add SIMD detection capabilities
This change adds a check whether compiler supports some SIMD
(Single Instruction, Multiple Data) instructions. It is enabled
by default, and can be disabled by configure option --disable-simd.
The check macro is based on the AX_EXT from autoconf-archive:

www.gnu.org/software/autoconf-archive/ax_ext.html

And depends on the ax_check_compile_flag macro:

www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html

Currently only the following SIMD extensions are being checked:
AVX2, SSE3, SSE4.1, but adding others is also possible. All found
extensions are being defined in the 'config.h' header.

Change-Id: Idf8fff984bd936a75c7c307338df88ba4b005817
2017-05-07 23:11:06 +07:00
Holger Hans Peter Freyther b2eb83fa95 Create a dummy m4 directory to make autoreconf --install --force work
Even when removing AC_CONFIG_MACRO_DIR aclocal insisted that it
needs to have a m4 directory. Make it happy by providing one. As git
is not tracking directories I needed to add a dummy file.
2010-03-24 02:55:33 +01:00