Re: [PATCH v2] perf annotate: Use an array for the disassembler preference
From: Namhyung Kim
Date: Mon Jan 27 2025 - 13:34:53 EST
On Thu, 23 Jan 2025 20:38:56 -0800, Ian Rogers wrote:
> Prior to this change a string was used which could cause issues with
> an unrecognized disassembler in symbol__disassembler. Change to
> initializing an array of perf_disassembler enum values. If a value
> already exists then adding it a second time is ignored to avoid array
> out of bounds problems present in the previous code, it also allows a
> statically sized array and removes memory allocation needs. Errors in
> the disassembler string are reported when the config is parsed during
> perf annotate or perf top start up. If the array is uninitialized
> after processing the config file the default llvm, capstone then
> objdump values are added but without a need to parse a string.
>
> [...]
Applied to perf-tools, thanks!
Best regards,
Namhyung