Revision 3cf6a32f3f2a45944dd5be5c6ac4deb46bcd3bee authored by Michael Petlan on 17 March 2022, 13:55:36 UTC, committed by Arnaldo Carvalho de Melo on 18 March 2022, 21:39:09 UTC
Before this patch, the symbol end address fixup to be called, needed two
conditions being met:

  if (prev->end == prev->start && prev->end != curr->start)

Where
  "prev->end == prev->start" means that prev is zero-long
                             (and thus needs a fixup)
and
  "prev->end != curr->start" means that fixup hasn't been applied yet

However, this logic is incorrect in the following situation:

*curr  = {rb_node = {__rb_parent_color = 278218928,
  rb_right = 0x0, rb_left = 0x0},
  start = 0xc000000000062354,
  end = 0xc000000000062354, namelen = 40, type = 2 '\002',
  binding = 0 '\000', idle = 0 '\000', ignore = 0 '\000',
  inlined = 0 '\000', arch_sym = 0 '\000', annotate2 = false,
  name = 0x1159739e "kprobe_optinsn_page\t[__builtin__kprobes]"}

*prev = {rb_node = {__rb_parent_color = 278219041,
  rb_right = 0x109548b0, rb_left = 0x109547c0},
  start = 0xc000000000062354,
  end = 0xc000000000062354, namelen = 12, type = 2 '\002',
  binding = 1 '\001', idle = 0 '\000', ignore = 0 '\000',
  inlined = 0 '\000', arch_sym = 0 '\000', annotate2 = false,
  name = 0x1095486e "optinsn_slot"}

In this case, prev->start == prev->end == curr->start == curr->end,
thus the condition above thinks that "we need a fixup due to zero
length of prev symbol, but it has been probably done, since the
prev->end == curr->start", which is wrong.

After the patch, the execution path proceeds to arch__symbols__fixup_end
function which fixes up the size of prev symbol by adding page_size to
its end offset.

Fixes: 3b01a413c196c910 ("perf symbols: Improve kallsyms symbol end addr calculation")
Signed-off-by: Michael Petlan <mpetlan@redhat.com>
Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: http://lore.kernel.org/lkml/20220317135536.805-1-mpetlan@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 34e047a
History
File Mode Size
caching
cifs
ext4
nfs
spufs
9p.rst -rw-r--r-- 6.6 KB
adfs.rst -rw-r--r-- 3.7 KB
affs.rst -rw-r--r-- 8.4 KB
afs.rst -rw-r--r-- 7.8 KB
api-summary.rst -rw-r--r-- 2.2 KB
autofs-mount-control.rst -rw-r--r-- 18.1 KB
autofs.rst -rw-r--r-- 24.5 KB
automount-support.rst -rw-r--r-- 3.5 KB
befs.rst -rw-r--r-- 3.8 KB
bfs.rst -rw-r--r-- 2.2 KB
btrfs.rst -rw-r--r-- 1.2 KB
ceph.rst -rw-r--r-- 8.4 KB
coda.rst -rw-r--r-- 43.4 KB
configfs.rst -rw-r--r-- 22.5 KB
cramfs.rst -rw-r--r-- 4.6 KB
dax.rst -rw-r--r-- 11.2 KB
debugfs.rst -rw-r--r-- 9.9 KB
devpts.rst -rw-r--r-- 1.4 KB
directory-locking.rst -rw-r--r-- 6.3 KB
dlmfs.rst -rw-r--r-- 4.4 KB
dnotify.rst -rw-r--r-- 3.1 KB
ecryptfs.rst -rw-r--r-- 2.5 KB
efivarfs.rst -rw-r--r-- 1.6 KB
erofs.rst -rw-r--r-- 14.2 KB
ext2.rst -rw-r--r-- 18.7 KB
ext3.rst -rw-r--r-- 467 bytes
f2fs.rst -rw-r--r-- 42.4 KB
fiemap.rst -rw-r--r-- 9.8 KB
files.rst -rw-r--r-- 4.3 KB
fscrypt.rst -rw-r--r-- 59.1 KB
fsverity.rst -rw-r--r-- 36.5 KB
fuse-io.rst -rw-r--r-- 1.9 KB
fuse.rst -rw-r--r-- 15.8 KB
gfs2-glocks.rst -rw-r--r-- 11.4 KB
gfs2-uevents.rst -rw-r--r-- 3.8 KB
gfs2.rst -rw-r--r-- 1.9 KB
hfs.rst -rw-r--r-- 3.0 KB
hfsplus.rst -rw-r--r-- 1.8 KB
hpfs.rst -rw-r--r-- 15.4 KB
idmappings.rst -rw-r--r-- 36.9 KB
index.rst -rw-r--r-- 1.8 KB
inotify.rst -rw-r--r-- 4.0 KB
isofs.rst -rw-r--r-- 3.1 KB
journalling.rst -rw-r--r-- 9.0 KB
locking.rst -rw-r--r-- 26.6 KB
locks.rst -rw-r--r-- 2.4 KB
mount_api.rst -rw-r--r-- 27.1 KB
netfs_library.rst -rw-r--r-- 19.4 KB
nilfs2.rst -rw-r--r-- 11.3 KB
ntfs.rst -rw-r--r-- 20.2 KB
ntfs3.rst -rw-r--r-- 3.6 KB
ocfs2-online-filecheck.rst -rw-r--r-- 4.0 KB
ocfs2.rst -rw-r--r-- 4.7 KB
omfs.rst -rw-r--r-- 4.1 KB
orangefs.rst -rw-r--r-- 19.6 KB
overlayfs.rst -rw-r--r-- 27.3 KB
path-lookup.rst -rw-r--r-- 69.6 KB
path-lookup.txt -rw-r--r-- 18.5 KB
porting.rst -rw-r--r-- 28.6 KB
proc.rst -rw-r--r-- 94.8 KB
qnx6.rst -rw-r--r-- 7.2 KB
quota.rst -rw-r--r-- 3.3 KB
ramfs-rootfs-initramfs.rst -rw-r--r-- 16.1 KB
relay.rst -rw-r--r-- 21.3 KB
romfs.rst -rw-r--r-- 8.6 KB
seq_file.rst -rw-r--r-- 16.0 KB
sharedsubtree.rst -rw-r--r-- 29.6 KB
splice.rst -rw-r--r-- 455 bytes
squashfs.rst -rw-r--r-- 10.6 KB
sysfs.rst -rw-r--r-- 13.0 KB
sysv-fs.rst -rw-r--r-- 8.1 KB
tmpfs.rst -rw-r--r-- 7.6 KB
ubifs-authentication.rst -rw-r--r-- 21.7 KB
ubifs.rst -rw-r--r-- 5.7 KB
udf.rst -rw-r--r-- 3.0 KB
vfat.rst -rw-r--r-- 14.5 KB
vfs.rst -rw-r--r-- 56.7 KB
virtiofs.rst -rw-r--r-- 3.0 KB
xfs-delayed-logging-design.rst -rw-r--r-- 40.9 KB
xfs-self-describing-metadata.rst -rw-r--r-- 16.6 KB
zonefs.rst -rw-r--r-- 20.9 KB

back to top