Hi Yulong,
On Fri, Mar 1, 2024 at 4:25 PM tang yulong <1637403063(a)qq.com> wrote:
> Hi Yulong,
>
> Thanks for your patch!
>
> On Mon, Feb 26, 2024 at 3:20 PM Yulong TANG 汤玉龙 <yulong.tang(a)nio.com>
wrote:
>
> I have no objection to the lzo-rle decompression feature for crash.
> However I have some concern of your patch:
>
> The patch you attached is a "lzorle_decompress_safe" implementation
> which is copied from kernel source code. One of the drawbacks of
> copying kernel source code is, kernel is constantly evolving, the code
> you copied here today maybe updated someday later, and in support of
> different kernel versions, we need to keep a bunch of
> switch(kernel_version) and case code to keep the compatibility, which
> is what we are trying to avoid.
>
> In addition, the code you copied has deliberately deleted the "if
> defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)" part, which may also
> cause some problem, and as far as I know, there is no good way in
> crash to determine the kernel config status, please feel free to
> correct me if I'm wrong.
Hi Tao,
I discovered that there seems to be an array called ikconfig_all in kernel.c which
records the kernel config status, and there is an API called get_kernel_config(char
*conf_name, char **str) for obtaining kernel configuration. This might help solve the
second problem you raised.
For example, adding a line:
#define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
get_kernel_config("CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS", NULL);
OK, thanks for the clarification, sounds workable. Then what do you
think if we keep the "if
defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)" related code of the
copied kernel code, but change the "if defined" macro into a runtime
check like "if get_kernel_config("CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS",
NULL)) == IKCONFIG_Y". So the code can be chosen whether to execute
depending on the config status.
Thanks,
Tao Liu
Thanks,
Yulong
--
Crash-utility mailing list -- devel(a)lists.crash-utility.osci.io
To unsubscribe send an email to devel-leave(a)lists.crash-utility.osci.io
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines:
https://github.com/crash-utility/crash/wiki