<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/scripts/faddr2line, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-10-14T21:45:20+00:00</updated>
<entry>
<title>scripts/faddr2line: Fix "Argument list too long" error</title>
<updated>2025-10-14T21:45:20+00:00</updated>
<author>
<name>Pankaj Raghav</name>
<email>p.raghav@samsung.com</email>
</author>
<published>2025-09-21T10:03:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff5c0466486ba8d07ab2700380e8fd6d5344b4e9'/>
<id>urn:sha1:ff5c0466486ba8d07ab2700380e8fd6d5344b4e9</id>
<content type='text'>
The run_readelf() function reads the entire output of readelf into a
single shell variable. For large object files with extensive debug
information, the size of this variable can exceed the system's
command-line argument length limit.

When this variable is subsequently passed to sed via `echo "${out}"`, it
triggers an "Argument list too long" error, causing the script to fail.

Fix this by redirecting the output of readelf to a temporary file
instead of a variable. The sed commands are then modified to read from
this file, avoiding the argument length limitation entirely.

Signed-off-by: Pankaj Raghav &lt;p.raghav@samsung.com&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>scripts/faddr2line: Use /usr/bin/env bash for portability</title>
<updated>2025-10-14T21:45:20+00:00</updated>
<author>
<name>Pankaj Raghav</name>
<email>p.raghav@samsung.com</email>
</author>
<published>2025-09-21T10:03:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6b4679fcbfdf6f27f8455f9c7050ab6c46c6c5e0'/>
<id>urn:sha1:6b4679fcbfdf6f27f8455f9c7050ab6c46c6c5e0</id>
<content type='text'>
The shebang `#!/bin/bash` assumes a fixed path for the bash interpreter.
This path does not exist on some systems, such as NixOS, causing the
script to fail.

Replace `/bin/bash` with the more portable `#!/usr/bin/env bash`.

Signed-off-by: Pankaj Raghav &lt;p.raghav@samsung.com&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>scripts/faddr2line: Set LANG=C to enforce ASCII output</title>
<updated>2025-10-14T21:45:20+00:00</updated>
<author>
<name>John Wang</name>
<email>wangzq.jn@gmail.com</email>
</author>
<published>2025-03-28T07:38:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=567f9c428f99560fe14e647def9f42f5344ebde9'/>
<id>urn:sha1:567f9c428f99560fe14e647def9f42f5344ebde9</id>
<content type='text'>
Force tools like readelf to use the POSIX/C locale by exporting LANG=C
This ensures ASCII-only output and avoids locale-specific
characters(e.g., UTF-8 symbols or translated strings), which could
break text processing utilities like sed in the script

Signed-off-by: John Wang &lt;wangzq.jn@gmail.com&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>Revert "scripts/faddr2line: Check only two symbols when calculating symbol size"</title>
<updated>2024-10-17T22:16:04+00:00</updated>
<author>
<name>Carlos Llamas</name>
<email>cmllamas@google.com</email>
</author>
<published>2024-08-12T23:01:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=56ac7bd2c58a4e93d19f0ccb181035d075b315d3'/>
<id>urn:sha1:56ac7bd2c58a4e93d19f0ccb181035d075b315d3</id>
<content type='text'>
This reverts commit c02904f05ff805d6c0631634d5751ebd338f75ec.

Such commit assumed that only two symbols are relevant for the symbol
size calculation. However, this can lead to an incorrect symbol size
calculation when there are mapping symbols emitted by readelf.

For instance, when feeding 'update_irq_load_avg+0x1c/0x1c4', faddr2line
might need to process the following readelf lines:

 784284: ffffffc0081cca30   428 FUNC    GLOBAL DEFAULT     2 update_irq_load_avg
  87319: ffffffc0081ccb0c     0 NOTYPE  LOCAL  DEFAULT     2 $x.62522
  87321: ffffffc0081ccbdc     0 NOTYPE  LOCAL  DEFAULT     2 $x.62524
  87323: ffffffc0081ccbe0     0 NOTYPE  LOCAL  DEFAULT     2 $x.62526
  87325: ffffffc0081ccbe4     0 NOTYPE  LOCAL  DEFAULT     2 $x.62528
  87327: ffffffc0081ccbe8     0 NOTYPE  LOCAL  DEFAULT     2 $x.62530
  87329: ffffffc0081ccbec     0 NOTYPE  LOCAL  DEFAULT     2 $x.62532
  87331: ffffffc0081ccbf0     0 NOTYPE  LOCAL  DEFAULT     2 $x.62534
  87332: ffffffc0081ccbf4     0 NOTYPE  LOCAL  DEFAULT     2 $x.62535
 783403: ffffffc0081ccbf4   424 FUNC    GLOBAL DEFAULT     2 sched_pelt_multiplier

The symbol size of 'update_irq_load_avg' should be calculated with the
address of 'sched_pelt_multiplier', after skipping the mapping symbols
seen in between. However, the offending commit cuts the list short and
faddr2line incorrectly assumes 'update_irq_load_avg' is the last symbol
in the section, resulting in:

  $ scripts/faddr2line vmlinux update_irq_load_avg+0x1c/0x1c4
  skipping update_irq_load_avg address at 0xffffffc0081cca4c due to size mismatch (0x1c4 != 0x3ff9a59988)
  no match for update_irq_load_avg+0x1c/0x1c4

After reverting the commit the issue is resolved:

  $ scripts/faddr2line vmlinux update_irq_load_avg+0x1c/0x1c4
  update_irq_load_avg+0x1c/0x1c4:
  cpu_of at kernel/sched/sched.h:1109
  (inlined by) update_irq_load_avg at kernel/sched/pelt.c:481

Fixes: c02904f05ff8 ("scripts/faddr2line: Check only two symbols when calculating symbol size")
Signed-off-by: Carlos Llamas &lt;cmllamas@google.com&gt;
Acked-by: Will Deacon &lt;will@kernel.org&gt;
Acked-by: Brian Johannesmeyer &lt;bjohannesmeyer@gmail.com&gt;
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>scripts/faddr2line: Check only two symbols when calculating symbol size</title>
<updated>2024-07-03T06:38:37+00:00</updated>
<author>
<name>Brian Johannesmeyer</name>
<email>bjohannesmeyer@gmail.com</email>
</author>
<published>2024-04-15T14:55:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c02904f05ff805d6c0631634d5751ebd338f75ec'/>
<id>urn:sha1:c02904f05ff805d6c0631634d5751ebd338f75ec</id>
<content type='text'>
Rather than looping through each symbol in a particular section to
calculate a symbol's size, grep for the symbol and its immediate
successor, and only use those two symbols.

Signed-off-by: Brian Johannesmeyer &lt;bjohannesmeyer@gmail.com&gt;
Link: https://lore.kernel.org/r/20240415145538.1938745-8-bjohannesmeyer@gmail.com
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>scripts/faddr2line: Remove call to addr2line from find_dir_prefix()</title>
<updated>2024-07-03T06:38:37+00:00</updated>
<author>
<name>Brian Johannesmeyer</name>
<email>bjohannesmeyer@gmail.com</email>
</author>
<published>2024-04-15T14:55:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=406b5c12aad8110e1b1f9355f176cac43cd1fecb'/>
<id>urn:sha1:406b5c12aad8110e1b1f9355f176cac43cd1fecb</id>
<content type='text'>
Use the single long-running faddr2line process from find_dir_prefix().

Signed-off-by: Brian Johannesmeyer &lt;bjohannesmeyer@gmail.com&gt;
Link: https://lore.kernel.org/r/20240415145538.1938745-7-bjohannesmeyer@gmail.com
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>scripts/faddr2line: Invoke addr2line as a single long-running process</title>
<updated>2024-07-03T06:38:36+00:00</updated>
<author>
<name>Brian Johannesmeyer</name>
<email>bjohannesmeyer@gmail.com</email>
</author>
<published>2024-04-15T14:55:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e36b69e918112430ee53e24238bb87f5146f9acf'/>
<id>urn:sha1:e36b69e918112430ee53e24238bb87f5146f9acf</id>
<content type='text'>
Rather than invoking a separate addr2line process for each address, invoke
a single addr2line coprocess, and pass each address to its stdin. Previous
work [0] applied a similar change to perf, leading to a ~60x speed-up [1].

If using an object file that is _not_ vmlinux, faddr2line passes a section
name argument to addr2line. Because we do not know until runtime which
section names will be passed to addr2line, we cannot apply this change to
non-vmlinux object files. Hence, it only applies to vmlinux.

[0] commit be8ecc57f180 ("perf srcline: Use long-running addr2line per
DSO")
[1] Link:
https://eighty-twenty.org/2021/09/09/perf-addr2line-speed-improvement

Signed-off-by: Brian Johannesmeyer &lt;bjohannesmeyer@gmail.com&gt;
Link: https://lore.kernel.org/r/20240415145538.1938745-6-bjohannesmeyer@gmail.com
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>scripts/faddr2line: Pass --addresses argument to addr2line</title>
<updated>2024-07-03T06:38:36+00:00</updated>
<author>
<name>Brian Johannesmeyer</name>
<email>bjohannesmeyer@gmail.com</email>
</author>
<published>2024-04-15T14:55:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5b280de46d2bcea9def0dd84b1e86f8b42ca70b9'/>
<id>urn:sha1:5b280de46d2bcea9def0dd84b1e86f8b42ca70b9</id>
<content type='text'>
In preparation for identifying an addr2line sentinel. See previous work
[0], which applies a similar change to perf.

[0] commit 8dc26b6f718a ("perf srcline: Make sentinel reading for binutils
addr2line more robust")

Signed-off-by: Brian Johannesmeyer &lt;bjohannesmeyer@gmail.com&gt;
Link: https://lore.kernel.org/r/20240415145538.1938745-5-bjohannesmeyer@gmail.com
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>scripts/faddr2line: Check vmlinux only once</title>
<updated>2024-07-03T06:38:36+00:00</updated>
<author>
<name>Brian Johannesmeyer</name>
<email>bjohannesmeyer@gmail.com</email>
</author>
<published>2024-04-15T14:55:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2c809186ccf0e3a4cb952da181f9c28436133081'/>
<id>urn:sha1:2c809186ccf0e3a4cb952da181f9c28436133081</id>
<content type='text'>
Rather than checking whether the object file is vmlinux for each invocation
of __faddr2line, check it only once beforehand.

Signed-off-by: Brian Johannesmeyer &lt;bjohannesmeyer@gmail.com&gt;
Link: https://lore.kernel.org/r/20240415145538.1938745-4-bjohannesmeyer@gmail.com
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
<entry>
<title>scripts/faddr2line: Combine three readelf calls into one</title>
<updated>2024-07-03T06:38:36+00:00</updated>
<author>
<name>Brian Johannesmeyer</name>
<email>bjohannesmeyer@gmail.com</email>
</author>
<published>2024-04-15T14:55:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b8d9d9496c1e78a8fd89f4fe9923d12b3c9ad8a3'/>
<id>urn:sha1:b8d9d9496c1e78a8fd89f4fe9923d12b3c9ad8a3</id>
<content type='text'>
Rather than calling readelf three separate times to collect three different
types of info, call it only once, and parse out the different types of info
from its output.

Signed-off-by: Brian Johannesmeyer &lt;bjohannesmeyer@gmail.com&gt;
Link: https://lore.kernel.org/r/20240415145538.1938745-3-bjohannesmeyer@gmail.com
Signed-off-by: Josh Poimboeuf &lt;jpoimboe@kernel.org&gt;
</content>
</entry>
</feed>
