From: Mathieu Desnoyers Date: Tue, 30 Aug 2016 22:42:10 +0000 (-0400) Subject: Fix: use printk_once() for wrapper warning messages X-Git-Tag: v2.8.1~7 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2b0e9d963bd0576820aa436f6e13eca226f2b12c;p=lttng-modules.git Fix: use printk_once() for wrapper warning messages Signed-off-by: Mathieu Desnoyers --- diff --git a/wrapper/ftrace.h b/wrapper/ftrace.h index 6fd1d55c..5a964387 100644 --- a/wrapper/ftrace.h +++ b/wrapper/ftrace.h @@ -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); } } diff --git a/wrapper/genhd.h b/wrapper/genhd.h index 4184bd01..70b8d3fe 100644 --- a/wrapper/genhd.h +++ b/wrapper/genhd.h @@ -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; diff --git a/wrapper/irqdesc.c b/wrapper/irqdesc.c index 6ef86c2d..fd3f0c14 100644 --- a/wrapper/irqdesc.c +++ b/wrapper/irqdesc.c @@ -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; } } diff --git a/wrapper/splice.c b/wrapper/splice.c index 357e1ac5..d24ef3d6 100644 --- a/wrapper/splice.c +++ b/wrapper/splice.c @@ -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; } } diff --git a/wrapper/trace-clock.h b/wrapper/trace-clock.h index 1d14cb9b..3e8780da 100644 --- a/wrapper/trace-clock.h +++ b/wrapper/trace-clock.h @@ -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)) */ diff --git a/wrapper/tracepoint.h b/wrapper/tracepoint.h index 023086e4..367cdf42 100644 --- a/wrapper/tracepoint.h +++ b/wrapper/tracepoint.h @@ -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; } } diff --git a/wrapper/vmalloc.h b/wrapper/vmalloc.h index dad8d4e3..2332439f 100644 --- a/wrapper/vmalloc.h +++ b/wrapper/vmalloc.h @@ -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 } } diff --git a/wrapper/writeback.h b/wrapper/writeback.h index 3e8a9f56..cdcbd584 100644 --- a/wrapper/writeback.h +++ b/wrapper/writeback.h @@ -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; } }