Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1472428 > unrolled thread

Re: [PATCH 2/6] oprofile/x86: add regs->ip to oprofile trace

Started byRobert Richter <rric@kernel.org>
First post2016-08-30 13:40 +0200
Last post2016-08-30 13:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/6] oprofile/x86: add regs->ip to oprofile trace Robert Richter <rric@kernel.org> - 2016-08-30 13:40 +0200

#1472428 — Re: [PATCH 2/6] oprofile/x86: add regs->ip to oprofile trace

FromRobert Richter <rric@kernel.org>
Date2016-08-30 13:40 +0200
SubjectRe: [PATCH 2/6] oprofile/x86: add regs->ip to oprofile trace
Message-ID<sbPyy-4bb-17@gated-at.bofh.it>
On 24.08.16 11:50:15, Josh Poimboeuf wrote:
> dump_trace() doesn't add the interrupted instruction's address to the
> trace, so add it manually.  This makes the profile more useful, and also
> makes it more consistent with what perf profiling does.
> 
> Cc: Robert Richter <rric@kernel.org>
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> ---
>  arch/x86/oprofile/backtrace.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/oprofile/backtrace.c b/arch/x86/oprofile/backtrace.c
> index cb31a44..2ef6c8b 100644
> --- a/arch/x86/oprofile/backtrace.c
> +++ b/arch/x86/oprofile/backtrace.c
> @@ -114,9 +114,16 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)
>  
>  	if (!user_mode(regs)) {
>  		unsigned long stack = kernel_stack_pointer(regs);
> -		if (depth)
> -			dump_trace(NULL, regs, (unsigned long *)stack, 0,
> -				   &backtrace_ops, &depth);
> +
> +		if (!depth)
> +			return;
> +
> +		oprofile_add_trace(regs->ip);
> +		if (!--depth)
> +			return;
> +
> +		dump_trace(NULL, regs, (unsigned long *)stack, 0,
> +			   &backtrace_ops, &depth);

Acked-by: Robert Richter <rric@kernel.org>

Adding oprofile-list in case someone has objections since this may
break userland tools.

Ingo, please apply the patch to tip once this series is ok to you.

Thanks,

-Robert

>  		return;
>  	}
>  
> -- 
> 2.7.4
> 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web