diff options
author | Namhyung Kim <[email protected]> | 2024-06-21 10:05:26 -0700 |
---|---|---|
committer | Namhyung Kim <[email protected]> | 2024-06-25 11:06:20 -0700 |
commit | e988a5b53ebd40c2fafc86250e95d69929796fbd (patch) | |
tree | 2821b5f2ebc02f83cb84b53de02a4db9fb20811c | |
parent | cb39d05e67dc24985ff9f5150e71040fa4d60ab8 (diff) |
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 <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
-rw-r--r-- | tools/perf/util/symbol.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index aee0a4cfb383..478e922ce676 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -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) |