All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: ftrace: Trace function entry before updating index
@ 2012-07-17  2:03 ` Colin Cross
  0 siblings, 0 replies; 6+ messages in thread
From: Colin Cross @ 2012-07-17  2:03 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Colin Cross, Steven Rostedt, Frederic Weisbecker, Ingo Molnar,
	Russell King, linux-kernel

Commit 722b3c74695377d11d18a52f3da08114d37f3f37 modified x86 ftrace to
avoid tracing all functions called from irqs when function graph was
used with a filter.  Port the same fix to ARM.

Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Colin Cross <ccross@android.com>
---

It looks like the same issue affects blackfin, microblaze, mips,
parisc, powerpc, s390, sh, and sparc, but I don't have patches to
fix those.

 arch/arm/kernel/ftrace.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c
index df0bf0c..34e5664 100644
--- a/arch/arm/kernel/ftrace.c
+++ b/arch/arm/kernel/ftrace.c
@@ -179,19 +179,20 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
 	old = *parent;
 	*parent = return_hooker;
 
-	err = ftrace_push_return_trace(old, self_addr, &trace.depth,
-				       frame_pointer);
-	if (err == -EBUSY) {
-		*parent = old;
-		return;
-	}
-
 	trace.func = self_addr;
+	trace.depth = current->curr_ret_stack + 1;
 
 	/* Only trace if the calling function expects to */
 	if (!ftrace_graph_entry(&trace)) {
-		current->curr_ret_stack--;
 		*parent = old;
+		return;
+	}
+
+	err = ftrace_push_return_trace(old, self_addr, &trace.depth,
+				       frame_pointer);
+	if (err == -EBUSY) {
+		*parent = old;
+		return;
 	}
 }
 
-- 
1.7.7.3


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

* [PATCH] ARM: ftrace: Trace function entry before updating index
@ 2012-07-17  2:03 ` Colin Cross
  0 siblings, 0 replies; 6+ messages in thread
From: Colin Cross @ 2012-07-17  2:03 UTC (permalink / raw)
  To: linux-arm-kernel

Commit 722b3c74695377d11d18a52f3da08114d37f3f37 modified x86 ftrace to
avoid tracing all functions called from irqs when function graph was
used with a filter.  Port the same fix to ARM.

Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Colin Cross <ccross@android.com>
---

It looks like the same issue affects blackfin, microblaze, mips,
parisc, powerpc, s390, sh, and sparc, but I don't have patches to
fix those.

 arch/arm/kernel/ftrace.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c
index df0bf0c..34e5664 100644
--- a/arch/arm/kernel/ftrace.c
+++ b/arch/arm/kernel/ftrace.c
@@ -179,19 +179,20 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
 	old = *parent;
 	*parent = return_hooker;
 
-	err = ftrace_push_return_trace(old, self_addr, &trace.depth,
-				       frame_pointer);
-	if (err == -EBUSY) {
-		*parent = old;
-		return;
-	}
-
 	trace.func = self_addr;
+	trace.depth = current->curr_ret_stack + 1;
 
 	/* Only trace if the calling function expects to */
 	if (!ftrace_graph_entry(&trace)) {
-		current->curr_ret_stack--;
 		*parent = old;
+		return;
+	}
+
+	err = ftrace_push_return_trace(old, self_addr, &trace.depth,
+				       frame_pointer);
+	if (err == -EBUSY) {
+		*parent = old;
+		return;
 	}
 }
 
-- 
1.7.7.3

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

* Re: [PATCH] ARM: ftrace: Trace function entry before updating index
  2012-07-17  2:03 ` Colin Cross
@ 2012-07-18 17:38   ` Steven Rostedt
  -1 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2012-07-18 17:38 UTC (permalink / raw)
  To: Colin Cross
  Cc: linux-arm-kernel, Frederic Weisbecker, Ingo Molnar, Russell King,
	linux-kernel

On Mon, 2012-07-16 at 19:03 -0700, Colin Cross wrote:
> Commit 722b3c74695377d11d18a52f3da08114d37f3f37 modified x86 ftrace to
> avoid tracing all functions called from irqs when function graph was
> used with a filter.  Port the same fix to ARM.
> 
> Cc: Steven Rostedt <rostedt@goodmis.org>

Acked-by: Steven Rostedt <rostedt@goodmis.org>

Someone on the ARM side needs to pull this in.

I'll look into fixing this for PPC.

Thanks!

-- Steve

> Signed-off-by: Colin Cross <ccross@android.com>
> ---
> 
> It looks like the same issue affects blackfin, microblaze, mips,
> parisc, powerpc, s390, sh, and sparc, but I don't have patches to
> fix those.
> 
>  arch/arm/kernel/ftrace.c |   17 +++++++++--------
>  1 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c
> index df0bf0c..34e5664 100644
> --- a/arch/arm/kernel/ftrace.c
> +++ b/arch/arm/kernel/ftrace.c
> @@ -179,19 +179,20 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
>  	old = *parent;
>  	*parent = return_hooker;
>  
> -	err = ftrace_push_return_trace(old, self_addr, &trace.depth,
> -				       frame_pointer);
> -	if (err == -EBUSY) {
> -		*parent = old;
> -		return;
> -	}
> -
>  	trace.func = self_addr;
> +	trace.depth = current->curr_ret_stack + 1;
>  
>  	/* Only trace if the calling function expects to */
>  	if (!ftrace_graph_entry(&trace)) {
> -		current->curr_ret_stack--;
>  		*parent = old;
> +		return;
> +	}
> +
> +	err = ftrace_push_return_trace(old, self_addr, &trace.depth,
> +				       frame_pointer);
> +	if (err == -EBUSY) {
> +		*parent = old;
> +		return;
>  	}
>  }
>  



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

* [PATCH] ARM: ftrace: Trace function entry before updating index
@ 2012-07-18 17:38   ` Steven Rostedt
  0 siblings, 0 replies; 6+ messages in thread
From: Steven Rostedt @ 2012-07-18 17:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 2012-07-16 at 19:03 -0700, Colin Cross wrote:
> Commit 722b3c74695377d11d18a52f3da08114d37f3f37 modified x86 ftrace to
> avoid tracing all functions called from irqs when function graph was
> used with a filter.  Port the same fix to ARM.
> 
> Cc: Steven Rostedt <rostedt@goodmis.org>

Acked-by: Steven Rostedt <rostedt@goodmis.org>

Someone on the ARM side needs to pull this in.

I'll look into fixing this for PPC.

Thanks!

-- Steve

> Signed-off-by: Colin Cross <ccross@android.com>
> ---
> 
> It looks like the same issue affects blackfin, microblaze, mips,
> parisc, powerpc, s390, sh, and sparc, but I don't have patches to
> fix those.
> 
>  arch/arm/kernel/ftrace.c |   17 +++++++++--------
>  1 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c
> index df0bf0c..34e5664 100644
> --- a/arch/arm/kernel/ftrace.c
> +++ b/arch/arm/kernel/ftrace.c
> @@ -179,19 +179,20 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
>  	old = *parent;
>  	*parent = return_hooker;
>  
> -	err = ftrace_push_return_trace(old, self_addr, &trace.depth,
> -				       frame_pointer);
> -	if (err == -EBUSY) {
> -		*parent = old;
> -		return;
> -	}
> -
>  	trace.func = self_addr;
> +	trace.depth = current->curr_ret_stack + 1;
>  
>  	/* Only trace if the calling function expects to */
>  	if (!ftrace_graph_entry(&trace)) {
> -		current->curr_ret_stack--;
>  		*parent = old;
> +		return;
> +	}
> +
> +	err = ftrace_push_return_trace(old, self_addr, &trace.depth,
> +				       frame_pointer);
> +	if (err == -EBUSY) {
> +		*parent = old;
> +		return;
>  	}
>  }
>  

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

* Re: [PATCH] ARM: ftrace: Trace function entry before updating index
  2012-07-18 17:38   ` Steven Rostedt
@ 2012-07-18 18:10     ` Colin Cross
  -1 siblings, 0 replies; 6+ messages in thread
From: Colin Cross @ 2012-07-18 18:10 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: linux-arm-kernel, Frederic Weisbecker, Ingo Molnar, Russell King,
	linux-kernel

On Wed, Jul 18, 2012 at 10:38 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Mon, 2012-07-16 at 19:03 -0700, Colin Cross wrote:
>> Commit 722b3c74695377d11d18a52f3da08114d37f3f37 modified x86 ftrace to
>> avoid tracing all functions called from irqs when function graph was
>> used with a filter.  Port the same fix to ARM.
>>
>> Cc: Steven Rostedt <rostedt@goodmis.org>
>
> Acked-by: Steven Rostedt <rostedt@goodmis.org>
>
> Someone on the ARM side needs to pull this in.
>
> I'll look into fixing this for PPC.
>
> Thanks!

Thanks, I'll put it in Russell's patch tracker.

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

* [PATCH] ARM: ftrace: Trace function entry before updating index
@ 2012-07-18 18:10     ` Colin Cross
  0 siblings, 0 replies; 6+ messages in thread
From: Colin Cross @ 2012-07-18 18:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 18, 2012 at 10:38 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Mon, 2012-07-16 at 19:03 -0700, Colin Cross wrote:
>> Commit 722b3c74695377d11d18a52f3da08114d37f3f37 modified x86 ftrace to
>> avoid tracing all functions called from irqs when function graph was
>> used with a filter.  Port the same fix to ARM.
>>
>> Cc: Steven Rostedt <rostedt@goodmis.org>
>
> Acked-by: Steven Rostedt <rostedt@goodmis.org>
>
> Someone on the ARM side needs to pull this in.
>
> I'll look into fixing this for PPC.
>
> Thanks!

Thanks, I'll put it in Russell's patch tracker.

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

end of thread, other threads:[~2012-07-18 18:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17  2:03 [PATCH] ARM: ftrace: Trace function entry before updating index Colin Cross
2012-07-17  2:03 ` Colin Cross
2012-07-18 17:38 ` Steven Rostedt
2012-07-18 17:38   ` Steven Rostedt
2012-07-18 18:10   ` Colin Cross
2012-07-18 18:10     ` Colin Cross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.