aboutsummaryrefslogtreecommitdiff
path: root/examples/c-influxd
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2024-03-21 06:15:04 +0100
committerToni Uhlig <matzeton@googlemail.com>2024-03-21 07:26:22 +0100
commit33560d64d2f77b7ef181ea6c02d22f21fbe4e91f (patch)
treea9c92d25f780a3fd68af99d56e700f0b66d9e9ca /examples/c-influxd
parent675640b0e647ff2084d973b5d3f302b3a6f978bf (diff)
Fix example build error if memory profiling enabled.
* CI: build against libnDPI with `-DNDPI_NO_PKGCONFIG=ON` and `-DSTATIC_LIBNDPI_INSTALLDIR=/usr` * CI: `ENABLE_DBUS=ON` for most builds Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/c-influxd')
-rw-r--r--examples/c-influxd/c-influxd.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/c-influxd/c-influxd.c b/examples/c-influxd/c-influxd.c
index c58c36ae3..6477480f6 100644
--- a/examples/c-influxd/c-influxd.c
+++ b/examples/c-influxd/c-influxd.c
@@ -350,6 +350,29 @@ static struct global_map const severity_map[] = {{"Low", INFLUXD_STATS_GAUGE_PTR
{"Emergency", INFLUXD_STATS_GAUGE_PTR(flow_severity_emergency)},
{NULL, INFLUXD_STATS_GAUGE_PTR(flow_severity_unknown)}};
+#ifdef ENABLE_MEMORY_PROFILING
+void nDPIsrvd_memprof_log_alloc(size_t alloc_size)
+{
+ (void)alloc_size;
+}
+
+void nDPIsrvd_memprof_log_free(size_t free_size)
+{
+ (void)free_size;
+}
+
+void nDPIsrvd_memprof_log(char const * const format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ fprintf(stderr, "%s", "nDPIsrvd MemoryProfiler: ");
+ vfprintf(stderr, format, ap);
+ fprintf(stderr, "%s\n", "");
+ va_end(ap);
+}
+#endif
+
#define INFLUXDB_FORMAT() "%s=%llu,"
#define INFLUXDB_FORMAT_END() "%s=%llu\n"
#define INFLUXDB_VALUE_COUNTER(value) #value, (unsigned long long int)influxd_statistics.counters.value