Michael Petlan
d12d3f6d9c
perf symbols: Fix symbol size calculation condition
...
commit 3cf6a32f3f2a45944dd5be5c6ac4deb46bcd3bee upstream.
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: 3b01a413c1 ("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 >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-03-23 09:10:45 +01:00
..
2018-06-25 11:59:37 -03:00
2020-12-30 11:25:49 +01:00
2017-11-02 11:10:55 +01:00
2021-06-03 08:38:02 +02:00
2017-11-02 11:10:55 +01:00
2020-11-18 19:18:52 +01:00
2019-11-06 13:05:44 +01:00
2018-08-30 15:51:54 -03:00
2018-01-17 10:23:31 -03:00
2018-01-17 10:23:31 -03:00
2018-01-17 10:23:31 -03:00
2018-01-17 10:23:31 -03:00
2021-03-30 14:37:02 +02:00
2019-03-23 20:10:11 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-08-08 15:55:58 -03:00
2018-08-08 15:55:58 -03:00
2018-06-15 18:10:01 -03:00
2017-11-02 11:10:55 +01:00
2017-07-18 23:14:40 -03:00
2017-07-25 22:46:35 -03:00
2021-03-24 11:07:32 +01:00
2019-04-20 09:15:57 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-02-20 10:25:39 +01:00
2019-02-20 10:25:39 +01:00
2018-06-04 10:28:50 -03:00
2018-03-07 10:22:26 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-07-24 14:54:03 -03:00
2017-11-02 11:10:55 +01:00
2018-08-20 08:54:59 -03:00
2019-04-20 09:15:57 +02:00
2018-05-16 16:11:09 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-10-01 13:14:39 +02:00
2017-11-02 11:10:55 +01:00
2020-12-30 11:25:49 +01:00
2020-12-30 11:25:49 +01:00
2017-11-02 11:10:55 +01:00
2019-06-22 08:15:18 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-01-23 09:48:20 -03:00
2017-11-07 10:30:18 +01:00
2018-04-27 10:47:06 -03:00
2018-03-16 16:39:02 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-07-28 11:13:47 +02:00
2020-06-22 09:05:30 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-12-02 08:48:13 +01:00
2019-12-31 16:36:37 +01:00
2017-11-02 11:10:55 +01:00
2019-01-09 17:38:43 +01:00
2018-05-22 10:52:49 -03:00
2021-03-04 09:39:46 +01:00
2018-05-23 10:26:39 -03:00
2019-01-26 09:32:41 +01:00
2018-05-21 14:40:54 -03:00
2017-11-07 10:30:18 +01:00
2020-10-01 13:14:46 +02:00
2018-08-08 15:55:47 -03:00
2017-11-02 11:10:55 +01:00
2021-03-24 11:07:32 +01:00
2017-11-02 11:10:55 +01:00
2018-04-30 12:02:03 -03:00
2017-11-02 11:10:55 +01:00
2018-04-12 10:33:31 -03:00
2021-03-24 11:07:32 +01:00
2017-11-02 11:10:55 +01:00
2019-10-11 18:21:28 +02:00
2018-07-30 13:15:03 -03:00
2017-11-02 11:10:55 +01:00
2019-11-12 19:20:37 +01:00
2021-12-08 08:50:12 +01:00
2018-11-21 09:19:19 +01:00
2021-06-03 08:38:02 +02:00
2017-11-02 11:10:55 +01:00
2017-11-07 10:30:18 +01:00
2019-10-17 13:45:15 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2021-07-20 16:15:58 +02:00
2018-08-20 08:54:58 -03:00
2021-07-28 11:13:47 +02:00
2021-09-22 11:48:11 +02:00
2019-08-16 10:12:41 +02:00
2021-08-04 12:23:47 +02:00
2018-08-08 15:56:00 -03:00
2020-10-01 13:14:43 +02:00
2018-03-16 13:52:37 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-10-01 13:14:46 +02:00
2018-07-24 14:49:37 -03:00
2018-08-20 08:54:59 -03:00
2018-08-20 08:54:59 -03:00
2018-12-17 09:24:33 +01:00
2018-12-17 09:24:33 +01:00
2017-11-17 12:14:09 -03:00
2017-11-17 12:14:09 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-10-01 13:14:49 +02:00
2018-05-30 10:40:44 -03:00
2018-06-06 12:52:04 -03:00
2021-03-24 11:07:32 +01:00
2020-12-30 11:26:05 +01:00
2017-11-02 11:10:55 +01:00
2017-12-27 12:15:48 -03:00
2017-12-27 12:15:48 -03:00
2017-11-02 11:10:55 +01:00
2020-01-04 19:13:14 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-09-23 12:11:00 +02:00
2020-09-23 12:11:00 +02:00
2020-11-05 11:08:52 +01:00
2017-11-07 10:30:18 +01:00
2022-02-16 12:51:45 +01:00
2017-11-02 11:10:55 +01:00
2021-07-28 11:13:47 +02:00
2017-11-02 11:10:55 +01:00
2020-08-26 10:30:58 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-27 12:15:56 -03:00
2019-02-12 19:47:18 +01:00
2017-11-07 10:30:18 +01:00
2017-12-05 10:24:31 -03:00
2017-12-05 10:24:31 -03:00
2018-03-05 11:52:41 -03:00
2017-09-21 13:28:06 -03:00
2017-09-21 13:28:06 -03:00
2018-08-08 15:26:48 -03:00
2019-04-05 22:33:07 +02:00
2018-08-03 10:34:18 -03:00
2017-11-02 11:10:55 +01:00
2021-06-16 11:55:01 +02:00
2017-11-18 08:59:27 +01:00
2018-10-05 11:11:55 -03:00
2017-08-22 12:09:04 -03:00
2017-08-22 12:09:04 -03:00
2020-10-01 13:14:46 +02:00
2018-08-10 15:29:35 -03:00
2020-07-22 09:31:58 +02:00
2018-01-08 11:11:57 -03:00
2020-03-05 16:42:22 +01:00
2020-07-22 09:32:06 +02:00
2019-10-11 18:21:29 +02:00
2020-01-04 19:13:24 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-27 12:15:55 -03:00
2017-12-27 12:15:55 -03:00
2017-11-02 11:10:55 +01:00
2019-01-26 09:32:40 +01:00
2017-11-02 11:10:55 +01:00
2021-05-22 10:59:34 +02:00
2020-10-01 13:14:47 +02:00
2018-04-27 10:47:06 -03:00
2022-03-23 09:10:45 +01:00
2019-08-16 10:12:41 +02:00
2018-07-24 14:53:01 -03:00
2017-11-02 11:10:55 +01:00
2017-12-27 12:15:47 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-02-27 11:29:21 -03:00
2018-02-27 11:29:21 -03:00
2018-11-21 09:19:19 +01:00
2018-11-21 09:19:19 +01:00
2019-08-16 10:12:41 +02:00
2019-01-09 17:38:42 +01:00
2018-01-17 10:23:36 -03:00
2018-01-17 10:23:36 -03:00
2018-01-10 12:00:55 -03:00
2018-06-04 10:28:52 -03:00
2018-11-13 11:08:22 -08:00
2018-11-13 11:08:22 -08:00
2021-03-17 16:43:44 +01:00
2018-08-10 15:29:35 -03:00
2018-08-13 15:22:18 -03:00
2018-08-13 15:21:43 -03:00
2018-03-06 11:31:14 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-11-27 16:12:59 +01:00
2017-11-02 11:10:55 +01:00
2018-07-24 14:53:11 -03:00
2017-12-27 12:15:52 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-05-17 16:31:32 -03:00
2021-03-24 11:07:32 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-04-26 13:47:15 -03:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-10-05 13:09:47 +02:00
2018-08-20 08:54:59 -03:00