mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5] Enable some configs in loongson3_defconfig
@ 2025-04-30 13:15 Tiezhu Yang
  2025-04-30 13:15 ` [PATCH 1/5] LoongArch: Clean up loongson3_defconfig Tiezhu Yang
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Tiezhu Yang @ 2025-04-30 13:15 UTC (permalink / raw)
  To: Huacai Chen; +Cc: loongarch, linux-kernel

This is a small patchset based on 6.15-rc4, each patch is a
single logical change to better describe the problem and make
it easier to review.

If the changes make sense, all of them can be squashed into one
single patch, I think that would be fine as well, let us see if
other people have concern about it.

By the way, I received many compile-time error reports about tools,
most are related with configs, this is the motivation of this series.

Additionally, I also received one run-time bug report about uprobe,
but it works fine on my test environment. If somebody can reproduce
it, please let me know, maybe I am missing something.

1. How to reproduce

(1) Compile and install Tongsuo

git clone https://github.com/Tongsuo-Project/Tongsuo.git
cd Tongsuo && ./config --prefix=/opt/tongsuo -Wl,-rpath,/opt/tongsuo/lib
make && sudo make install

https://www.tongsuo.net/docs/compilation/source-compilation

(2) Compile and update kernel

Apply this series based on 6.15-rc4, then use the loongson3_defconfig,
CONFIG_UPROBE_EVENTS is already set.

(3) Probe "openssl speed sm2"

cd tools/perf && make
sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2

2. My test results

fedora@linux:~/uprobe.git/tools/perf$ sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
Added new event:
  probe_libcrypto:BN_mod_mul_montgomery (on BN_mod_mul_montgomery in /usr/lib64/libcrypto.so.3.2.2)

You can now use it in all perf tools, such as:

	perf record -e probe_libcrypto:BN_mod_mul_montgomery -aR sleep 1

fedora@linux:~/uprobe.git/tools/perf$ sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2
Doing 256 bits sign CurveSM2's for 10s: 7463 256 bits CurveSM2 signs in 10.00s 
Doing 256 bits verify CurveSM2's for 10s: 9681 256 bits CurveSM2 verify in 9.98s
...
                              sign    verify    sign/s verify/s
 256 bits SM2 (CurveSM2)   0.0013s   0.0010s    746.3    970.0

 Performance counter stats for '/opt/tongsuo/bin/openssl speed sm2':

                 0      probe_libcrypto:BN_mod_mul_montgomery                                      

      20.007539877 seconds time elapsed

      19.990010000 seconds user
       0.000000000 seconds sys

Thanks,
Tiezhu

Tiezhu Yang (5):
  LoongArch: Clean up loongson3_defconfig
  LoongArch: Enable tracing infrastructure in defconfig
  LoongArch: Enable tracing syscalls in defconfig
  LoongArch: Enable debug information in defconfig
  LoongArch: Enable kprobe and ftrace in defconfig

 arch/loongarch/configs/loongson3_defconfig | 74 +++++-----------------
 1 file changed, 16 insertions(+), 58 deletions(-)

-- 
2.42.0


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

* [PATCH 1/5] LoongArch: Clean up loongson3_defconfig
  2025-04-30 13:15 [PATCH 0/5] Enable some configs in loongson3_defconfig Tiezhu Yang
@ 2025-04-30 13:15 ` Tiezhu Yang
  2025-04-30 13:15 ` [PATCH 2/5] LoongArch: Enable tracing infrastructure in defconfig Tiezhu Yang
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Tiezhu Yang @ 2025-04-30 13:15 UTC (permalink / raw)
  To: Huacai Chen; +Cc: loongarch, linux-kernel

There are many unnecessary configs in loongson3_defconfig, clean up it
with the following steps:

  make defconfig
  make savedefconfig
  cp defconfig arch/loongarch/configs/loongson3_defconfig

Then we can get a clear diff if the defconfig is changed.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/loongarch/configs/loongson3_defconfig | 56 +---------------------
 1 file changed, 1 insertion(+), 55 deletions(-)

diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index 90f21dfe22b1..a3c9d189a627 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -45,30 +45,16 @@ CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PERF_EVENTS=y
 CONFIG_KEXEC=y
-CONFIG_CRASH_DUMP=y
-CONFIG_LOONGARCH=y
-CONFIG_64BIT=y
-CONFIG_MACH_LOONGSON64=y
-CONFIG_PAGE_SIZE_16KB=y
-CONFIG_HZ_250=y
-CONFIG_DMI=y
-CONFIG_EFI=y
-CONFIG_SMP=y
-CONFIG_HOTPLUG_CPU=y
 CONFIG_NR_CPUS=256
 CONFIG_NUMA=y
-CONFIG_CPU_HAS_FPU=y
 CONFIG_CPU_HAS_LSX=y
 CONFIG_CPU_HAS_LASX=y
 CONFIG_RANDOMIZE_BASE=y
-CONFIG_SUSPEND=y
 CONFIG_HIBERNATION=y
-CONFIG_ACPI=y
 CONFIG_ACPI_SPCR_TABLE=y
 CONFIG_ACPI_TAD=y
 CONFIG_ACPI_DOCK=y
 CONFIG_ACPI_IPMI=m
-CONFIG_ACPI_HOTPLUG_CPU=y
 CONFIG_ACPI_PCI_SLOT=y
 CONFIG_ACPI_HOTPLUG_MEMORY=y
 CONFIG_ACPI_BGRT=y
@@ -81,7 +67,6 @@ CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
 CONFIG_LOONGSON3_CPUFREQ=m
 CONFIG_VIRTUALIZATION=y
 CONFIG_KVM=m
-CONFIG_JUMP_LABEL=y
 CONFIG_MODULES=y
 CONFIG_MODULE_FORCE_LOAD=y
 CONFIG_MODULE_UNLOAD=y
@@ -104,18 +89,12 @@ CONFIG_BSD_DISKLABEL=y
 CONFIG_UNIXWARE_DISKLABEL=y
 CONFIG_CMDLINE_PARTITION=y
 CONFIG_IOSCHED_BFQ=y
-CONFIG_BFQ_GROUP_IOSCHED=y
 CONFIG_BINFMT_MISC=m
-CONFIG_ZPOOL=y
 CONFIG_ZSWAP=y
 CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD=y
-CONFIG_ZSMALLOC=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_MEMORY_HOTPLUG=y
-# CONFIG_MHP_DEFAULT_ONLINE_TYPE_OFFLINE is not set
 CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO=y
-# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_KERNEL is not set
-# CONFIG_MHP_DEFAULT_ONLINE_TYPE_ONLINE_MOVABLE is not set
 CONFIG_MEMORY_HOTREMOVE=y
 CONFIG_KSM=y
 CONFIG_TRANSPARENT_HUGEPAGE=y
@@ -124,13 +103,11 @@ CONFIG_CMA_SYSFS=y
 CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
-CONFIG_UNIX=y
 CONFIG_TLS=m
 CONFIG_TLS_DEVICE=y
 CONFIG_XFRM_USER=y
 CONFIG_NET_KEY=y
 CONFIG_XDP_SOCKETS=y
-CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 CONFIG_IP_ADVANCED_ROUTER=y
 CONFIG_IP_MULTIPLE_TABLES=y
@@ -265,7 +242,6 @@ CONFIG_IP_VS_PROTO_SCTP=y
 CONFIG_IP_VS_RR=m
 CONFIG_IP_VS_WRR=m
 CONFIG_IP_VS_NFCT=y
-CONFIG_NF_TABLES_IPV4=y
 CONFIG_NFT_DUP_IPV4=m
 CONFIG_NFT_FIB_IPV4=m
 CONFIG_NF_TABLES_ARP=y
@@ -286,10 +262,8 @@ CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
 CONFIG_IP_NF_RAW=m
 CONFIG_IP_NF_SECURITY=m
-CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
-CONFIG_NF_TABLES_IPV6=y
 CONFIG_NFT_FIB_IPV6=m
 CONFIG_IP6_NF_IPTABLES=y
 CONFIG_IP6_NF_MATCH_AH=m
@@ -319,7 +293,6 @@ CONFIG_BRIDGE_EBT_T_NAT=m
 CONFIG_BRIDGE_EBT_ARP=m
 CONFIG_BRIDGE_EBT_IP=m
 CONFIG_BRIDGE_EBT_IP6=m
-CONFIG_IP_SCTP=m
 CONFIG_RDS=y
 CONFIG_L2TP=m
 CONFIG_L2TP_V3=y
@@ -361,7 +334,6 @@ CONFIG_BT_BNEP=m
 CONFIG_BT_BNEP_MC_FILTER=y
 CONFIG_BT_BNEP_PROTO_FILTER=y
 CONFIG_BT_HIDP=m
-CONFIG_BT_HS=y
 CONFIG_BT_HCIBTUSB=m
 CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y
 CONFIG_BT_HCIBTUSB_MTK=y
@@ -387,13 +359,9 @@ CONFIG_RFKILL=m
 CONFIG_RFKILL_INPUT=y
 CONFIG_NET_9P=y
 CONFIG_NET_9P_VIRTIO=y
-CONFIG_CEPH_LIB=m
-CONFIG_PCIEPORTBUS=y
-CONFIG_HOTPLUG_PCI_PCIE=y
 CONFIG_PCIEAER=y
 # CONFIG_PCIEASPM is not set
 CONFIG_PCI_IOV=y
-CONFIG_HOTPLUG_PCI=y
 CONFIG_HOTPLUG_PCI_SHPC=y
 CONFIG_PCI_HOST_GENERIC=y
 CONFIG_PCCARD=m
@@ -497,11 +465,6 @@ CONFIG_AHCI_DWC=y
 CONFIG_PATA_ATIIXP=y
 CONFIG_PATA_PCMCIA=m
 CONFIG_MD=y
-CONFIG_BLK_DEV_MD=m
-CONFIG_MD_RAID0=m
-CONFIG_MD_RAID1=m
-CONFIG_MD_RAID10=m
-CONFIG_MD_RAID456=m
 CONFIG_BCACHE=m
 CONFIG_BLK_DEV_DM=y
 CONFIG_DM_CRYPT=m
@@ -720,7 +683,6 @@ CONFIG_SPI_LOONGSON_PLATFORM=m
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_LOONGSON2=y
 CONFIG_GPIO_SYSFS=y
-CONFIG_GPIO_LOONGSON=y
 CONFIG_GPIO_LOONGSON_64BIT=y
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_RESTART=y
@@ -769,8 +731,6 @@ CONFIG_FB_RADEON=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_LCD_CLASS_DEVICE=y
 CONFIG_LCD_PLATFORM=m
-# CONFIG_VGA_CONSOLE is not set
-CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
@@ -806,19 +766,14 @@ CONFIG_UHID=m
 CONFIG_HID_A4TECH=m
 CONFIG_HID_CHERRY=m
 CONFIG_HID_ELAN=m
-CONFIG_HID_LOGITECH=m
-CONFIG_HID_LOGITECH_DJ=m
-CONFIG_LOGITECH_FF=y
-CONFIG_LOGIRUMBLEPAD2_FF=y
-CONFIG_LOGIG940_FF=y
 CONFIG_HID_MICROSOFT=m
 CONFIG_HID_MULTITOUCH=m
 CONFIG_HID_SUNPLUS=m
 CONFIG_HID_WACOM=m
-CONFIG_USB_HIDDEV=y
 CONFIG_I2C_HID_ACPI=m
 CONFIG_I2C_HID_OF=m
 CONFIG_I2C_HID_OF_ELAN=m
+CONFIG_USB_HIDDEV=y
 CONFIG_USB=y
 CONFIG_USB_OTG=y
 CONFIG_USB_MON=y
@@ -938,8 +893,6 @@ CONFIG_FS_ENCRYPTION_INLINE_CRYPT=y
 CONFIG_FS_VERITY=y
 CONFIG_FANOTIFY=y
 CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
-CONFIG_QUOTA=y
-# CONFIG_PRINT_QUOTA_WARNING is not set
 CONFIG_QFMT_V1=m
 CONFIG_QFMT_V2=m
 CONFIG_AUTOFS_FS=y
@@ -950,8 +903,6 @@ CONFIG_OVERLAY_FS=y
 CONFIG_OVERLAY_FS_INDEX=y
 CONFIG_OVERLAY_FS_XINO_AUTO=y
 CONFIG_OVERLAY_FS_METACOPY=y
-CONFIG_FSCACHE=y
-CONFIG_CACHEFILES=m
 CONFIG_ISO9660_FS=y
 CONFIG_JOLIET=y
 CONFIG_ZISOFS=y
@@ -988,7 +939,6 @@ CONFIG_SQUASHFS_ZSTD=y
 CONFIG_MINIX_FS=m
 CONFIG_ROMFS_FS=m
 CONFIG_PSTORE=m
-CONFIG_PSTORE_COMPRESS=y
 CONFIG_UFS_FS=m
 CONFIG_EROFS_FS=m
 CONFIG_EROFS_FS_ZIP_LZMA=y
@@ -1040,8 +990,6 @@ CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_CHACHA20POLY1305=m
 CONFIG_CRYPTO_WP512=m
-CONFIG_CRYPTO_DEFLATE=m
-CONFIG_CRYPTO_LZO=m
 CONFIG_CRYPTO_842=m
 CONFIG_CRYPTO_LZ4=m
 CONFIG_CRYPTO_LZ4HC=m
@@ -1057,8 +1005,6 @@ CONFIG_PRINTK_TIME=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-# CONFIG_SCHED_DEBUG is not set
 CONFIG_SCHEDSTATS=y
-# CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
 CONFIG_UNWINDER_ORC=y
-- 
2.42.0


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

* [PATCH 2/5] LoongArch: Enable tracing infrastructure in defconfig
  2025-04-30 13:15 [PATCH 0/5] Enable some configs in loongson3_defconfig Tiezhu Yang
  2025-04-30 13:15 ` [PATCH 1/5] LoongArch: Clean up loongson3_defconfig Tiezhu Yang
@ 2025-04-30 13:15 ` Tiezhu Yang
  2025-04-30 13:15 ` [PATCH 3/5] LoongArch: Enable tracing syscalls " Tiezhu Yang
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Tiezhu Yang @ 2025-04-30 13:15 UTC (permalink / raw)
  To: Huacai Chen; +Cc: loongarch, linux-kernel

When executing the command "perf list", I met "Error: failed to open
tracing events directory" twice, the first reason is that there is no
"/sys/kernel/tracing/events" directory due to it does not enable the
kernel tracing infrastructure with CONFIG_FTRACE, the second reason
is that there is no root privileges.

Although the error string was added to tell the users what happened
and what should to do in commit b48543c451c3 ("perf list: Give clues
if failed to open tracing events directory"), it is better to enable
CONFIG_FTRACE in defconfig to avoid the error message at runtime:

  $ ./perf list
  Error: failed to open tracing events directory
  /sys/kernel/tracing/events: No such file or directory

Additionally, CONFIG_UPROBE_EVENTS is default y only if CONFIG_FTRACE
is set, otherwise there exists the following error:

  $ ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
  /sys/kernel/tracing//uprobe_events does not exist.
  Please rebuild kernel with CONFIG_UPROBE_EVENTS=y.
    Error: Failed to add events.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/loongarch/configs/loongson3_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index a3c9d189a627..eaaf3419555c 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -1006,5 +1006,4 @@ CONFIG_STRIP_ASM_SYMS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_SCHEDSTATS=y
-# CONFIG_FTRACE is not set
 CONFIG_UNWINDER_ORC=y
-- 
2.42.0


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

* [PATCH 3/5] LoongArch: Enable tracing syscalls in defconfig
  2025-04-30 13:15 [PATCH 0/5] Enable some configs in loongson3_defconfig Tiezhu Yang
  2025-04-30 13:15 ` [PATCH 1/5] LoongArch: Clean up loongson3_defconfig Tiezhu Yang
  2025-04-30 13:15 ` [PATCH 2/5] LoongArch: Enable tracing infrastructure in defconfig Tiezhu Yang
@ 2025-04-30 13:15 ` Tiezhu Yang
  2025-04-30 13:15 ` [PATCH 4/5] LoongArch: Enable debug information " Tiezhu Yang
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Tiezhu Yang @ 2025-04-30 13:15 UTC (permalink / raw)
  To: Huacai Chen; +Cc: loongarch, linux-kernel

There exist the following errors when building bpf selftest:

  $ cd tools/testing/selftests/bpf/
  $ make
  ...
  CLNG-BPF [test_progs] profiler1.bpf.o
  In file included from progs/profiler1.c:5:
  progs/profiler.inc.h:599:49: error: declaration of 'struct syscall_trace_enter' will not be visible outside of this function [-Werror,-Wvisibility]
  ...
  progs/profiler.inc.h:604:15: error: incomplete definition of type 'struct syscall_trace_enter'
  ...
  progs/profiler.inc.h:605:15: error: incomplete definition of type 'struct syscall_trace_enter'
  ...
  3 errors generated.

This is because there is no basic tracer to catch the syscall entry
and exit events, it is better to enable the kernel tracing syscalls
with CONFIG_FTRACE_SYSCALLS in defconfig to avoid the building errors.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/loongarch/configs/loongson3_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index eaaf3419555c..4289e3abf8c7 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -1006,4 +1006,5 @@ CONFIG_STRIP_ASM_SYMS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_SCHEDSTATS=y
+CONFIG_FTRACE_SYSCALLS=y
 CONFIG_UNWINDER_ORC=y
-- 
2.42.0


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

* [PATCH 4/5] LoongArch: Enable debug information in defconfig
  2025-04-30 13:15 [PATCH 0/5] Enable some configs in loongson3_defconfig Tiezhu Yang
                   ` (2 preceding siblings ...)
  2025-04-30 13:15 ` [PATCH 3/5] LoongArch: Enable tracing syscalls " Tiezhu Yang
@ 2025-04-30 13:15 ` Tiezhu Yang
  2025-04-30 13:15 ` [PATCH 5/5] LoongArch: Enable kprobe and ftrace " Tiezhu Yang
  2025-04-30 13:41 ` [PATCH 0/5] Enable some configs in loongson3_defconfig Huacai Chen
  5 siblings, 0 replies; 11+ messages in thread
From: Tiezhu Yang @ 2025-04-30 13:15 UTC (permalink / raw)
  To: Huacai Chen; +Cc: loongarch, linux-kernel

There exists the following error when building bpf selftest:

  $ cd tools/testing/selftests/bpf/
  $ make
  ...
  libbpf: failed to find '.BTF' ELF section in /home/fedora/bpf.git/vmlinux
  Error: failed to load BTF from /home/fedora/bpf.git/vmlinux: No data available

Enable CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT and CONFIG_DEBUG_INFO_BTF
to avoid the building errors.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/loongarch/configs/loongson3_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index 4289e3abf8c7..d9160f025da0 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -1002,6 +1002,8 @@ CONFIG_DMA_CMA=y
 CONFIG_DMA_NUMA_CMA=y
 CONFIG_CMA_SIZE_MBYTES=0
 CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+CONFIG_DEBUG_INFO_BTF=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-- 
2.42.0


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

* [PATCH 5/5] LoongArch: Enable kprobe and ftrace in defconfig
  2025-04-30 13:15 [PATCH 0/5] Enable some configs in loongson3_defconfig Tiezhu Yang
                   ` (3 preceding siblings ...)
  2025-04-30 13:15 ` [PATCH 4/5] LoongArch: Enable debug information " Tiezhu Yang
@ 2025-04-30 13:15 ` Tiezhu Yang
  2025-04-30 13:41 ` [PATCH 0/5] Enable some configs in loongson3_defconfig Huacai Chen
  5 siblings, 0 replies; 11+ messages in thread
From: Tiezhu Yang @ 2025-04-30 13:15 UTC (permalink / raw)
  To: Huacai Chen; +Cc: loongarch, linux-kernel

kprobe and ftrace are often used, just enable them in defconfig
to avoid setting them manually each time when updating kernel.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/loongarch/configs/loongson3_defconfig | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig
index d9160f025da0..2301882400f2 100644
--- a/arch/loongarch/configs/loongson3_defconfig
+++ b/arch/loongarch/configs/loongson3_defconfig
@@ -39,7 +39,6 @@ CONFIG_NAMESPACES=y
 CONFIG_USER_NS=y
 CONFIG_CHECKPOINT_RESTORE=y
 CONFIG_SCHED_AUTOGROUP=y
-CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
@@ -67,6 +66,7 @@ CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
 CONFIG_LOONGSON3_CPUFREQ=m
 CONFIG_VIRTUALIZATION=y
 CONFIG_KVM=m
+CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_FORCE_LOAD=y
 CONFIG_MODULE_UNLOAD=y
@@ -1006,7 +1006,17 @@ CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_INFO_BTF=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_FS=y
 CONFIG_SCHEDSTATS=y
+CONFIG_FUNCTION_GRAPH_RETVAL=y
+CONFIG_FUNCTION_GRAPH_RETADDR=y
+CONFIG_FPROBE=y
+CONFIG_FUNCTION_PROFILER=y
+CONFIG_STACK_TRACER=y
+CONFIG_IRQSOFF_TRACER=y
+CONFIG_PREEMPT_TRACER=y
+CONFIG_SCHED_TRACER=y
+CONFIG_HWLAT_TRACER=y
+CONFIG_TIMERLAT_TRACER=y
 CONFIG_FTRACE_SYSCALLS=y
+CONFIG_BLK_DEV_IO_TRACE=y
 CONFIG_UNWINDER_ORC=y
-- 
2.42.0


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

* Re: [PATCH 0/5] Enable some configs in loongson3_defconfig
  2025-04-30 13:15 [PATCH 0/5] Enable some configs in loongson3_defconfig Tiezhu Yang
                   ` (4 preceding siblings ...)
  2025-04-30 13:15 ` [PATCH 5/5] LoongArch: Enable kprobe and ftrace " Tiezhu Yang
@ 2025-04-30 13:41 ` Huacai Chen
  2025-05-01  1:37   ` Vincent Li
  2025-05-07  4:24   ` Huacai Chen
  5 siblings, 2 replies; 11+ messages in thread
From: Huacai Chen @ 2025-04-30 13:41 UTC (permalink / raw)
  To: Tiezhu Yang; +Cc: loongarch, linux-kernel

Hi, Tiezhu,

When I enable these options:
CONFIG_FTRACE=y
CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
CONFIG_DYNAMIC_FTRACE=y
CONFIG_DYNAMIC_FTRACE_WITH_REGS=y
CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
CONFIG_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_KPROBES=y
CONFIG_UPROBES=y
CONFIG_KPROBE_EVENTS=y
CONFIG_UPROBE_EVENTS=y

Then your above commands will hang (or get a SIGTRAP), which options I
am missing?

I haven't tried your patches, maybe it works, but I want to know the
exactly needed options.

Huacai


On Wed, Apr 30, 2025 at 9:15 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> This is a small patchset based on 6.15-rc4, each patch is a
> single logical change to better describe the problem and make
> it easier to review.
>
> If the changes make sense, all of them can be squashed into one
> single patch, I think that would be fine as well, let us see if
> other people have concern about it.
>
> By the way, I received many compile-time error reports about tools,
> most are related with configs, this is the motivation of this series.
>
> Additionally, I also received one run-time bug report about uprobe,
> but it works fine on my test environment. If somebody can reproduce
> it, please let me know, maybe I am missing something.
>
> 1. How to reproduce
>
> (1) Compile and install Tongsuo
>
> git clone https://github.com/Tongsuo-Project/Tongsuo.git
> cd Tongsuo && ./config --prefix=/opt/tongsuo -Wl,-rpath,/opt/tongsuo/lib
> make && sudo make install
>
> https://www.tongsuo.net/docs/compilation/source-compilation
>
> (2) Compile and update kernel
>
> Apply this series based on 6.15-rc4, then use the loongson3_defconfig,
> CONFIG_UPROBE_EVENTS is already set.
>
> (3) Probe "openssl speed sm2"
>
> cd tools/perf && make
> sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
> sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2
>
> 2. My test results
>
> fedora@linux:~/uprobe.git/tools/perf$ sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
> Added new event:
>   probe_libcrypto:BN_mod_mul_montgomery (on BN_mod_mul_montgomery in /usr/lib64/libcrypto.so.3.2.2)
>
> You can now use it in all perf tools, such as:
>
>         perf record -e probe_libcrypto:BN_mod_mul_montgomery -aR sleep 1
>
> fedora@linux:~/uprobe.git/tools/perf$ sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2
> Doing 256 bits sign CurveSM2's for 10s: 7463 256 bits CurveSM2 signs in 10.00s
> Doing 256 bits verify CurveSM2's for 10s: 9681 256 bits CurveSM2 verify in 9.98s
> ...
>                               sign    verify    sign/s verify/s
>  256 bits SM2 (CurveSM2)   0.0013s   0.0010s    746.3    970.0
>
>  Performance counter stats for '/opt/tongsuo/bin/openssl speed sm2':
>
>                  0      probe_libcrypto:BN_mod_mul_montgomery
>
>       20.007539877 seconds time elapsed
>
>       19.990010000 seconds user
>        0.000000000 seconds sys
>
> Thanks,
> Tiezhu
>
> Tiezhu Yang (5):
>   LoongArch: Clean up loongson3_defconfig
>   LoongArch: Enable tracing infrastructure in defconfig
>   LoongArch: Enable tracing syscalls in defconfig
>   LoongArch: Enable debug information in defconfig
>   LoongArch: Enable kprobe and ftrace in defconfig
>
>  arch/loongarch/configs/loongson3_defconfig | 74 +++++-----------------
>  1 file changed, 16 insertions(+), 58 deletions(-)
>
> --
> 2.42.0
>

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

* Re: [PATCH 0/5] Enable some configs in loongson3_defconfig
  2025-04-30 13:41 ` [PATCH 0/5] Enable some configs in loongson3_defconfig Huacai Chen
@ 2025-05-01  1:37   ` Vincent Li
  2025-05-01  3:19     ` Huacai Chen
  2025-05-07  4:24   ` Huacai Chen
  1 sibling, 1 reply; 11+ messages in thread
From: Vincent Li @ 2025-05-01  1:37 UTC (permalink / raw)
  To: Huacai Chen; +Cc: Tiezhu Yang, loongarch, linux-kernel

Hi Tiezhu,

On Wed, Apr 30, 2025 at 6:41 AM Huacai Chen <chenhuacai@kernel.org> wrote:
>
> Hi, Tiezhu,
>
> When I enable these options:
> CONFIG_FTRACE=y
> CONFIG_FUNCTION_TRACER=y
> CONFIG_FUNCTION_GRAPH_TRACER=y
> CONFIG_DYNAMIC_FTRACE=y
> CONFIG_DYNAMIC_FTRACE_WITH_REGS=y
> CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
> CONFIG_DYNAMIC_FTRACE_WITH_ARGS=y
> CONFIG_KPROBES=y
> CONFIG_UPROBES=y
> CONFIG_KPROBE_EVENTS=y
> CONFIG_UPROBE_EVENTS=y
>
> Then your above commands will hang (or get a SIGTRAP), which options I
> am missing?
>
> I haven't tried your patches, maybe it works, but I want to know the
> exactly needed options.
>
> Huacai
>
>
> On Wed, Apr 30, 2025 at 9:15 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
> >
> > This is a small patchset based on 6.15-rc4, each patch is a
> > single logical change to better describe the problem and make
> > it easier to review.
> >
> > If the changes make sense, all of them can be squashed into one
> > single patch, I think that would be fine as well, let us see if
> > other people have concern about it.
> >
> > By the way, I received many compile-time error reports about tools,
> > most are related with configs, this is the motivation of this series.
> >
> > Additionally, I also received one run-time bug report about uprobe,
> > but it works fine on my test environment. If somebody can reproduce
> > it, please let me know, maybe I am missing something.
> >
> > 1. How to reproduce
> >
> > (1) Compile and install Tongsuo
> >
> > git clone https://github.com/Tongsuo-Project/Tongsuo.git
> > cd Tongsuo && ./config --prefix=/opt/tongsuo -Wl,-rpath,/opt/tongsuo/lib
> > make && sudo make install
> >
> > https://www.tongsuo.net/docs/compilation/source-compilation
> >
> > (2) Compile and update kernel
> >
> > Apply this series based on 6.15-rc4, then use the loongson3_defconfig,
> > CONFIG_UPROBE_EVENTS is already set.
> >
> > (3) Probe "openssl speed sm2"
> >
> > cd tools/perf && make
> > sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
> > sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2
> >
> > 2. My test results
> >
> > fedora@linux:~/uprobe.git/tools/perf$ sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
> > Added new event:
> >   probe_libcrypto:BN_mod_mul_montgomery (on BN_mod_mul_montgomery in /usr/lib64/libcrypto.so.3.2.2)
> >
> > You can now use it in all perf tools, such as:
> >
> >         perf record -e probe_libcrypto:BN_mod_mul_montgomery -aR sleep 1
> >
> > fedora@linux:~/uprobe.git/tools/perf$ sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2
> > Doing 256 bits sign CurveSM2's for 10s: 7463 256 bits CurveSM2 signs in 10.00s
> > Doing 256 bits verify CurveSM2's for 10s: 9681 256 bits CurveSM2 verify in 9.98s
> > ...
> >                               sign    verify    sign/s verify/s
> >  256 bits SM2 (CurveSM2)   0.0013s   0.0010s    746.3    970.0
> >
> >  Performance counter stats for '/opt/tongsuo/bin/openssl speed sm2':
> >
> >                  0      probe_libcrypto:BN_mod_mul_montgomery
> >
> >       20.007539877 seconds time elapsed
> >
> >       19.990010000 seconds user
> >        0.000000000 seconds sys
> >
> > Thanks,
> > Tiezhu
> >
> > Tiezhu Yang (5):
> >   LoongArch: Clean up loongson3_defconfig
> >   LoongArch: Enable tracing infrastructure in defconfig
> >   LoongArch: Enable tracing syscalls in defconfig
> >   LoongArch: Enable debug information in defconfig
> >   LoongArch: Enable kprobe and ftrace in defconfig
> >
> >  arch/loongarch/configs/loongson3_defconfig | 74 +++++-----------------
> >  1 file changed, 16 insertions(+), 58 deletions(-)

I recommend putting all the config changes in one patch so it is
easier to review change and test, I have to look through each patch to
see what config changed.

> >
> > --
> > 2.42.0
> >
>

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

* Re: [PATCH 0/5] Enable some configs in loongson3_defconfig
  2025-05-01  1:37   ` Vincent Li
@ 2025-05-01  3:19     ` Huacai Chen
  0 siblings, 0 replies; 11+ messages in thread
From: Huacai Chen @ 2025-05-01  3:19 UTC (permalink / raw)
  To: Vincent Li; +Cc: Tiezhu Yang, loongarch, linux-kernel

Hi, Vincent,

On Thu, May 1, 2025 at 9:38 AM Vincent Li <vincent.mc.li@gmail.com> wrote:
>
> Hi Tiezhu,
>
> On Wed, Apr 30, 2025 at 6:41 AM Huacai Chen <chenhuacai@kernel.org> wrote:
> >
> > Hi, Tiezhu,
> >
> > When I enable these options:
> > CONFIG_FTRACE=y
> > CONFIG_FUNCTION_TRACER=y
> > CONFIG_FUNCTION_GRAPH_TRACER=y
> > CONFIG_DYNAMIC_FTRACE=y
> > CONFIG_DYNAMIC_FTRACE_WITH_REGS=y
> > CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
> > CONFIG_DYNAMIC_FTRACE_WITH_ARGS=y
> > CONFIG_KPROBES=y
> > CONFIG_UPROBES=y
> > CONFIG_KPROBE_EVENTS=y
> > CONFIG_UPROBE_EVENTS=y
> >
> > Then your above commands will hang (or get a SIGTRAP), which options I
> > am missing?
> >
> > I haven't tried your patches, maybe it works, but I want to know the
> > exactly needed options.
> >
> > Huacai
> >
> >
> > On Wed, Apr 30, 2025 at 9:15 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
> > >
> > > This is a small patchset based on 6.15-rc4, each patch is a
> > > single logical change to better describe the problem and make
> > > it easier to review.
> > >
> > > If the changes make sense, all of them can be squashed into one
> > > single patch, I think that would be fine as well, let us see if
> > > other people have concern about it.
> > >
> > > By the way, I received many compile-time error reports about tools,
> > > most are related with configs, this is the motivation of this series.
> > >
> > > Additionally, I also received one run-time bug report about uprobe,
> > > but it works fine on my test environment. If somebody can reproduce
> > > it, please let me know, maybe I am missing something.
> > >
> > > 1. How to reproduce
> > >
> > > (1) Compile and install Tongsuo
> > >
> > > git clone https://github.com/Tongsuo-Project/Tongsuo.git
> > > cd Tongsuo && ./config --prefix=/opt/tongsuo -Wl,-rpath,/opt/tongsuo/lib
> > > make && sudo make install
> > >
> > > https://www.tongsuo.net/docs/compilation/source-compilation
> > >
> > > (2) Compile and update kernel
> > >
> > > Apply this series based on 6.15-rc4, then use the loongson3_defconfig,
> > > CONFIG_UPROBE_EVENTS is already set.
> > >
> > > (3) Probe "openssl speed sm2"
> > >
> > > cd tools/perf && make
> > > sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
> > > sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2
> > >
> > > 2. My test results
> > >
> > > fedora@linux:~/uprobe.git/tools/perf$ sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
> > > Added new event:
> > >   probe_libcrypto:BN_mod_mul_montgomery (on BN_mod_mul_montgomery in /usr/lib64/libcrypto.so.3.2.2)
> > >
> > > You can now use it in all perf tools, such as:
> > >
> > >         perf record -e probe_libcrypto:BN_mod_mul_montgomery -aR sleep 1
> > >
> > > fedora@linux:~/uprobe.git/tools/perf$ sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2
> > > Doing 256 bits sign CurveSM2's for 10s: 7463 256 bits CurveSM2 signs in 10.00s
> > > Doing 256 bits verify CurveSM2's for 10s: 9681 256 bits CurveSM2 verify in 9.98s
> > > ...
> > >                               sign    verify    sign/s verify/s
> > >  256 bits SM2 (CurveSM2)   0.0013s   0.0010s    746.3    970.0
> > >
> > >  Performance counter stats for '/opt/tongsuo/bin/openssl speed sm2':
> > >
> > >                  0      probe_libcrypto:BN_mod_mul_montgomery
> > >
> > >       20.007539877 seconds time elapsed
> > >
> > >       19.990010000 seconds user
> > >        0.000000000 seconds sys
> > >
> > > Thanks,
> > > Tiezhu
> > >
> > > Tiezhu Yang (5):
> > >   LoongArch: Clean up loongson3_defconfig
> > >   LoongArch: Enable tracing infrastructure in defconfig
> > >   LoongArch: Enable tracing syscalls in defconfig
> > >   LoongArch: Enable debug information in defconfig
> > >   LoongArch: Enable kprobe and ftrace in defconfig
> > >
> > >  arch/loongarch/configs/loongson3_defconfig | 74 +++++-----------------
> > >  1 file changed, 16 insertions(+), 58 deletions(-)
>
> I recommend putting all the config changes in one patch so it is
> easier to review change and test, I have to look through each patch to
> see what config changed.
This series is probably a RFC and I will not apply.
1) The motivation of this series is to solve an uprobes hang issue,
but as I mentioned above I still don't know why it hangs. Maybe due to
config options but I'm not sure.
2) Don't mix the kernel defconfig and distribution config. A
distribution config tries to enable as many features as possible, and
different distributions have different preferences. The kernel
defconfig is probably a bootable config, plus some widely used
features. Take x86 as an example, it doesn't even enable NUMA
Balancing, THP and BPF which are already widely used in morden
systems, let alone a large set of tracers.
3) About the cleanup, as I explained before (but not in this thread),
though CONFIG_LOONGARCH, CONFIG_64BIT, CONFIG_MACH_LOONGSON64,
CONFIG_PAGE_SIZE_16KB=y, CONFIG_HZ_250=y, CONFIG_DMI=y, CONFIG_EFI=y,
CONFIG_SMP=y, CONFIG_ACPI=y and some other similar options are
implicitly selected so they will disappear during "make
savedefconfig". I still want to keep them in the defconfig, just
because I hope we can easily know what is fundamentally needed by
LoongArch via reading the defconfig file.

Huacai

>
> > >
> > > --
> > > 2.42.0
> > >
> >

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

* Re: [PATCH 0/5] Enable some configs in loongson3_defconfig
  2025-04-30 13:41 ` [PATCH 0/5] Enable some configs in loongson3_defconfig Huacai Chen
  2025-05-01  1:37   ` Vincent Li
@ 2025-05-07  4:24   ` Huacai Chen
  2025-05-09 15:09     ` Tiezhu Yang
  1 sibling, 1 reply; 11+ messages in thread
From: Huacai Chen @ 2025-05-07  4:24 UTC (permalink / raw)
  To: Tiezhu Yang; +Cc: loongarch, linux-kernel

Hi, Tiezhu,

On Wed, Apr 30, 2025 at 9:41 PM Huacai Chen <chenhuacai@kernel.org> wrote:
>
> Hi, Tiezhu,
>
> When I enable these options:
> CONFIG_FTRACE=y
> CONFIG_FUNCTION_TRACER=y
> CONFIG_FUNCTION_GRAPH_TRACER=y
> CONFIG_DYNAMIC_FTRACE=y
> CONFIG_DYNAMIC_FTRACE_WITH_REGS=y
> CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
> CONFIG_DYNAMIC_FTRACE_WITH_ARGS=y
> CONFIG_KPROBES=y
> CONFIG_UPROBES=y
> CONFIG_KPROBE_EVENTS=y
> CONFIG_UPROBE_EVENTS=y
>
> Then your above commands will hang (or get a SIGTRAP), which options I
> am missing?
>
> I haven't tried your patches, maybe it works, but I want to know the
> exactly needed options.
Have you investigated this? I have tried your patchset, but still get
a SIGTRAP or system hang.

I think I know why your tests "success":

sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery
/opt/tongsuo/bin/openssl speed sm2

In the first step you probe the OpenSSL library, and in the second
step you are running "Tongsuo".

Have you tried (both OpenSSL)

sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery openssl speed sm2

or (both Tongsuo)

sudo ./perf probe -x /opt/tongsuo/lib/libcrypto.so BN_mod_mul_montgomery
sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery
/opt/tongsuo/bin/openssl speed sm2

and still success?

I tried, and both got a SIGTRAP or system hang.


Huacai

>
> Huacai
>
>
> On Wed, Apr 30, 2025 at 9:15 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
> >
> > This is a small patchset based on 6.15-rc4, each patch is a
> > single logical change to better describe the problem and make
> > it easier to review.
> >
> > If the changes make sense, all of them can be squashed into one
> > single patch, I think that would be fine as well, let us see if
> > other people have concern about it.
> >
> > By the way, I received many compile-time error reports about tools,
> > most are related with configs, this is the motivation of this series.
> >
> > Additionally, I also received one run-time bug report about uprobe,
> > but it works fine on my test environment. If somebody can reproduce
> > it, please let me know, maybe I am missing something.
> >
> > 1. How to reproduce
> >
> > (1) Compile and install Tongsuo
> >
> > git clone https://github.com/Tongsuo-Project/Tongsuo.git
> > cd Tongsuo && ./config --prefix=/opt/tongsuo -Wl,-rpath,/opt/tongsuo/lib
> > make && sudo make install
> >
> > https://www.tongsuo.net/docs/compilation/source-compilation
> >
> > (2) Compile and update kernel
> >
> > Apply this series based on 6.15-rc4, then use the loongson3_defconfig,
> > CONFIG_UPROBE_EVENTS is already set.
> >
> > (3) Probe "openssl speed sm2"
> >
> > cd tools/perf && make
> > sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
> > sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2
> >
> > 2. My test results
> >
> > fedora@linux:~/uprobe.git/tools/perf$ sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
> > Added new event:
> >   probe_libcrypto:BN_mod_mul_montgomery (on BN_mod_mul_montgomery in /usr/lib64/libcrypto.so.3.2.2)
> >
> > You can now use it in all perf tools, such as:
> >
> >         perf record -e probe_libcrypto:BN_mod_mul_montgomery -aR sleep 1
> >
> > fedora@linux:~/uprobe.git/tools/perf$ sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery /opt/tongsuo/bin/openssl speed sm2
> > Doing 256 bits sign CurveSM2's for 10s: 7463 256 bits CurveSM2 signs in 10.00s
> > Doing 256 bits verify CurveSM2's for 10s: 9681 256 bits CurveSM2 verify in 9.98s
> > ...
> >                               sign    verify    sign/s verify/s
> >  256 bits SM2 (CurveSM2)   0.0013s   0.0010s    746.3    970.0
> >
> >  Performance counter stats for '/opt/tongsuo/bin/openssl speed sm2':
> >
> >                  0      probe_libcrypto:BN_mod_mul_montgomery
> >
> >       20.007539877 seconds time elapsed
> >
> >       19.990010000 seconds user
> >        0.000000000 seconds sys
> >
> > Thanks,
> > Tiezhu
> >
> > Tiezhu Yang (5):
> >   LoongArch: Clean up loongson3_defconfig
> >   LoongArch: Enable tracing infrastructure in defconfig
> >   LoongArch: Enable tracing syscalls in defconfig
> >   LoongArch: Enable debug information in defconfig
> >   LoongArch: Enable kprobe and ftrace in defconfig
> >
> >  arch/loongarch/configs/loongson3_defconfig | 74 +++++-----------------
> >  1 file changed, 16 insertions(+), 58 deletions(-)
> >
> > --
> > 2.42.0
> >

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

* Re: [PATCH 0/5] Enable some configs in loongson3_defconfig
  2025-05-07  4:24   ` Huacai Chen
@ 2025-05-09 15:09     ` Tiezhu Yang
  0 siblings, 0 replies; 11+ messages in thread
From: Tiezhu Yang @ 2025-05-09 15:09 UTC (permalink / raw)
  To: Huacai Chen; +Cc: loongarch, linux-kernel

On 5/7/25 12:24, Huacai Chen wrote:
...

> Have you tried (both OpenSSL)
> 
> sudo ./perf probe -x /usr/lib64/libcrypto.so BN_mod_mul_montgomery
> sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery openssl speed sm2
> 
> or (both Tongsuo)
> 
> sudo ./perf probe -x /opt/tongsuo/lib/libcrypto.so BN_mod_mul_montgomery
> sudo ./perf stat -e probe_libcrypto:BN_mod_mul_montgomery
> /opt/tongsuo/bin/openssl speed sm2
> 
> and still success?
> 
> I tried, and both got a SIGTRAP or system hang.

I can reproduce it now and have a draft patch to fix it.

I am busy with some emergency stuff recently and will send
the formal patch as soon as I have some free time to make
a proper commit message.

Thanks,
Tiezhu


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

end of thread, other threads:[~2025-05-09 15:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-30 13:15 [PATCH 0/5] Enable some configs in loongson3_defconfig Tiezhu Yang
2025-04-30 13:15 ` [PATCH 1/5] LoongArch: Clean up loongson3_defconfig Tiezhu Yang
2025-04-30 13:15 ` [PATCH 2/5] LoongArch: Enable tracing infrastructure in defconfig Tiezhu Yang
2025-04-30 13:15 ` [PATCH 3/5] LoongArch: Enable tracing syscalls " Tiezhu Yang
2025-04-30 13:15 ` [PATCH 4/5] LoongArch: Enable debug information " Tiezhu Yang
2025-04-30 13:15 ` [PATCH 5/5] LoongArch: Enable kprobe and ftrace " Tiezhu Yang
2025-04-30 13:41 ` [PATCH 0/5] Enable some configs in loongson3_defconfig Huacai Chen
2025-05-01  1:37   ` Vincent Li
2025-05-01  3:19     ` Huacai Chen
2025-05-07  4:24   ` Huacai Chen
2025-05-09 15:09     ` Tiezhu Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®