Skip to content

Commit

Permalink
metrics-probe/filterx: add build skeleton
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Szakacs <[email protected]>
  • Loading branch information
alltilla committed Jul 22, 2024
1 parent 6515b34 commit b8807ec
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 2 deletions.
3 changes: 3 additions & 0 deletions modules/metrics-probe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ add_module(
SOURCES ${METRICS_PROBE_SOURCES}
)

add_subdirectory(filterx)
target_link_libraries(metrics-probe PRIVATE metrics-probe-filterx)

add_test_subdirectory(tests)
7 changes: 5 additions & 2 deletions modules/metrics-probe/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ modules_metrics_probe_libmetrics_probe_la_CPPFLAGS = \
-I$(top_srcdir)/modules/metrics-probe \
-I$(top_builddir)/modules/metrics-probe
modules_metrics_probe_libmetrics_probe_la_LIBADD = \
$(MODULE_DEPS_LIBS)
$(MODULE_DEPS_LIBS) \
$(top_builddir)/modules/metrics-probe/filterx/libmetrics-probe-filterx.la
modules_metrics_probe_libmetrics_probe_la_LDFLAGS = \
$(MODULE_LDFLAGS)
EXTRA_modules_metrics_probe_libmetrics_probe_la_DEPENDENCIES = \
$(MODULE_DEPS_LIBS)
$(MODULE_DEPS_LIBS) \
$(top_builddir)/modules/metrics-probe/filterx/libmetrics-probe-filterx.la

BUILT_SOURCES += \
modules/metrics-probe/metrics-probe-grammar.y \
Expand All @@ -29,4 +31,5 @@ EXTRA_DIST += \
modules/metrics-probe modules/metrics-probe/ mod-metrics-probe: modules/metrics-probe/libmetrics-probe.la
.PHONY: modules/metrics-probe/ mod-metrics-probe

include modules/metrics-probe/filterx/Makefile.am
include modules/metrics-probe/tests/Makefile.am
10 changes: 10 additions & 0 deletions modules/metrics-probe/filterx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set(METRICS_PROBE_FILTERX_SOURCES
metrics-probe-filterx.c
metrics-probe-filterx.h
)

add_module(
TARGET metrics_probe_filterx
SOURCES ${METRICS_PROBE_FILTERX_SOURCES}
LIBRARY_TYPE STATIC
)
22 changes: 22 additions & 0 deletions modules/metrics-probe/filterx/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# noinst: Built as part of a larger libmetrics-probe module as static library
noinst_LTLIBRARIES += modules/metrics-probe/filterx/libmetrics-probe-filterx.la

modules_metrics_probe_filterx_libmetrics_probe_filterx_la_SOURCES = \
modules/metrics-probe/filterx/metrics-probe-filterx.c \
modules/metrics-probe/filterx/metrics-probe-filterx.h

modules_metrics_probe_filterx_libmetrics_probe_filterx_la_CFLAGS = \
-I$(top_srcdir)/modules/metrics-probe/filterx \
-I$(top_builddir)/modules/metrics-probe/filterx

modules_metrics_probe_filterx_libmetrics_probe_filterx_la_LIBADD = \
$(MODULE_DEPS_LIBS)

modules_metrics_probe_filterx_libmetrics_probe_filterx_la_LDFLAGS = \
$(MODULE_LDFLAGS)

EXTRA_modules_metrics_probe_filterx_libmetrics_probe_filterx_la_DEPENDENCIES = \
$(MODULE_DEPS_LIBS)

EXTRA_DIST += \
modules/metrics-probe/filterx/CMakeLists.txt
24 changes: 24 additions & 0 deletions modules/metrics-probe/filterx/metrics-probe-filterx.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 Axoflow
* Copyright (c) 2024 Attila Szakacs <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* As an additional exemption you are allowed to compile & link against the
* OpenSSL libraries as published by the OpenSSL project. See the file
* COPYING for details.
*
*/

#include "metrics-probe-filterx.h"
27 changes: 27 additions & 0 deletions modules/metrics-probe/filterx/metrics-probe-filterx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2024 Axoflow
* Copyright (c) 2024 Attila Szakacs <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* As an additional exemption you are allowed to compile & link against the
* OpenSSL libraries as published by the OpenSSL project. See the file
* COPYING for details.
*
*/

#ifndef METRICS_PROBE_FILTERX_H_INCLUDED
#define METRICS_PROBE_FILTERX_H_INCLUDED

#endif
1 change: 1 addition & 0 deletions tests/copyright/policy
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ modules/basicfuncs/tf-tag\.c$
modules/diskq/diskq-global-metrics\.[ch]$
modules/diskq/tests/test_logqueue_disk\.c$
modules/metrics-probe/metrics-probe(|-parser|-plugin|-grammar)\.(c|h|ym)$
modules/metrics-probe/filterx/filterx-metrics-probe\.(c|h)$
modules/metrics-probe/tests/test_metrics_probe\.c$
modules/darwinosl/darwinosl(|-parser|-plugin|-grammar|-source|-source-oslog|-source-persist)\.(c|h|m|ym)$
modules/grpc/otel/otel-(grammar|parser|plugin|source|source-services|servicecall|protobuf-parser|protobuf-formatter|dest|dest-worker|logmsg-handles)\.(c|h|cpp|hpp|ym)$
Expand Down

0 comments on commit b8807ec

Please sign in to comment.