Some symbols have only a file information, and no line information. In
this case, addr2line reports '?'. Replace with 0 to guarantee consistent
data for consumers.
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260424194451.1439316-3-pierrick.bouvier@oss.qualcomm.com
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
---
contrib/plugins/uftrace_symbols.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/contrib/plugins/uftrace_symbols.py b/contrib/plugins/uftrace_symbols.py
index 6eb999bca5f..9f0095e73b9 100755
--- a/contrib/plugins/uftrace_symbols.py
+++ b/contrib/plugins/uftrace_symbols.py
@@ -70,7 +70,10 @@ def find_symbols_locations(elf_file, symbols):
file, line = out[i].split(':')
# addr2line may return 'line (discriminator [0-9]+)' sometimes,
# remove this to keep only line number.
- line = line.split(' ')[0]
+ if line == '?':
+ line = 0
+ else:
+ line = int(line.split(' ')[0])
s.set_loc(file, line)
class BinaryFile:
--
2.43.0