aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/log.c')
-rw-r--r--net/batman-adv/log.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c
index 1032d84e21ae..6beb5f067810 100644
--- a/net/batman-adv/log.c
+++ b/net/batman-adv/log.c
@@ -41,6 +41,7 @@
#include <stdarg.h>
#include "debugfs.h"
+#include "trace.h"
#define BATADV_LOG_BUFF_MASK (batadv_log_buff_len - 1)
@@ -100,13 +101,19 @@ static int batadv_fdebug_log(struct batadv_priv_debug_log *debug_log,
*/
int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...)
{
+ struct va_format vaf;
va_list args;
- char tmp_log_buf[256];
va_start(args, fmt);
- vscnprintf(tmp_log_buf, sizeof(tmp_log_buf), fmt, args);
- batadv_fdebug_log(bat_priv->debug_log, "[%10u] %s",
- jiffies_to_msecs(jiffies), tmp_log_buf);
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+ batadv_fdebug_log(bat_priv->debug_log, "[%10u] %pV",
+ jiffies_to_msecs(jiffies), &vaf);
+
+ trace_batadv_dbg(bat_priv, &vaf);
+
va_end(args);
return 0;
@@ -117,7 +124,8 @@ static int batadv_log_open(struct inode *inode, struct file *file)
if (!try_module_get(THIS_MODULE))
return -EBUSY;
- batadv_debugfs_deprecated(file, "");
+ batadv_debugfs_deprecated(file,
+ "Use tracepoint batadv:batadv_dbg instead\n");
nonseekable_open(inode, file);
file->private_data = inode->i_private;