diff options
author | Stephen Brennan <stephen.s.brennan@oracle.com> | 2025-03-19 02:00:11 +0300 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2025-03-20 02:56:05 +0300 |
commit | ebf0b332732dcc64239119e554faa946562b0b93 (patch) | |
tree | 955f8e21114a5ef3814fab85d2bbdbc922a87a7d /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 2b5b834cc3b97492901ed399ae0ceb737f6aaa06 (diff) | |
download | linux-ebf0b332732dcc64239119e554faa946562b0b93.tar.xz |
perf dso: fix dso__is_kallsyms() check
Kernel modules for which we cannot find a file on-disk will have a
dso->long_name that looks like "[module_name]". Prior to the commit
listed in the fixes, the dso->kernel field would be zero (for user
space), so dso__is_kallsyms() would return false. After the commit,
kernel module DSOs are correctly labeled, but the result is that
dso__is_kallsyms() erroneously returns true for those modules without a
filesystem path.
Later, build_id_cache__add() consults this value of is_kallsyms, and
when true, it copies /proc/kallsyms into the cache. Users with many
kernel modules without a filesystem path (e.g. ksplice or possibly
kernel live patch modules) have reported excessive disk space usage in
the build ID cache directory due to this behavior.
To reproduce the issue, it's enough to build a trivial out-of-tree hello
world kernel module, load it using insmod, and then use:
perf record -ag -- sleep 1
In the build ID directory, there will be a directory for your module
name containing a kallsyms file.
Fix this up by changing dso__is_kallsyms() to consult the
dso_binary_type enumeration, which is also symmetric to the above checks
for dso__is_vmlinux() and dso__is_kcore(). With this change, kallsyms is
not cached in the build-id cache for out-of-tree modules.
Fixes: 02213cec64bbe ("perf maps: Mark module DSOs with kernel type")
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
Link: https://lore.kernel.org/r/20250318230012.2038790-1-stephen.s.brennan@oracle.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions