Re: [PATCH] x86/tools: Use a longer buffer for insn_decoder_test

From: Miguel Ojeda
Date: Wed Nov 20 2024 - 20:04:50 EST


On Wed, Nov 20, 2024 at 11:33 PM Mitchell Levy <levymitchell0@xxxxxxxxx> wrote:
>
> Use a 1024 byte buffer for parsing objdump output lines to accommodate
> long symbols created by rust doctests.
>
> The number 1024 is based on giving a healthy margin above KSYM_NAME_LEN
> to accommodate angle brackets, addresses, and whitespace.
>
> ---
> Rust doctests can result in very long symbol names, which results in
> very long lines in objdump output, such as:
> <__pfx__RINvNtCshBBT4i9RzFA_4core3ptr13drop_in_placeINtNtNtCskPkSD4WGMmy_6kernel4sync3arc3ArcINtNtNtNtBN_5block2mq7tag_set6TagSetNtNvNvNvCs8MySzWyGC07_25doctests_kernel_generated33rust_doctest_kernel_block_mq_rs_04main42__doctest_main_rust_kernel_block_mq_rs_58_011MyBlkDeviceEEEB23_>:ffffffff818bb250
>
> Currently, fgets will truncate on the first read of this line (but this
> is fine since we see it starts with '<' and continue the loop), but on
> the second we get "rs_58_011MyBlkDeviceEEEB23_>:ffffffff818bb250", which
> is treated as malformed.
>
> Signed-off-by: Mitchell Levy <levymitchell0@xxxxxxxxx>

Thanks Mitchell -- this is:

https://lore.kernel.org/rust-for-linux/320c4dba-9919-404b-8a26-a8af16be1845@xxxxxxxxxxxxxxxx/

as well as:

https://lore.kernel.org/rust-for-linux/20241117195923.222145-1-sergio.collado@xxxxxxxxx/

It would be nice to get something like this finally in.

Cheers,
Miguel