Skip to content

Commit 5b427df

Browse files
ahunter6acmel
authored andcommitted
perf kcore_copy: Do not check /proc/modules is unchanged
/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]>
1 parent 6cc4479 commit 5b427df

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
@@ -2102,8 +2102,8 @@ static int kcore_copy__compare_file(const char *from_dir, const char *to_dir,
21022102
* unusual. One significant peculiarity is that the mapping (start -> pgoff)
21032103
* is not the same for the kernel map and the modules map. That happens because
21042104
* the data is copied adjacently whereas the original kcore has gaps. Finally,
2105-
* kallsyms and modules files are compared with their copies to check that
2106-
* modules have not been loaded or unloaded while the copies were taking place.
2105+
* kallsyms file is compared with its copy to check that modules have not been
2106+
* loaded or unloaded while the copies were taking place.
21072107
*
21082108
* Return: %0 on success, %-1 on failure.
21092109
*/
@@ -2166,9 +2166,6 @@ int kcore_copy(const char *from_dir, const char *to_dir)
21662166
goto out_extract_close;
21672167
}
21682168

2169-
if (kcore_copy__compare_file(from_dir, to_dir, "modules"))
2170-
goto out_extract_close;
2171-
21722169
if (kcore_copy__compare_file(from_dir, to_dir, "kallsyms"))
21732170
goto out_extract_close;
21742171

0 commit comments

Comments
 (0)