linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ftrace: fix function graph tracer
@ 2012-02-17 16:09 Rajesh Bhagat
  2012-02-17 17:22 ` Steven Rostedt
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rajesh Bhagat @ 2012-02-17 16:09 UTC (permalink / raw)
  To: Steven Rostedt, Frederic Weisbecker, Ingo Molnar; +Cc: linux-kernel

>From 31f8971a19b45aae8227c6d143a6ecde26fa68b2 Mon Sep 17 00:00:00 2001
From: Rajesh Bhagat <rajesh.lnx@gmail.com>
Date: Fri, 17 Feb 2012 13:59:15 +0530
Subject: [PATCH 1/1] ftrace: fix function graph tracer

when function tracer is set - function_graph tracer is not working
Problem occurs when CONFIG_DYNAMIC_FTRACE is not set

Output before patch
/debug/tracing # echo function > current_tracer
/debug/tracing # echo function_graph > current_tracer
/debug/tracing # cat trace

Output after patch
/debug/tracing # echo function > current_tracer
/debug/tracing # echo function_graph > current_tracer
/debug/tracing # cat trace
0) ! 253.375 us | } /* irq_enter */
0) | generic_handle_irq() {
0) | handle_fasteoi_irq() {
0) 9.208 us | _raw_spin_lock();
0) | handle_irq_event() {
0) | handle_irq_event_percpu() {

Signed-off-by: Rajesh Bhagat <rajesh.lnx@gmail.com>
---
 kernel/trace/ftrace.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 683d559..dc2de98 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -219,7 +219,8 @@ static void update_ftrace_function(void)
 #else
    __ftrace_trace_function = func;
 #endif
-   ftrace_trace_function = ftrace_test_stop_func;
+   ftrace_trace_function =
+       (func == ftrace_stub) ? func : ftrace_test_stop_func;
 #endif
 }
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] ftrace: fix function graph tracer
  2012-02-17 16:09 [PATCH 1/1] ftrace: fix function graph tracer Rajesh Bhagat
@ 2012-02-17 17:22 ` Steven Rostedt
  2012-03-03  5:06 ` Steven Rostedt
  2012-03-13 13:36 ` Steven Rostedt
  2 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2012-02-17 17:22 UTC (permalink / raw)
  To: Rajesh Bhagat; +Cc: Frederic Weisbecker, Ingo Molnar, linux-kernel

On Fri, 2012-02-17 at 21:39 +0530, Rajesh Bhagat wrote:

> ---
>  kernel/trace/ftrace.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 683d559..dc2de98 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -219,7 +219,8 @@ static void update_ftrace_function(void)
>  #else
>     __ftrace_trace_function = func;
>  #endif
> -   ftrace_trace_function = ftrace_test_stop_func;
> +   ftrace_trace_function =
> +       (func == ftrace_stub) ? func : ftrace_test_stop_func;
>  #endif
>  }

Nice catch! This should also go into stable. When I get back from the
conference I'll start getting it upstream.

Thanks,

-- Steve



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] ftrace: fix function graph tracer
  2012-02-17 16:09 [PATCH 1/1] ftrace: fix function graph tracer Rajesh Bhagat
  2012-02-17 17:22 ` Steven Rostedt
@ 2012-03-03  5:06 ` Steven Rostedt
  2012-03-13 13:36 ` Steven Rostedt
  2 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2012-03-03  5:06 UTC (permalink / raw)
  To: Rajesh Bhagat; +Cc: Frederic Weisbecker, Ingo Molnar, linux-kernel

On Fri, 2012-02-17 at 21:39 +0530, Rajesh Bhagat wrote:
> >From 31f8971a19b45aae8227c6d143a6ecde26fa68b2 Mon Sep 17 00:00:00 2001
> From: Rajesh Bhagat <rajesh.lnx@gmail.com>
> Date: Fri, 17 Feb 2012 13:59:15 +0530
> Subject: [PATCH 1/1] ftrace: fix function graph tracer
> 
> when function tracer is set - function_graph tracer is not working
> Problem occurs when CONFIG_DYNAMIC_FTRACE is not set
> 
> Output before patch
> /debug/tracing # echo function > current_tracer
> /debug/tracing # echo function_graph > current_tracer
> /debug/tracing # cat trace

I can't reproduce this. What arch did you see this on? I'm trying it on
PPC and x86, and it works fine.

Now I'm not saying I wont take this patch, because it is a correctness
issue. But I'm thinking this will go into the 3.4 queue.

-- Steve


> 
> Output after patch
> /debug/tracing # echo function > current_tracer
> /debug/tracing # echo function_graph > current_tracer
> /debug/tracing # cat trace
> 0) ! 253.375 us | } /* irq_enter */
> 0) | generic_handle_irq() {
> 0) | handle_fasteoi_irq() {
> 0) 9.208 us | _raw_spin_lock();
> 0) | handle_irq_event() {
> 0) | handle_irq_event_percpu() {
> 
> Signed-off-by: Rajesh Bhagat <rajesh.lnx@gmail.com>
> ---
>  kernel/trace/ftrace.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 683d559..dc2de98 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -219,7 +219,8 @@ static void update_ftrace_function(void)
>  #else
>     __ftrace_trace_function = func;
>  #endif
> -   ftrace_trace_function = ftrace_test_stop_func;
> +   ftrace_trace_function =
> +       (func == ftrace_stub) ? func : ftrace_test_stop_func;
>  #endif
>  }



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] ftrace: fix function graph tracer
  2012-02-17 16:09 [PATCH 1/1] ftrace: fix function graph tracer Rajesh Bhagat
  2012-02-17 17:22 ` Steven Rostedt
  2012-03-03  5:06 ` Steven Rostedt
@ 2012-03-13 13:36 ` Steven Rostedt
  2012-03-16  5:06   ` Rajesh Bhagat
  2 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2012-03-13 13:36 UTC (permalink / raw)
  To: Rajesh Bhagat; +Cc: Frederic Weisbecker, Ingo Molnar, linux-kernel


> Signed-off-by: Rajesh Bhagat <rajesh.lnx@gmail.com>
> ---
>  kernel/trace/ftrace.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 683d559..dc2de98 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -219,7 +219,8 @@ static void update_ftrace_function(void)
>  #else
>     __ftrace_trace_function = func;
>  #endif
> -   ftrace_trace_function = ftrace_test_stop_func;
> +   ftrace_trace_function =
> +       (func == ftrace_stub) ? func : ftrace_test_stop_func;
>  #endif
>  }

BTW, this patch has major whitespace issues. It does not apply.

-- Steve



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] ftrace: fix function graph tracer
  2012-03-13 13:36 ` Steven Rostedt
@ 2012-03-16  5:06   ` Rajesh Bhagat
  0 siblings, 0 replies; 5+ messages in thread
From: Rajesh Bhagat @ 2012-03-16  5:06 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Frederic Weisbecker, Ingo Molnar, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

Hello Steve,

Sorry this is the first time im doing this, so i just copied the patch
in gmail.
Please find the correct patch attached to this email, with 0
checkpatch.pl errors.

[bhagatr@linux git]$ vi 0001-ftrace-fix-function-graph-tracer.patch
(reverse-i-search)`':
[bhagatr@linux git]$ ./linux-2.6/scripts/checkpatch.pl
0001-ftrace-fix-function-graph-tracer.patch
total: 0 errors, 0 warnings, 9 lines checked

I will also try to send a V2 of this patch, as soon my "git
send-email" is up and running.

- Rajesh

On Tue, Mar 13, 2012 at 7:06 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
>
>
> > Signed-off-by: Rajesh Bhagat <rajesh.lnx@gmail.com>
> > ---
> >  kernel/trace/ftrace.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> > index 683d559..dc2de98 100644
> > --- a/kernel/trace/ftrace.c
> > +++ b/kernel/trace/ftrace.c
> > @@ -219,7 +219,8 @@ static void update_ftrace_function(void)
> >  #else
> >     __ftrace_trace_function = func;
> >  #endif
> > -   ftrace_trace_function = ftrace_test_stop_func;
> > +   ftrace_trace_function =
> > +       (func == ftrace_stub) ? func : ftrace_test_stop_func;
> >  #endif
> >  }
>
> BTW, this patch has major whitespace issues. It does not apply.
>
> -- Steve
>
>

[-- Attachment #2: 0001-ftrace-fix-function-graph-tracer.patch --]
[-- Type: application/octet-stream, Size: 1363 bytes --]

From 31f8971a19b45aae8227c6d143a6ecde26fa68b2 Mon Sep 17 00:00:00 2001
From: Rajesh Bhagat <rajesh.lnx@gmail.com>
Date: Fri, 17 Feb 2012 13:59:15 +0530
Subject: [PATCH 1/1] ftrace: fix function graph tracer

when function tracer is set - function_graph tracer is not working
Problem occurs when CONFIG_DYNAMIC_FTRACE is not set

Output before patch
/debug/tracing # echo function > current_tracer
/debug/tracing # echo function_graph > current_tracer
/debug/tracing # cat trace

Output after patch
/debug/tracing # echo function > current_tracer
/debug/tracing # echo function_graph > current_tracer
/debug/tracing # cat trace
0) ! 253.375 us | } /* irq_enter */
0) | generic_handle_irq() {
0) | handle_fasteoi_irq() {
0) 9.208 us | _raw_spin_lock();
0) | handle_irq_event() {
0) | handle_irq_event_percpu() {

Signed-off-by: Rajesh Bhagat <rajesh.lnx@gmail.com>
---
 kernel/trace/ftrace.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 683d559..dc2de98 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -219,7 +219,8 @@ static void update_ftrace_function(void)
 #else
 	__ftrace_trace_function = func;
 #endif
-	ftrace_trace_function = ftrace_test_stop_func;
+	ftrace_trace_function =
+		(func == ftrace_stub) ? func : ftrace_test_stop_func;
 #endif
 }
 
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-16  5:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-17 16:09 [PATCH 1/1] ftrace: fix function graph tracer Rajesh Bhagat
2012-02-17 17:22 ` Steven Rostedt
2012-03-03  5:06 ` Steven Rostedt
2012-03-13 13:36 ` Steven Rostedt
2012-03-16  5:06   ` Rajesh Bhagat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).