ftrace: Use local_irq_{save,restore}_nmi() in tracers.
PATCH 2/2 ftrace: Use local_irq_{save,restore}_nmi() in tracers.
Signed-off-by David S. Miller <[email protected]>
--- kernel/trace/ftrace.c | 4 ++-- kernel/trace/trace_functions.c | 8 ++++---- kernel/trace/trace_sched_wakeup.c | 4 ++-- kernel/trace/trace_stack.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-)
kernel/trace/ftrace.c +2 -2
@@ -612,7 +612,7 @@ function_profile_call(unsigned long ip, unsigned long parent_ip)if (!ftrace_profile_enabled)return ; -local_irq_save (flags); +local_irq_save_nmi (flags); stat = &__get_cpu_var (ftrace_profile_stats);if (!stat->hash || !ftrace_profile_enabled)
@@ -627,7 +627,7 @@ function_profile_call(unsigned long ip, unsigned long parent_ip) rec->counter++; out: -local_irq_restore (flags); +local_irq_restore_nmi (flags); }#ifdef CONFIG_FUNCTION_GRAPH_TRACER
kernel/trace/trace_functions.c +4 -4
@@ -91,7 +91,7 @@ function_trace_call(unsigned long ip, unsigned long parent_ip)* Need to use raw, since this must be called before the * recursive protection is performed. */ -local_irq_save (flags); +local_irq_save_nmi (flags); cpu =raw_smp_processor_id (); data = tr->data[cpu]; disabled =atomic_inc_return (&data->disabled);
@@ -102,7 +102,7 @@ function_trace_call(unsigned long ip, unsigned long parent_ip) }atomic_dec (&data->disabled); -local_irq_restore (flags); +local_irq_restore_nmi (flags); } static void
@@ -122,7 +122,7 @@ function_stack_trace_call(unsigned long ip, unsigned long parent_ip)* Need to use raw, since this must be called before the * recursive protection is performed. */ -local_irq_save (flags); +local_irq_save_nmi (flags); cpu =raw_smp_processor_id (); data = tr->data[cpu]; disabled =atomic_inc_return (&data->disabled);
@@ -142,7 +142,7 @@ function_stack_trace_call(unsigned long ip, unsigned long parent_ip) }atomic_dec (&data->disabled); -local_irq_restore (flags); +local_irq_restore_nmi (flags); }
kernel/trace/trace_sched_wakeup.c +2 -2
@@ -65,11 +65,11 @@ wakeup_tracer_call(unsigned long ip, unsigned long parent_ip)if (unlikely (disabled !=1 )) goto out; -local_irq_save (flags); +local_irq_save_nmi (flags);trace_function (tr, ip, parent_ip, flags, pc); -local_irq_restore (flags); +local_irq_restore_nmi (flags); out:atomic_dec (&data->disabled);
kernel/trace/trace_stack.c +2 -2
@@ -53,7 +53,7 @@ static inline void check_stack(void)if (!object_is_on_stack (&this_size))return ; -local_irq_save (flags); +local_irq_save_nmi (flags);arch_spin_lock (&max_stack_lock);/* a race could have already updated it */
@@ -104,7 +104,7 @@ static inline void check_stack(void) out:arch_spin_unlock (&max_stack_lock); -local_irq_restore (flags); +local_irq_restore_nmi (flags); } static void
Signature · 1 line
1.6.6.1
Quoted 13 lines · David Miller
Signed-off-by David S. Miller <[email protected]>--- kernel/trace/ftrace.c | 4 ++-- kernel/trace/trace_functions.c | 8 ++++---- kernel/trace/trace_sched_wakeup.c | 4 ++-- kernel/trace/trace_stack.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-)kernel/trace/ftrace.c +0
-0
kernel/trace/ftrace.c function_profile_call(unsigned long ip, unsigned long parent_ip) · line 615
Quoted 5 lines
kernel/trace/ftrace.c +1
-1@@ -612,7 +612,7 @@ function_profile_call(unsigned long ip, unsigned long parent_ip)if (!ftrace_profile_enabled)return ; -local_irq_save (flags); +local_irq_save_nmi (flags);
These are equivalent for non sparc archs, correct?
If so,
Acked-by Steven Rostedt <[email protected]>
-- Steve
Quoted 92 lines
kernel/trace/ftrace.c +1
-1stat = &__get_cpu_var (ftrace_profile_stats);if (!stat->hash || !ftrace_profile_enabled)@@ -627,7 +627,7 @@ function_profile_call(unsigned long ip, unsigned long parent_ip) rec->counter++; out: -local_irq_restore (flags); +local_irq_restore_nmi (flags); }#ifdef CONFIG_FUNCTION_GRAPH_TRACER kernel/trace/trace_functions.c +4
-4@@ -91,7 +91,7 @@ function_trace_call(unsigned long ip, unsigned long parent_ip)* Need to use raw, since this must be called before the * recursive protection is performed. */ -local_irq_save (flags); +local_irq_save_nmi (flags); cpu =raw_smp_processor_id (); data = tr->data[cpu]; disabled =atomic_inc_return (&data->disabled);@@ -102,7 +102,7 @@ function_trace_call(unsigned long ip, unsigned long parent_ip) }atomic_dec (&data->disabled); -local_irq_restore (flags); +local_irq_restore_nmi (flags); } static void@@ -122,7 +122,7 @@ function_stack_trace_call(unsigned long ip, unsigned long parent_ip)* Need to use raw, since this must be called before the * recursive protection is performed. */ -local_irq_save (flags); +local_irq_save_nmi (flags); cpu =raw_smp_processor_id (); data = tr->data[cpu]; disabled =atomic_inc_return (&data->disabled);@@ -142,7 +142,7 @@ function_stack_trace_call(unsigned long ip, unsigned long parent_ip) }atomic_dec (&data->disabled); -local_irq_restore (flags); +local_irq_restore_nmi (flags); }kernel/trace/trace_sched_wakeup.c +2
-2@@ -65,11 +65,11 @@ wakeup_tracer_call(unsigned long ip, unsigned long parent_ip)if (unlikely (disabled !=1 )) goto out; -local_irq_save (flags); +local_irq_save_nmi (flags);trace_function (tr, ip, parent_ip, flags, pc); -local_irq_restore (flags); +local_irq_restore_nmi (flags); out:atomic_dec (&data->disabled);kernel/trace/trace_stack.c +2
-2@@ -53,7 +53,7 @@ static inline void check_stack(void)if (!object_is_on_stack (&this_size))return ; -local_irq_save (flags); +local_irq_save_nmi (flags);arch_spin_lock (&max_stack_lock);/* a race could have already updated it */ @@ -104,7 +104,7 @@ static inline void check_stack(void) out:arch_spin_unlock (&max_stack_lock); -local_irq_restore (flags); +local_irq_restore_nmi (flags); } static void
From: Steven Rostedt <[email protected]>
Date: Tue, 06 Apr 2010 21:14:10 -0400
Quoted 17 lines · David Miller
Quoted 16 lines
Signed-off-by David S. Miller <[email protected]>--- kernel/trace/ftrace.c | 4 ++-- kernel/trace/trace_functions.c | 8 ++++---- kernel/trace/trace_sched_wakeup.c | 4 ++-- kernel/trace/trace_stack.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-)kernel/trace/ftrace.c +0
-0@@ -612,7 +612,7 @@ function_profile_call(unsigned long ip, unsigned long parent_ip)if (!ftrace_profile_enabled)return ;
Quoted 4 lines
kernel/trace/ftrace.c function_profile_call(unsigned long ip, unsigned long parent_ip) · line 615
Quoted 2 lines
kernel/trace/ftrace.c +1
-1-local_irq_save (flags); +local_irq_save_nmi (flags);These are equivalent for non sparc archs, correct?
Yes.
Quoted 3 lines
If so,
Acked-by Steven Rostedt <[email protected]>
From: David Miller <[email protected]>
Date: Tue, 06 Apr 2010 16:40:02 -0700 (PDT)
Quoted 2 lines
Signed-off-by David S. Miller <[email protected]>
Peter, I found one more file that needs this annotation while implementing function graph tracing support on sparc64.
Please add this to the original patch when you queue it up, thanks.
kernel/trace/trace_functions_graph.c +4 -4
@@ -220,7 +220,7 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)if (!(trace->depth ||ftrace_graph_addr (trace->func)))return 0 ; -local_irq_save (flags); +local_irq_save_nmi (flags); cpu =raw_smp_processor_id (); data = tr->data[cpu]; disabled =atomic_inc_return (&data->disabled);
@@ -232,7 +232,7 @@ int trace_graph_entry(struct ftrace_graph_ent *trace) }atomic_dec (&data->disabled); -local_irq_restore (flags); +local_irq_restore_nmi (flags);return ret; }
@@ -277,7 +277,7 @@ void trace_graph_return(struct ftrace_graph_ret *trace)int cpu;int pc; -local_irq_save (flags); +local_irq_save_nmi (flags); cpu =raw_smp_processor_id (); data = tr->data[cpu]; disabled =atomic_inc_return (&data->disabled);
@@ -286,7 +286,7 @@ void trace_graph_return(struct ftrace_graph_ret *trace)__trace_graph_return (tr, trace, flags, pc); }atomic_dec (&data->disabled); -local_irq_restore (flags); +local_irq_restore_nmi (flags); }void set_graph_array (struct trace_array *tr)