Skip to content

Commit

Permalink
Introduce kernel sub-module
Browse files Browse the repository at this point in the history
Move functionality related to kernel symbolization and inspection into a
dedicated sub-module, kernel. In so doing we clean up the source root
somewhat and group closely related functionality. Ideally we'd move more
of the kernel resolver creation logic in there as well, but that is left
for a later time.

Signed-off-by: Daniel Müller <deso@posteo.net>
  • Loading branch information
d-e-s-o committed Oct 18, 2024
1 parent f03c5f4 commit df3b5dd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
File renamed without changes.
7 changes: 7 additions & 0 deletions src/kernel/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
3 changes: 2 additions & 1 deletion src/kernel.rs → src/kernel/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<Rc<KSymResolver>>,
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ mod gsym;
mod insert_map;
pub mod inspect;
mod kernel;
mod ksym;
mod maps;
mod mmap;
pub mod normalize;
Expand Down
4 changes: 2 additions & 2 deletions src/symbolize/symbolizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit df3b5dd

Please sign in to comment.