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
atmel_lcdc.h -rw-r--r-- 6.2 KB
aty128.h -rw-r--r-- 13.3 KB
broadsheetfb.h -rw-r--r-- 2.1 KB
cirrus.h -rw-r--r-- 5.7 KB
cvisionppc.h -rw-r--r-- 1.5 KB
da8xx-fb.h -rw-r--r-- 2.0 KB
display_timing.h -rw-r--r-- 3.1 KB
edid.h -rw-r--r-- 228 bytes
gbe.h -rw-r--r-- 10.4 KB
hecubafb.h -rw-r--r-- 1.5 KB
ili9320.h -rw-r--r-- 5.7 KB
imx-ipu-image-convert.h -rw-r--r-- 6.5 KB
imx-ipu-v3.h -rw-r--r-- 16.4 KB
kyro.h -rw-r--r-- 2.4 KB
mach64.h -rw-r--r-- 46.9 KB
maxinefb.h -rw-r--r-- 1.2 KB
metronomefb.h -rw-r--r-- 1.5 KB
mipi_display.h -rw-r--r-- 5.0 KB
mmp_disp.h -rw-r--r-- 7.0 KB
neomagic.h -rw-r--r-- 4.9 KB
newport.h -rw-r--r-- 18.7 KB
of_display_timing.h -rw-r--r-- 788 bytes
of_videomode.h -rw-r--r-- 367 bytes
omap-panel-data.h -rw-r--r-- 1.7 KB
omapfb_dss.h -rw-r--r-- 23.9 KB
omapvrfb.h -rw-r--r-- 1.8 KB
permedia2.h -rw-r--r-- 9.0 KB
platform_lcd.h -rw-r--r-- 440 bytes
pm3fb.h -rw-r--r-- 45.3 KB
pmag-ba-fb.h -rw-r--r-- 1.0 KB
pmagb-b-fb.h -rw-r--r-- 2.3 KB
pxa168fb.h -rw-r--r-- 2.5 KB
radeon.h -rw-r--r-- 109.2 KB
s1d13xxxfb.h -rw-r--r-- 9.9 KB
sa1100fb.h -rw-r--r-- 1.3 KB
samsung_fimd.h -rw-r--r-- 17.0 KB
sh_mobile_lcdc.h -rw-r--r-- 6.0 KB
sisfb.h -rw-r--r-- 606 bytes
sstfb.h -rw-r--r-- 11.1 KB
tdfx.h -rw-r--r-- 5.3 KB
tgafb.h -rw-r--r-- 6.9 KB
trident.h -rw-r--r-- 3.2 KB
udlfb.h -rw-r--r-- 2.9 KB
uvesafb.h -rw-r--r-- 2.9 KB
vga.h -rw-r--r-- 13.7 KB
videomode.h -rw-r--r-- 1.3 KB
w100fb.h -rw-r--r-- 3.6 KB

back to top