Skip to contentSkip to conversation

riscv : select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY

PATCH RESEND Superseded Song Shuai 2 participants 4 messages Sep 23, 2022 – Nov 28, 2022 RISC-V

v1 of 11 Superseded Latest is v11 →

lore
Share & tools
lore

Song Shuai

author
#0 lore raw

PATCH RESEND 1/1 riscv : select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY

riscv now uses -fpatchable-function-entry with dynamic ftrace after the afc76b8b8 commit, which means recordmcount shouldn't be called to create the __mcount_loc section before the vmlinux linking.

We should select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY to tell Makefile not to run recordmcount.

---
 arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/Kconfig +1 -0
index c22f58155948..25db8cea876a 100644
@@ -246,6 +246,7 @@ config ARCH_RV64I
 	select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8)
 	select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
 	select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
+	select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY if DYNAMIC_FTRACE
 	select HAVE_FUNCTION_GRAPH_TRACER
 	select HAVE_FUNCTION_TRACER if !XIP_KERNEL
 	select SWIOTLB if MMU
Signature · 7 lines
2.20.1


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
author
#1 lore raw
Quoted 8 lines · Song Shuai <[email protected]> 于2022年9月23日周五 10:03写道:

riscv now uses -fpatchable-function-entry with dynamic ftrace after the afc76b8b8 commit, which means recordmcount shouldn't be called to create the __mcount_loc section before the vmlinux linking.

We should select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY to tell Makefile not to run recordmcount.

Hi,Guo:

Can this patch squeeze into your v3 series ?

Thanks,
Song

Quoted 20 lines
---
 arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/Kconfig +1 -1
index c22f58155948..25db8cea876a 100644
@@ -246,6 +246,7 @@ config ARCH_RV64I
        select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8)
        select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
        select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
+       select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY if DYNAMIC_FTRACE
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_FUNCTION_TRACER if !XIP_KERNEL
        select SWIOTLB if MMU
--

2.20.1

Tested-by
#2 lore raw
Quoted 5 lines · Song Shuai
Quoted 3 lines · Song Shuai <[email protected]> 于2022年9月23日周五 10:03写道:

riscv now uses -fpatchable-function-entry with dynamic ftrace after the afc76b8b8 commit, which means recordmcount shouldn't be called

The ref commit format needs to be corrected. Others:

Quoted 8 lines
Quoted 5 lines

to create the __mcount_loc section before the vmlinux linking.

We should select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY to tell Makefile not to run recordmcount.

Hi,Guo:

Can this patch squeeze into your v3 series ?

They don't have a dependency, and it's unnecessary. A single patch is easy for the maintainer to pick up.

Quoted 23 lines

Thanks,
Song

Quoted 20 lines
---
 arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/Kconfig +1 -1
index c22f58155948..25db8cea876a 100644
@@ -246,6 +246,7 @@ config ARCH_RV64I
        select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8)
        select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
        select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
+       select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY if DYNAMIC_FTRACE
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_FUNCTION_TRACER if !XIP_KERNEL
        select SWIOTLB if MMU
--

2.20.1

Signature · 7 lines
Best Regards
 Guo Ren

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
author
#3 lore raw
Quoted 10 lines · Guo Ren <[email protected]> 于2022年11月28日周一 21:47写道:
Quoted 5 lines · Song Shuai
Quoted 3 lines · Song Shuai <[email protected]> 于2022年9月23日周五 10:03写道:

riscv now uses -fpatchable-function-entry with dynamic ftrace after the afc76b8b8 commit, which means recordmcount shouldn't be called

The ref commit format needs to be corrected. Others:

Thanks for your test.
I'll correct this ref in the next version.

Quoted 11 lines
Quoted 8 lines
Quoted 5 lines

to create the __mcount_loc section before the vmlinux linking.

We should select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY to tell Makefile not to run recordmcount.

Hi,Guo:

Can this patch squeeze into your v3 series ?

They don't have a dependency, and it's unnecessary. A single patch is easy for the maintainer to pick up.

Got it.

Quoted 29 lines
Quoted 8 lines

Thanks,
Song

Quoted 5 lines
---
 arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)
Quoted 15 lines
Quoted 13 lines
arch/riscv/Kconfig +1 -1
index c22f58155948..25db8cea876a 100644
@@ -246,6 +246,7 @@ config ARCH_RV64I
        select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8)
        select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
        select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
+       select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY if DYNAMIC_FTRACE
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_FUNCTION_TRACER if !XIP_KERNEL
        select SWIOTLB if MMU
--
Quoted 2 lines

2.20.1

--
Best Regards
Guo Ren

Signature · 2 lines
Thanks,
Song