linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ftrace/samples: Fix function size computation
@ 2025-08-26 10:13 Vladimir Riabchun
  2025-08-26 13:48 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Riabchun @ 2025-08-26 10:13 UTC (permalink / raw)
  To: rostedt; +Cc: mhiramat, mark.rutland, linux-kernel, linux-trace-kernel

In my_tramp1 function ASM_RET instruction was placed below
.size directive, leading to a wrong function size.

Fixes: 9d907f1ae80b ("samples/ftrace: Fix asm function ELF annotations")
Signed-off-by: Vladimir Riabchun <ferr.lambarginio@gmail.com>
---
 samples/ftrace/ftrace-direct-modify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/samples/ftrace/ftrace-direct-modify.c b/samples/ftrace/ftrace-direct-modify.c
index cfea7a38befb..da3a9f2091f5 100644
--- a/samples/ftrace/ftrace-direct-modify.c
+++ b/samples/ftrace/ftrace-direct-modify.c
@@ -75,8 +75,8 @@ asm (
 	CALL_DEPTH_ACCOUNT
 "	call my_direct_func1\n"
 "	leave\n"
-"	.size		my_tramp1, .-my_tramp1\n"
 	ASM_RET
+"	.size		my_tramp1, .-my_tramp1\n"
 
 "	.type		my_tramp2, @function\n"
 "	.globl		my_tramp2\n"
-- 
2.43.0


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

* Re: [PATCH] ftrace/samples: Fix function size computation
  2025-08-26 10:13 [PATCH] ftrace/samples: Fix function size computation Vladimir Riabchun
@ 2025-08-26 13:48 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2025-08-26 13:48 UTC (permalink / raw)
  To: Vladimir Riabchun
  Cc: mhiramat, mark.rutland, linux-kernel, linux-trace-kernel,
	Josh Poimboeuf

On Tue, 26 Aug 2025 12:13:44 +0200
Vladimir Riabchun <ferr.lambarginio@gmail.com> wrote:

> In my_tramp1 function ASM_RET instruction was placed below
> .size directive, leading to a wrong function size.

Looking at the Fixes commit, it appears that the .size directive was placed
above the ret instruction ;-)

-- Steve


> 
> Fixes: 9d907f1ae80b ("samples/ftrace: Fix asm function ELF annotations")
> Signed-off-by: Vladimir Riabchun <ferr.lambarginio@gmail.com>
> ---
>  samples/ftrace/ftrace-direct-modify.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/samples/ftrace/ftrace-direct-modify.c b/samples/ftrace/ftrace-direct-modify.c
> index cfea7a38befb..da3a9f2091f5 100644
> --- a/samples/ftrace/ftrace-direct-modify.c
> +++ b/samples/ftrace/ftrace-direct-modify.c
> @@ -75,8 +75,8 @@ asm (
>  	CALL_DEPTH_ACCOUNT
>  "	call my_direct_func1\n"
>  "	leave\n"
> -"	.size		my_tramp1, .-my_tramp1\n"
>  	ASM_RET
> +"	.size		my_tramp1, .-my_tramp1\n"
>  
>  "	.type		my_tramp2, @function\n"
>  "	.globl		my_tramp2\n"


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

end of thread, other threads:[~2025-08-26 13:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 10:13 [PATCH] ftrace/samples: Fix function size computation Vladimir Riabchun
2025-08-26 13:48 ` Steven Rostedt

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).