mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-20 04:19:41 +00:00
perf symbol: Simplify kernel module checking
In dso__load(), it checks if the dso is a kernel module by looking the symtab type. Actually dso has 'is_kmod' field to check that easily and dso__set_module_info() set the symtab type and the is_kmod bit. So it should have the same result to check the is_kmod bit. Reviewed-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20240621170528.608772-3-namhyung@kernel.org
This commit is contained in:
parent
cb39d05e67
commit
e988a5b53e
@ -1817,10 +1817,7 @@ int dso__load(struct dso *dso, struct map *map)
|
||||
goto out;
|
||||
}
|
||||
|
||||
kmod = dso__symtab_type(dso) == DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE ||
|
||||
dso__symtab_type(dso) == DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP ||
|
||||
dso__symtab_type(dso) == DSO_BINARY_TYPE__GUEST_KMODULE ||
|
||||
dso__symtab_type(dso) == DSO_BINARY_TYPE__GUEST_KMODULE_COMP;
|
||||
kmod = dso__is_kmod(dso);
|
||||
|
||||
if (dso__kernel(dso) && !kmod) {
|
||||
if (dso__kernel(dso) == DSO_SPACE__KERNEL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user