The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.9.x-ovz" and will appear 
at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.9.23
------>
commit e7b5d6241c7a77a2d26e88ae44da6422d62980c5
Author: Dmitry Safonov <dsafo...@virtuozzo.com>
Date:   Mon Jan 18 18:39:06 2016 +0400

    ve_prink: introduce ve_pr_<level>_ratelimited
    
    Simple ratelimit for ve_printk & level.
    
    https://jira.sw.ru/browse/PSBM-42313
    
    Signed-off-by: Dmitry Safonov <dsafo...@virtuozzo.com>
    Reviewed-by: Kirill Tkhai <ktk...@virtuozzo.com>
---
 include/linux/printk.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/include/linux/printk.h b/include/linux/printk.h
index 87bc842..4db50c4 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -345,9 +345,21 @@ extern void dump_stack(void) __cold;
        if (__ratelimit(&_rs))                                          \
                printk(fmt, ##__VA_ARGS__);                             \
 })
+
+#define ve_printk_ratelimited(dst, fmt, ...)                           \
+({                                                                     \
+       static DEFINE_RATELIMIT_STATE(_rs,                              \
+                                     DEFAULT_RATELIMIT_INTERVAL,       \
+                                     DEFAULT_RATELIMIT_BURST);         \
+                                                                       \
+       if (__ratelimit(&_rs))                                          \
+               ve_printk(dst, fmt, ##__VA_ARGS__);                     \
+})
 #else
 #define printk_ratelimited(fmt, ...)                                   \
        no_printk(fmt, ##__VA_ARGS__)
+#define ve_printk_ratelimited(dst, fmt, ...)                           \
+       no_printk(fmt, ##__VA_ARGS__)
 #endif
 
 #define pr_emerg_ratelimited(fmt, ...)                                 \
@@ -365,6 +377,20 @@ extern void dump_stack(void) __cold;
 #define pr_info_ratelimited(fmt, ...)                                  \
        printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
 /* no pr_cont_ratelimited, don't do that... */
+#define ve_pr_emerg_ratelimited(dst, fmt, ...)                                 
\
+       ve_printk_ratelimited(dst, KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
+#define ve_pr_alert_ratelimited(dst, fmt, ...)                                 
\
+       ve_printk_ratelimited(dst, KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
+#define ve_pr_crit_ratelimited(dst, fmt, ...)                                  
\
+       ve_printk_ratelimited(dst, KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
+#define ve_pr_err_ratelimited(dst, fmt, ...)                                   
\
+       ve_printk_ratelimited(dst, KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
+#define ve_pr_warn_ratelimited(dst, fmt, ...)                                  
\
+       ve_printk_ratelimited(dst, KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
+#define ve_pr_notice_ratelimited(dst, fmt, ...)                                
        \
+       ve_printk_ratelimited(dst, KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
+#define ve_pr_info_ratelimited(dst, fmt, ...)                                  
\
+       ve_printk_ratelimited(dst, KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
 
 #if defined(DEBUG)
 #define pr_devel_ratelimited(fmt, ...)                                 \
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to