[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H5V8YFK59KOTUqsoEq_JYgdZRiazggoGZO5gTG7oJN8Uw@mail.gmail.com>
Date: Thu, 1 May 2025 11:19:49 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Vincent Li <vincent.mc.li@...il.com>
Cc: Tiezhu Yang <yangtiezhu@...ngson.cn>, loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 0/5] Enable some configs in loongson3_defconfig
Hi, Vincent,
On Thu, May 1, 2025 at 9:38 AM Vincent Li <vincent.mc.li@...il.com> wrote:
>
> Hi Tiezhu,
>
> On Wed, Apr 30, 2025 at 6:41 AM Huacai Chen <chenhuacai@...nel.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@...ngson.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@...ux:~/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@...ux:~/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
> > >
> >
Powered by blists - more mailing lists