diff mbox

[v2,1/6] vlog: add vlog_rate_limit_valist

Message ID 1427397805-27395-2-git-send-email-zoltan.kiss@linaro.org
State New
Headers show

Commit Message

Zoltan Kiss March 26, 2015, 7:23 p.m. UTC
We will need this for odp_override_log

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
---
 include/openvswitch/vlog.h | 2 ++
 lib/vlog.c                 | 8 ++++++++
 2 files changed, 10 insertions(+)
diff mbox

Patch

diff --git a/include/openvswitch/vlog.h b/include/openvswitch/vlog.h
index 3f71e4b..71b3453 100644
--- a/include/openvswitch/vlog.h
+++ b/include/openvswitch/vlog.h
@@ -170,6 +170,8 @@  OVS_NO_RETURN void vlog_abort_valist(const struct vlog_module *,
 void vlog_rate_limit(const struct vlog_module *, enum vlog_level,
                      struct vlog_rate_limit *, const char *, ...)
     OVS_PRINTF_FORMAT (4, 5);
+void vlog_rate_limit_valist(const struct vlog_module *, enum vlog_level,
+                     struct vlog_rate_limit *, const char *, va_list);
 
 /* Creates and initializes a global instance of a module named MODULE, and
  * defines a static variable named THIS_MODULE that points to it, for use with
diff --git a/lib/vlog.c b/lib/vlog.c
index dbf46c5..6548656 100644
--- a/lib/vlog.c
+++ b/lib/vlog.c
@@ -1069,6 +1069,14 @@  vlog_rate_limit(const struct vlog_module *module, enum vlog_level level,
 }
 
 void
+vlog_rate_limit_valist(const struct vlog_module *module, enum vlog_level level,
+                struct vlog_rate_limit *rl, const char *message, va_list args)
+{
+    if (!vlog_should_drop(module, level, rl))
+        vlog_valist(module, level, message, args);
+}
+
+void
 vlog_usage(void)
 {
     printf("\n\