When application calls rte_eal_cleanup on shutdown,
the DPDK log should be closed and cleaned up.
This helps reduce false reports from tools like ASAN
and valgrind that track memory leaks.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
#include <rte_per_lcore.h>
#include "eal_log.h"
+#include "eal_private.h"
struct rte_log_dynamic_type {
const char *name;
"Debug dataplane logs available - lower performance\n");
#endif
}
+
+/*
+ * Called by eal_cleanup
+ */
+void
+rte_eal_log_cleanup(void)
+{
+ if (default_log_stream) {
+ fclose(default_log_stream);
+ default_log_stream = NULL;
+ }
+}
*/
int rte_eal_intr_init(void);
+/**
+ * Close the default log stream
+ *
+ * This function is private to EAL.
+ */
+void rte_eal_log_cleanup(void);
+
/**
* Init alarm mechanism. This is to allow a callback be called after
* specific time.
rte_trace_save();
eal_trace_fini();
eal_cleanup_config(internal_conf);
+ rte_eal_log_cleanup();
return 0;
}
return ret;
}
+static int
+console_log_close(__rte_unused void *c)
+{
+ closelog();
+ return 0;
+}
+
static cookie_io_functions_t console_log_func = {
.write = console_log_write,
+ .close = console_log_close,
};
/*