Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

trace/osnoise: Fix 'no previous prototype' warnings

kernel test robot reported some osnoise functions with "no previous
prototype."

Fix these warnings by making local functions static, and by adding:

void osnoise_trace_irq_entry(int id);
void osnoise_trace_irq_exit(int id, const char *desc);

to include/linux/trace.h.

Link: https://lkml.kernel.org/r/e40d3cb4be8bde921f4b40fa6a095cf85ab807bd.1624872608.git.bristot@redhat.com

Fixes: bce29ac9ce0b ("trace: Add osnoise tracer")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

authored by

Daniel Bristot de Oliveira and committed by
Steven Rostedt (VMware)
f7d9f637 b96285e1

+13 -12
-3
arch/x86/kernel/trace.c
··· 2 2 #include <linux/trace.h> 3 3 4 4 #if defined(CONFIG_OSNOISE_TRACER) && defined(CONFIG_X86_LOCAL_APIC) 5 - extern void osnoise_trace_irq_entry(int id); 6 - extern void osnoise_trace_irq_exit(int id, const char *desc); 7 - 8 5 /* 9 6 * trace_intel_irq_entry - record intel specific IRQ entry 10 7 */
+2
include/linux/trace.h
··· 45 45 /* For osnoise tracer */ 46 46 int osnoise_arch_register(void); 47 47 void osnoise_arch_unregister(void); 48 + void osnoise_trace_irq_entry(int id); 49 + void osnoise_trace_irq_exit(int id, const char *desc); 48 50 49 51 #endif /* CONFIG_TRACING */ 50 52
+11 -9
kernel/trace/trace_osnoise.c
··· 736 736 * This function hooks the IRQ related callbacks to the respective trace 737 737 * events. 738 738 */ 739 - int hook_irq_events(void) 739 + static int hook_irq_events(void) 740 740 { 741 741 int ret; 742 742 ··· 768 768 * This function unhooks the IRQ related callbacks to the respective trace 769 769 * events. 770 770 */ 771 - void unhook_irq_events(void) 771 + static void unhook_irq_events(void) 772 772 { 773 773 osnoise_arch_unregister(); 774 774 unregister_trace_irq_handler_exit(trace_irqexit_callback, NULL); ··· 785 785 * arrival time. The delta_start is used to compute the duration at the 786 786 * softirq exit handler. See cond_move_softirq_delta_start(). 787 787 */ 788 - void trace_softirq_entry_callback(void *data, unsigned int vec_nr) 788 + static void trace_softirq_entry_callback(void *data, unsigned int vec_nr) 789 789 { 790 790 struct osnoise_variables *osn_var = this_cpu_osn_var(); 791 791 ··· 808 808 * Computes the duration of the softirq noise, and trace it. Also discounts the 809 809 * interference from other sources of noise could be currently being accounted. 810 810 */ 811 - void trace_softirq_exit_callback(void *data, unsigned int vec_nr) 811 + static void trace_softirq_exit_callback(void *data, unsigned int vec_nr) 812 812 { 813 813 struct osnoise_variables *osn_var = this_cpu_osn_var(); 814 814 int duration; ··· 949 949 * This function is hooked to the sched:sched_switch trace event, and it is 950 950 * used to record the beginning and to report the end of a thread noise window. 951 951 */ 952 - void 952 + static void 953 953 trace_sched_switch_callback(void *data, bool preempt, struct task_struct *p, 954 954 struct task_struct *n) 955 955 { ··· 968 968 * Hook the osnoise tracer callbacks to handle the noise from other 969 969 * threads on the necessary kernel events. 970 970 */ 971 - int hook_thread_events(void) 971 + static int hook_thread_events(void) 972 972 { 973 973 int ret; 974 974 ··· 985 985 * Unook the osnoise tracer callbacks to handle the noise from other 986 986 * threads on the necessary kernel events. 987 987 */ 988 - void unhook_thread_events(void) 988 + static void unhook_thread_events(void) 989 989 { 990 990 unregister_trace_sched_switch(trace_sched_switch_callback, NULL); 991 991 } ··· 997 997 * values will be used later to compute the diff betwneen the statistics 998 998 * before and after the osnoise sampling. 999 999 */ 1000 - void save_osn_sample_stats(struct osnoise_variables *osn_var, struct osnoise_sample *s) 1000 + static void 1001 + save_osn_sample_stats(struct osnoise_variables *osn_var, struct osnoise_sample *s) 1001 1002 { 1002 1003 s->nmi_count = osn_var->nmi.count; 1003 1004 s->irq_count = osn_var->irq.count; ··· 1013 1012 * statistics. The struct osnoise_sample *s contains the statistics saved via 1014 1013 * save_osn_sample_stats() before the osnoise sampling. 1015 1014 */ 1016 - void diff_osn_sample_stats(struct osnoise_variables *osn_var, struct osnoise_sample *s) 1015 + static void 1016 + diff_osn_sample_stats(struct osnoise_variables *osn_var, struct osnoise_sample *s) 1017 1017 { 1018 1018 s->nmi_count = osn_var->nmi.count - s->nmi_count; 1019 1019 s->irq_count = osn_var->irq.count - s->irq_count;