That's because the code relies on (fairly unportable) treatment by the
linker, specifically ld linker from binutils suite:
<https://sourceware.org/binutils/docs/ld/Orphan-Sections.html>
and without that in place, QB_HAVE_ATTRIBUTE_SECTION cannot be enabled
as the __{start,stop}_SECNAME extern references in qb/qblog.h will not
get resolved at the link time.
This reduces repeated code significantly, and allows for easier
supervision of what's being grouped to the suites + possibly what
timeouts apply.
Note that some artificial test case identifiers (in check_array.c,
check_log.c, check_loop.c, check_rb.c, check_utils.c) got changed
so they now follow 1:1 the test (function) name that is being run
for the case at hand without the "test_" prefix (strict convention).
Exception to this are test_ipc_disp_* tests in check_ipc.c that got,
conversely, changed to test_ipc_dispatch_* to follow the test case
identifiers.
make check doesn't build the docs and so errors in that part of
the build system will not be checked without a normal 'make'.
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
No reason not to do that. Situation with qbconfig.h is a bit more
complicated as this file gets generated from .in file and there is
currently no reliable inter-dir/makefile (siblings) targets
dependency tracking in place, AFAICT.
While quarterback [dash] devel [at] lists [dot] fedorahosted [dot] org,
original notification target and development ML seems long gone (without
archives preserved!), let's use #clusterlabs-dev at freenode IRC
network. This is in-line with the purpose of the channel and it's what
clufter, crmsh and hawk seem to be currently using.
Original "qb_log_ctl" interface had to be extended for passing read-only
strings (new parameter), resulting in new "qb_log_ctl2" function, which
is what qb_log_ctl calls into with the new parameter set to NULL.
This ensures backward compatibility.
A new QB_LOG_CONF_IDENT configuration directive for the mentioned
interface is added with a goal to set new internal identifier
that is, notably, used for syslog sink. This allows for switching
the identification without a need to reinitialize logging subsystem,
akin to changing target logging facility.
Also a brand new concept of testing syslog sink in particular is
introduced (finally). During initial trial&error stage, it used
LD_PRELOAD hack but it seems that libtool is sophisticated enough
that no such extra intervention is needed and the desired symbol
resolution Just Works (tm). However, the technique is highly
non-portable (there is even a warning about that from libtool,
which is partially on purpose as the _syslog_override.so should
rather be explicit it is by no mean a regular library) and hence
the syslog tests have to be enabled with explicit
./configure --enable-syslog-tests
rather than possibly break on untested platforms (far too many).
The concept can be extended upon, but initially, just the new
feature is being tested.
Post-review: thanks Chrissie for a suggestion how to deal with
extract-arg-and-forget in a less intrusive way (no defines).
- use semicolons at the end of the description
- use commas when there can be an issue with parsing a long sentence
(and wrap such text at 79 characters if applicable)
Also use the new enum qb_log_target_slot type in for-loops together
with a proper substitute for the literal "0" initializer.
There could be more places that might be type-substituted for this enum
(and hence possibly catch more of an incorrect usage if the compiler
or checker has some notion of enum type narrowing), but leave it as
a possible enhancement for now.
Set the sockets receive buffer size to match the send buffer. On
FreeBSD without this calls to sendto() will result in an ENOBUFS error
if the message is larger than net.local.dgram.recvspace sysctl.
With gcc 5.3.1 20151207:
> log.c: In function 'cs_format':
> log.c:182:2: warning: function might be possible candidate for
> 'gnu_printf' format attribute [-Wsuggest-attribute=format]
> len = vsnprintf(str, QB_LOG_MAX_LEN, cs->format, ap_copy);
> ^
We certainly don't want to disable that warning globally so make use of
diagnostic pragmas for GCC instead in one instance that we cannot
annotate properly.
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>