Re: [PATCH v16 09/18] tracing: Add ftrace_fill_perf_regs() for perf event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 15, 2024 at 10:30:15AM +0900, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
> 
> Add ftrace_fill_perf_regs() which should be compatible with the
> perf_fetch_caller_regs(). In other words, the pt_regs returned from the
> ftrace_fill_perf_regs() must satisfy 'user_mode(regs) == false' and can be
> used for stack tracing.
> 
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
> ---
>   Changes from previous series: NOTHING, just forward ported.
> ---
>  arch/s390/include/asm/ftrace.h    |    5 +++++

...

> diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h
> index 5c94c1fc1bc1..f1c0e677a325 100644
> --- a/arch/s390/include/asm/ftrace.h
> +++ b/arch/s390/include/asm/ftrace.h
> @@ -76,6 +76,11 @@ ftrace_regs_get_frame_pointer(struct ftrace_regs *fregs)
>  	return ftrace_regs_get_stack_pointer(fregs);
>  }
>  
> +#define arch_ftrace_fill_perf_regs(fregs, _regs)	 do {		\
> +		(_regs)->psw.addr = arch_ftrace_regs(fregs)->regs.psw.addr;		\
> +		(_regs)->gprs[15] = arch_ftrace_regs(fregs)->regs.gprs[15];		\
> +	} while (0)
> +

This misses the feedback I gave for v15:
https://lore.kernel.org/all/20241009100502.8007-E-hca@xxxxxxxxxxxxx




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux