Namhyung Kim 69a87a32f5 perf machine: Include data symbols in the kernel map
When 'perf record -d' is used, it needs data mmaps to symbolize global
data.  But it missed to collect kernel data maps so it cannot symbolize
them.  Instead of having a separate map, just increase the kernel map
size to include the data section.

Probably we can have a separate kernel map for data, but the current
code assumes a single kernel map.  So it'd require more changes in other
places and looks error-prone.  I decided not to go that way for now.

Also it seems the kernel module size already includes the data section.

For example, my system has the following.

  $ grep -e _stext -e _etext -e _edata /proc/kallsyms
  ffffffff99800000 T _stext
  ffffffff9a601ac8 T _etext
  ffffffff9b446a00 D _edata

Size of the text section is (0x9a601ac8 - 0x99800000 = 0xe01ac8) and
size including data section is (0x9b446a00 - 0x99800000 = 0x1c46a00).

Before:
  $ perf record -d true

  $ perf report -D | grep MMAP | head -1
  0 0 0x460 [0x60]: PERF_RECORD_MMAP -1/0: [0xffffffff99800000(0xe01ac8) @ 0xffffffff99800000]: x [kernel.kallsyms]_text
                                                               ^^^^^^^^
                                                                 here
After:
  $ perf report -D | grep MMAP | head -1
  0 0 0x460 [0x60]: PERF_RECORD_MMAP -1/0: [0xffffffff99800000(0x1c46a00) @ 0xffffffff99800000]: x [kernel.kallsyms]_text
                                                               ^^^^^^^^^

Instead of just replacing it to _edata, try _edata first and then fall
back to _etext just in case.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230725001929.368041-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-07-28 19:01:16 -03:00
..
2023-04-04 16:41:57 -03:00
2022-01-12 17:01:38 -08:00
2023-04-04 16:41:57 -03:00
2022-06-28 12:05:25 -03:00
2023-03-14 08:29:46 -03:00
2022-10-04 08:55:21 -03:00
2023-05-27 09:38:25 -03:00
2023-05-27 09:38:25 -03:00
2023-06-12 18:18:13 -03:00
2021-04-29 10:30:58 -03:00
2021-08-11 09:35:44 -03:00
2023-06-23 21:47:20 -07:00
2023-06-23 21:47:20 -07:00
2023-05-27 09:41:39 -03:00
2023-07-01 17:57:43 -07:00
2023-01-23 10:00:47 -03:00
2023-06-29 22:13:15 -07:00
2023-06-29 22:13:15 -07:00
2023-06-29 22:13:15 -07:00
2023-06-29 22:13:15 -07:00
2023-06-12 15:57:54 -03:00
2023-03-20 19:28:21 -03:00
2021-02-03 13:10:44 -03:00
2023-06-12 15:57:54 -03:00
2021-07-15 17:30:22 -03:00
2023-06-23 21:47:20 -07:00
2023-06-23 21:47:20 -07:00
2023-06-12 15:57:54 -03:00
2023-06-27 23:38:39 -07:00
2023-06-27 23:38:39 -07:00
2023-04-06 21:40:28 -03:00
2023-04-06 21:40:28 -03:00
2023-06-27 23:38:39 -07:00
2022-12-14 15:28:18 -03:00
2023-03-20 19:28:21 -03:00
2020-10-14 13:34:26 -03:00
2021-02-17 15:15:06 -03:00
2022-06-23 11:54:22 -03:00
2022-10-04 08:55:20 -03:00
2023-04-10 19:20:53 -03:00
2023-04-10 19:21:31 -03:00