Skip to content

Commit 1a83f39

Browse files
ahunter6gregkh
authored andcommitted
perf kcore_copy: Do not check /proc/modules is unchanged
[ Upstream commit 5b427df ] /proc/kallsyms and /proc/modules are compared before and after the copy in order to ensure no changes during the copy. However /proc/modules also might change due to reference counts changing even though that does not make any difference. Any modules loaded or unloaded should be visible in changes to kallsyms, so it is not necessary to check /proc/modules also anyway. Remove the comparison checking that /proc/modules is unchanged. Fixes: fc1b691 ("perf buildid-cache: Add ability to add kcore to the cache") Reported-by: Daniel Dao <[email protected]> Signed-off-by: Adrian Hunter <[email protected]> Tested-by: Daniel Dao <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a3b923f commit 1a83f39

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tools/perf/util/symbol-elf.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2091,8 +2091,8 @@ static int kcore_copy__compare_file(const char *from_dir, const char *to_dir,
20912091
* unusual. One significant peculiarity is that the mapping (start -> pgoff)
20922092
* is not the same for the kernel map and the modules map. That happens because
20932093
* the data is copied adjacently whereas the original kcore has gaps. Finally,
2094-
* kallsyms and modules files are compared with their copies to check that
2095-
* modules have not been loaded or unloaded while the copies were taking place.
2094+
* kallsyms file is compared with its copy to check that modules have not been
2095+
* loaded or unloaded while the copies were taking place.
20962096
*
20972097
* Return: %0 on success, %-1 on failure.
20982098
*/
@@ -2155,9 +2155,6 @@ int kcore_copy(const char *from_dir, const char *to_dir)
21552155
goto out_extract_close;
21562156
}
21572157

2158-
if (kcore_copy__compare_file(from_dir, to_dir, "modules"))
2159-
goto out_extract_close;
2160-
21612158
if (kcore_copy__compare_file(from_dir, to_dir, "kallsyms"))
21622159
goto out_extract_close;
21632160

0 commit comments

Comments
 (0)