From: Namhyung Kim <namhyung@kernel.org>
To: Thomas Richter <tmricht@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
linux-perf-users@vger.kernel.org, acme@kernel.org,
irogers@google.com, agordeev@linux.ibm.com, gor@linux.ibm.com,
sumanthk@linux.ibm.com, hca@linux.ibm.com, japo@linux.ibm.com
Subject: Re: [PATCH v2 3/3] perf addr2line: Remove global variable addr2line_timeout_ms
Date: Thu, 2 Apr 2026 19:16:07 -0700 [thread overview]
Message-ID: <ac8i53NUoxVMVecp@google.com> (raw)
In-Reply-To: <20260402080159.2028733-4-tmricht@linux.ibm.com>
On Thu, Apr 02, 2026 at 10:01:59AM +0200, Thomas Richter wrote:
> Remove global variable addr2line_timeout_ms and add is as member
> to symbol_conf structure. Update the documentation for perf config
> file.
>
> Fixes: 257046a36750a ("perf srcline: Fallback between addr2line implementations")
I don't think this fixes anything.
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> Reviewed-by: Ian Rogers <irogers@google.com>
> Cc: Ian Rogers <irogers@google.com>
> ---
> tools/perf/Documentation/perf-config.txt | 6 ++++++
> tools/perf/util/addr2line.c | 8 ++++----
> tools/perf/util/addr2line.h | 2 --
> tools/perf/util/config.c | 3 +--
> tools/perf/util/symbol_conf.h | 1 +
> 5 files changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt
> index 642d1c490d9e..efc15b6db7e2 100644
> --- a/tools/perf/Documentation/perf-config.txt
> +++ b/tools/perf/Documentation/perf-config.txt
> @@ -206,6 +206,12 @@ colors.*::
> Default values are 'white', 'blue'.
>
> core.*::
> + addr2line-disable-warn::
> + When set to 1 disable all warnings from 'addr2line' output.
> + Default setting is 0 to show these warnings.
> + addr2line-timeout::
> + Sets a timeout (in milliseconds) for parsing 'addr2line'
> + output. The default timeout is 500ms.
It should be 5000ms or 5s.
> core.proc-map-timeout::
> Sets a timeout (in milliseconds) for parsing /proc/<pid>/maps files.
> Can be overridden by the --proc-map-timeout option on supported
> diff --git a/tools/perf/util/addr2line.c b/tools/perf/util/addr2line.c
> index e9f084db0802..1b7f66ece570 100644
> --- a/tools/perf/util/addr2line.c
> +++ b/tools/perf/util/addr2line.c
> @@ -18,9 +18,6 @@
>
> #define MAX_INLINE_NEST 1024
>
> -/* If addr2line doesn't return data for 5 seconds then timeout. */
> -int addr2line_timeout_ms = 5 * 1000;
> -
> static int filename_split(char *filename, unsigned int *line_nr)
> {
> char *sep;
> @@ -87,6 +84,9 @@ static struct child_process *addr2line_subprocess_init(const char *addr2line_pat
> return NULL;
> }
>
> + if (!symbol_conf.addr2line_timeout_ms)
> + symbol_conf.addr2line_timeout_ms = 5 * 1000;
As I said before, you can put it in the util/symbol.c.
Thanks,
Namhyung
> +
> return a2l;
> }
>
> @@ -335,7 +335,7 @@ int cmd__addr2line(const char *dso_name, u64 addr,
> goto out;
> }
> io__init(&io, a2l->out, buf, sizeof(buf));
> - io.timeout_ms = addr2line_timeout_ms;
> + io.timeout_ms = symbol_conf.addr2line_timeout_ms;
> switch (read_addr2line_record(&io, cmd_a2l_style, dso_name, addr, /*first=*/true,
> &record_function, &record_filename, &record_line_nr)) {
> case -1:
> diff --git a/tools/perf/util/addr2line.h b/tools/perf/util/addr2line.h
> index d35a47ba8dab..75989a92f16b 100644
> --- a/tools/perf/util/addr2line.h
> +++ b/tools/perf/util/addr2line.h
> @@ -8,8 +8,6 @@ struct dso;
> struct inline_node;
> struct symbol;
>
> -extern int addr2line_timeout_ms;
> -
> int cmd__addr2line(const char *dso_name, u64 addr,
> char **file, unsigned int *line_nr,
> struct dso *dso,
> diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
> index 31541e03aab7..573b3a3f5999 100644
> --- a/tools/perf/util/config.c
> +++ b/tools/perf/util/config.c
> @@ -19,7 +19,6 @@
> #include "util/hist.h" /* perf_hist_config */
> #include "util/stat.h" /* perf_stat__set_big_num */
> #include "util/evsel.h" /* evsel__hw_names, evsel__use_bpf_counters */
> -#include "util/addr2line.h" /* addr2line_timeout_ms */
> #include "srcline.h"
> #include "build-id.h"
> #include "debug.h"
> @@ -459,7 +458,7 @@ static int perf_default_core_config(const char *var, const char *value)
> proc_map_timeout = strtoul(value, NULL, 10);
>
> if (!strcmp(var, "core.addr2line-timeout"))
> - addr2line_timeout_ms = strtoul(value, NULL, 10);
> + symbol_conf.addr2line_timeout_ms = strtoul(value, NULL, 10);
>
> if (!strcmp(var, "core.addr2line-disable-warn"))
> symbol_conf.addr2line_disable_warn = strtoul(value, NULL, 10);
> diff --git a/tools/perf/util/symbol_conf.h b/tools/perf/util/symbol_conf.h
> index 21a1f096d4f0..6cd454d7c98e 100644
> --- a/tools/perf/util/symbol_conf.h
> +++ b/tools/perf/util/symbol_conf.h
> @@ -80,6 +80,7 @@ struct symbol_conf {
> *bt_stop_list_str;
> const char *addr2line_path;
> enum a2l_style addr2line_style[MAX_A2L_STYLE];
> + int addr2line_timeout_ms;
> unsigned long time_quantum;
> struct strlist *dso_list,
> *comm_list,
> --
> 2.53.0
>
prev parent reply other threads:[~2026-04-03 2:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 8:01 [PATCH v2 0/3] perf addr2line: Rework disable_add2line_warn Thomas Richter
2026-04-02 8:01 ` [PATCH v2 1/3] perf config: Rename symbol_conf::disable_add2line_warn Thomas Richter
2026-04-03 2:08 ` Namhyung Kim
2026-04-07 6:50 ` Thomas Richter
2026-04-07 7:29 ` Namhyung Kim
2026-04-02 8:01 ` [PATCH v2 2/3] perf config: Make symbol_conf::addr2line_disable_warn configurable Thomas Richter
2026-04-03 2:12 ` Namhyung Kim
2026-04-07 6:58 ` Thomas Richter
2026-04-07 7:31 ` Namhyung Kim
2026-04-02 8:01 ` [PATCH v2 3/3] perf addr2line: Remove global variable addr2line_timeout_ms Thomas Richter
2026-04-03 2:16 ` Namhyung Kim [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac8i53NUoxVMVecp@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=irogers@google.com \
--cc=japo@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=sumanthk@linux.ibm.com \
--cc=tmricht@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.