Re: [PATCH v5 0/9] Add OPTPROBES feature on RISCV

From: Björn Töpel
Date: Wed Jan 04 2023 - 03:54:19 EST


"liaochang (A)" <liaochang1@xxxxxxxxxx> writes:

> Hi,Björn,appreciate for your review and testing about this feature.

Thank you for the hard work!

> 在 2023/1/3 2:02, Björn Töpel 写道:
>> Chen Guokai <chenguokai17@xxxxxxxxxxxxxxxx> writes:
>>
>>> Add jump optimization support for RISC-V.
>>
>> Thank you for continuing to work on the series! I took the series for a
>> spin, and ran into a number of issues that makes me wonder how you test
>> the series, and how the testing is different from my runs.
>
> I have pick some kernel functions to test this series, which means all optprobe
> are install at entry of function, i guess the instruction pattern is not versatile
> enough for my testcases leads to some bugs are not discovered.
>
> Do you think it is good idea to test this feature via binary ftracetest and the
> kprobe related tc scripts in tools/testing/ftrace directory?

Definitely! Both running all tests in tools/testing/selftests/ftrace and
with the CONFIG_KPROBES_SANITY_TEST module.

[...]

>> 4. Lockdep splat

[...]

> Need to study this backtrace further, but at first glance, i guess CONFIG_DYNAMIC_FTRACE is enabled on your kernel, right?
> If so, all krpobe is installed via ftrace stub, then kprobe optimiztion occur in the ftrace trampoline code, and it also
> a corner case to current optprobe implementation.

Yes, CONFIG_DYNAMIC_FTRACE is on. My kernel config was simply:
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- defconfig
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- kselftest-merge


Thanks,
Björn