diff --git a/src/ksym.rs b/src/kernel/ksym.rs similarity index 100% rename from src/ksym.rs rename to src/kernel/ksym.rs diff --git a/src/kernel/mod.rs b/src/kernel/mod.rs new file mode 100644 index 00000000..07029fb1 --- /dev/null +++ b/src/kernel/mod.rs @@ -0,0 +1,7 @@ +mod ksym; +mod resolver; + +// TODO: KsymResolver should ideally be an implementation detail. +pub(crate) use ksym::KSymResolver; +pub(crate) use ksym::KALLSYMS; +pub(crate) use resolver::KernelResolver; diff --git a/src/kernel.rs b/src/kernel/resolver.rs similarity index 98% rename from src/kernel.rs rename to src/kernel/resolver.rs index 71afcf22..2d2ce9f7 100644 --- a/src/kernel.rs +++ b/src/kernel/resolver.rs @@ -5,7 +5,6 @@ use std::path::Path; use std::rc::Rc; use crate::elf::ElfResolver; -use crate::ksym::KSymResolver; use crate::symbolize::FindSymOpts; use crate::symbolize::Reason; use crate::symbolize::ResolvedSym; @@ -14,6 +13,8 @@ use crate::Addr; use crate::Error; use crate::Result; +use super::ksym::KSymResolver; + pub(crate) struct KernelResolver { pub ksym_resolver: Option>, diff --git a/src/lib.rs b/src/lib.rs index a1a14bc6..aa22e2e4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,7 +67,6 @@ mod gsym; mod insert_map; pub mod inspect; mod kernel; -mod ksym; mod maps; mod mmap; pub mod normalize; diff --git a/src/symbolize/symbolizer.rs b/src/symbolize/symbolizer.rs index e3a7610a..38848002 100644 --- a/src/symbolize/symbolizer.rs +++ b/src/symbolize/symbolizer.rs @@ -20,9 +20,9 @@ use crate::file_cache::FileCache; #[cfg(feature = "gsym")] use crate::gsym::GsymResolver; use crate::insert_map::InsertMap; +use crate::kernel::KSymResolver; use crate::kernel::KernelResolver; -use crate::ksym::KSymResolver; -use crate::ksym::KALLSYMS; +use crate::kernel::KALLSYMS; use crate::log; use crate::maps; use crate::maps::EntryPath;