Fix: use printk_once() for wrapper warning messages
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 30 Aug 2016 22:42:10 +0000 (18:42 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 30 Aug 2016 22:42:10 +0000 (18:42 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
wrapper/ftrace.h
wrapper/genhd.h
wrapper/irqdesc.c
wrapper/splice.c
wrapper/trace-clock.h
wrapper/tracepoint.h
wrapper/vmalloc.h
wrapper/writeback.h

index 6fd1d55c11a391872c17360c280f936e6158b8cd..5a964387b68ea67f4e53b7dbe2eaeb7faef30033 100644 (file)
@@ -43,7 +43,7 @@ int wrapper_register_ftrace_function_probe(char *glob,
        if (register_ftrace_function_probe_sym) {
                return register_ftrace_function_probe_sym(glob, ops, data);
        } else {
-               printk(KERN_WARNING "LTTng: register_ftrace_function_probe symbol lookup failed.\n");
+               printk_once(KERN_WARNING "LTTng: register_ftrace_function_probe symbol lookup failed.\n");
                return -EINVAL;
        }
 }
@@ -59,7 +59,7 @@ void wrapper_unregister_ftrace_function_probe(char *glob,
        if (unregister_ftrace_function_probe_sym) {
                unregister_ftrace_function_probe_sym(glob, ops, data);
        } else {
-               printk(KERN_WARNING "LTTng: unregister_ftrace_function_probe symbol lookup failed.\n");
+               printk_once(KERN_WARNING "LTTng: unregister_ftrace_function_probe symbol lookup failed.\n");
                WARN_ON(1);
        }
 }
index 4184bd011d3e9dc8c23c607cbf7f379abe4f3bf2..70b8d3fe6f3cdfd28349675b3ba40fda857a76f1 100644 (file)
@@ -41,7 +41,7 @@ char *wrapper_disk_name(struct gendisk *hd, int partno, char *buf)
        if (disk_name_sym) {
                return disk_name_sym(hd, partno, buf);
        } else {
-               printk(KERN_WARNING "LTTng: disk_name symbol lookup failed.\n");
+               printk_once(KERN_WARNING "LTTng: disk_name symbol lookup failed.\n");
                return NULL;
        }
 }
@@ -65,7 +65,7 @@ struct class *wrapper_get_block_class(void)
 
        ptr_block_class = (struct class *) kallsyms_lookup_dataptr("block_class");
        if (!ptr_block_class) {
-               printk(KERN_WARNING "LTTng: block_class symbol lookup failed.\n");
+               printk_once(KERN_WARNING "LTTng: block_class symbol lookup failed.\n");
                return NULL;
        }
        return ptr_block_class;
@@ -78,7 +78,7 @@ struct device_type *wrapper_get_disk_type(void)
 
        ptr_disk_type = (struct device_type *) kallsyms_lookup_dataptr("disk_type");
        if (!ptr_disk_type) {
-               printk(KERN_WARNING "LTTng: disk_type symbol lookup failed.\n");
+               printk_once(KERN_WARNING "LTTng: disk_type symbol lookup failed.\n");
                return NULL;
        }
        return ptr_disk_type;
index 6ef86c2d5416b7e63c746babb843640f9c4a9060..fd3f0c148d9bade00ce920ef6dffe19c3f69c6bf 100644 (file)
@@ -40,7 +40,7 @@ struct irq_desc *wrapper_irq_to_desc(unsigned int irq)
        if (irq_to_desc_sym) {
                return irq_to_desc_sym(irq);
        } else {
-               printk(KERN_WARNING "LTTng: irq_to_desc symbol lookup failed.\n");
+               printk_once(KERN_WARNING "LTTng: irq_to_desc symbol lookup failed.\n");
                return NULL;
        }
 }
index 357e1ac5a84560dca04613ab718ca76a535d2032..d24ef3d68593010e677c4ffc5b1a115de29c7a36 100644 (file)
@@ -41,7 +41,7 @@ ssize_t wrapper_splice_to_pipe(struct pipe_inode_info *pipe,
        if (splice_to_pipe_sym) {
                return splice_to_pipe_sym(pipe, spd);
        } else {
-               printk(KERN_WARNING "LTTng: splice_to_pipe symbol lookup failed.\n");
+               printk_once(KERN_WARNING "LTTng: splice_to_pipe symbol lookup failed.\n");
                return -ENOSYS;
        }
 }
index 1d14cb9bd1b4457950f2aa74a933fdb6a50394ee..3e8780da167ffa4b3c832eea7e8756c647091c29 100644 (file)
@@ -175,13 +175,13 @@ static inline const char *trace_clock_description_monotonic(void)
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0))
 static inline int get_trace_clock(void)
 {
-       printk(KERN_WARNING "LTTng: Using mainline kernel monotonic fast clock, which is NMI-safe.\n");
+       printk_once(KERN_WARNING "LTTng: Using mainline kernel monotonic fast clock, which is NMI-safe.\n");
        return 0;
 }
 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) */
 static inline int get_trace_clock(void)
 {
-       printk(KERN_WARNING "LTTng: Using mainline kernel monotonic clock. NMIs will not be traced.\n");
+       printk_once(KERN_WARNING "LTTng: Using mainline kernel monotonic clock. NMIs will not be traced.\n");
        return 0;
 }
 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) */
index 023086e42d59b4f82acfb6c7f5d77300a71edae9..367cdf42f1c1d343ee4414afe5069d478ac7976b 100644 (file)
@@ -82,7 +82,7 @@ int wrapper_tracepoint_module_notify(struct notifier_block *nb,
        if (tracepoint_module_notify_sym) {
                return tracepoint_module_notify_sym(nb, val, mod);
        } else {
-               printk(KERN_WARNING "LTTng: tracepoint_module_notify symbol lookup failed. It probably means you kernel don't need this work-around. Please consider upgrading LTTng modules to make this warning go away.\n");
+               printk_once(KERN_WARNING "LTTng: tracepoint_module_notify symbol lookup failed. It probably means you kernel don't need this work-around. Please consider upgrading LTTng modules to make this warning go away.\n");
                return -ENOSYS;
        }
 }
index dad8d4e34498426762a1d195ed0510f47248c26a..2332439fe34c56515cefcaa4eda787a65ecaf835 100644 (file)
@@ -44,8 +44,8 @@ void wrapper_vmalloc_sync_all(void)
                 * Only x86 needs vmalloc_sync_all to make sure LTTng does not
                 * trigger recursive page faults.
                 */
-               printk(KERN_WARNING "LTTng: vmalloc_sync_all symbol lookup failed.\n");
-               printk(KERN_WARNING "Page fault handler and NMI tracing might trigger faults.\n");
+               printk_once(KERN_WARNING "LTTng: vmalloc_sync_all symbol lookup failed.\n");
+               printk_once(KERN_WARNING "Page fault handler and NMI tracing might trigger faults.\n");
 #endif
        }
 }
index 3e8a9f561c57b7d0c94fa9acea8624773a5ef978..cdcbd58444e0efbd8c3cca8cea04d6332c83f540 100644 (file)
@@ -41,7 +41,7 @@ unsigned long wrapper_global_dirty_limit(void)
        if (global_dirty_limit_sym) {
                return *global_dirty_limit_sym;
        } else {
-               printk(KERN_WARNING "LTTng: global_dirty_limit symbol lookup failed.\n");
+               printk_once(KERN_WARNING "LTTng: global_dirty_limit symbol lookup failed.\n");
                return 0;
        }
 }
This page took 0.030152 seconds and 4 git commands to generate.