coverage: use lcov to generate coverate reports

Type "make coverage" to generate a coverage report and launch it using
firefox.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
filter: move LogFilterPipe to a separate module

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
filter/filter-op: split off or/and operations from filter-expr

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
filter/filter-cmp: split off from filter-expr

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
filter/filter-tags: split off from filter-expr

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
filter/filter-netmask: split off from filter-expr

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
filter/filter-call: split off from filter-expr

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
filter/filter-re: split off from filter-expr

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
filter/filter-pri: split off from filter-expr

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
lib/filter: clean up includes

All files should include only the headers required to that specific code.
Since the filter-expr.c file was split, a number of unneeded includes
remained in filter-expr.{c,h}, remove those and make sure the split off files
include what those need.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
test_filters: move from tests/unit to lib/filter/tests

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
rewrite/rewrite-set-tag: split off from rewrite-expr

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
rewrite/rewrite-set: split off from rewrite-expr

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
rewrite/rewrite-subst: split off from rewrite-expr

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
rewrite: clean up includes

Because of the split a number of includes remained lingering, clean them
up.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
logqueue: remove log_queue_assert_output_thread()

When explicit-commits is in effect, SQL destination attempts to commit
the INSERT SQL commands when the number of uncommitted inserts reaches
the limit set by flush_lines. However, when the input queue of the SQL
destination becomes empty, we do not want uncommitted INSERT commands
to hang in the air, so we register a callback to be notified when new
log messages become available and commit the last batch of them,
regardless of flush_lines settings. When this happens, then the implicit
condition log_queue_assert_output_thread() depended upon cannot be
satisfied, and not because of a programming mistake.

We could work around this limitation of that assertion, but the thing
is that this assertion is not very clean, and though it had caught a lot
of programming errors in the past, it may generate false positives in
case of destinations like SQL (and because of the lack of proper locking
around it, it may miss some real problems).

Long story short, we decided to remove it entirely, while ensuring that
all the methods of logqueue-fifo that assume to be running in the output
thread of simple log destinations are documented.

Signed-off-by: Attila M. Magyar <athos@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogQueue: remove the ability to check for partially fulfilled batches

TBD
afsql: allocate locks/condvars at startup

Instead of doing this for all start_thread/stop_thread pairs, allocate
them once to avoid churn.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
sql: migrate to use the log_queue_check_items() API

This patch changes the SQL driver to use the log_queue_check_items()
API instead of its own locking around the LogQueue instance.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afsql: flush queue at exit