Re: [PATCH v2 2/3] perf config: Make symbol_conf::addr2line_disable_warn configurable

Namhyung Kim
2026-04-03T02:12:09Z

On Thu, Apr 02, 2026 at 10:01:58AM +0200, Thomas Richter wrote:
> Make symbol_conf::addr2line_disable_warn configurable by reading
> the perfconfig file. Use section core and addr2line-disable-warn =
> value.

I think it's better to have it under "report" or something. But it
seems we already have one in the "core" section.

>
> Example:
> # perf config -l
> core.addr2line-timeout=500
> core.addr2line-disable-warn=1
> #
>
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> Reviewed-by: Ian Rogers <irogers@google.com>
> Cc: Ian Rogers <irogers@google.com>
> ---
> tools/perf/util/config.c | 3 +++
> 1 file changed, 3 insertions(+)

It'd be great if you add documentation in the same change.

>
> diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
> index 0452fbc6c085..31541e03aab7 100644
> --- a/tools/perf/util/config.c
> +++ b/tools/perf/util/config.c
> @@ -461,6 +461,9 @@ static int perf_default_core_config(const char *var, const char *value)
> if (!strcmp(var, "core.addr2line-timeout"))
> addr2line_timeout_ms = strtoul(value, NULL, 10);
>
> + if (!strcmp(var, "core.addr2line-disable-warn"))
> + symbol_conf.addr2line_disable_warn = strtoul(value, NULL, 10);

As it's boolean, better to use perf_config_bool() instead of strtoul()
so that it can accept "true" or "yes" as well as numbers.

Thanks,
Namhyung

> +
> /* Add other config variables here. */
> return 0;
> }
> --
> 2.53.0
>