xref: /linux/net/batman-adv/log.c (revision 762f99f4f3cb41a775b5157dd761217beba65873)
17db7d9f3SSven Eckelmann // SPDX-License-Identifier: GPL-2.0
2cfa55c6dSSven Eckelmann /* Copyright (C) B.A.T.M.A.N. contributors:
3ba412080SSven Eckelmann  *
4ba412080SSven Eckelmann  * Marek Lindner
5ba412080SSven Eckelmann  */
6ba412080SSven Eckelmann 
7ba412080SSven Eckelmann #include "log.h"
8ba412080SSven Eckelmann #include "main.h"
9ba412080SSven Eckelmann 
10*c0891ac1SAlexey Dobriyan #include <linux/stdarg.h>
11ba412080SSven Eckelmann 
12d331a739SSven Eckelmann #include "trace.h"
1300caf6a2SSven Eckelmann 
140dacc7faSSven Eckelmann /**
150dacc7faSSven Eckelmann  * batadv_debug_log() - Add debug log entry
160dacc7faSSven Eckelmann  * @bat_priv: the bat priv with all the soft interface information
170dacc7faSSven Eckelmann  * @fmt: format string
180dacc7faSSven Eckelmann  *
190dacc7faSSven Eckelmann  * Return: 0 on success or negative error number in case of failure
200dacc7faSSven Eckelmann  */
batadv_debug_log(struct batadv_priv * bat_priv,const char * fmt,...)210dacc7faSSven Eckelmann int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...)
220dacc7faSSven Eckelmann {
230dacc7faSSven Eckelmann 	struct va_format vaf;
240dacc7faSSven Eckelmann 	va_list args;
250dacc7faSSven Eckelmann 
260dacc7faSSven Eckelmann 	va_start(args, fmt);
270dacc7faSSven Eckelmann 
280dacc7faSSven Eckelmann 	vaf.fmt = fmt;
290dacc7faSSven Eckelmann 	vaf.va = &args;
300dacc7faSSven Eckelmann 
310dacc7faSSven Eckelmann 	trace_batadv_dbg(bat_priv, &vaf);
320dacc7faSSven Eckelmann 
330dacc7faSSven Eckelmann 	va_end(args);
340dacc7faSSven Eckelmann 
350dacc7faSSven Eckelmann 	return 0;
360dacc7faSSven Eckelmann }
37