@@ -16,7 +16,7 @@ pub struct SavedArtifacts {
1616 pub debug_info : HashMap < String , ModuleDebugInfo > ,
1717 pub mapped_process_debug_info_by_pid : HashMap < pid_t , Vec < MappedProcessDebugInfo > > ,
1818 pub mapped_process_unwind_data_by_pid : HashMap < pid_t , Vec < MappedProcessUnwindData > > ,
19- pub ignored_modules : Vec < ( String , u64 , u64 ) > ,
19+ pub ignored_modules_by_pid : HashMap < pid_t , Vec < ( String , u64 , u64 ) > > ,
2020 pub key_to_path : HashMap < String , PathBuf > ,
2121}
2222
@@ -43,7 +43,7 @@ pub fn save_artifacts(
4343 & mut path_to_key,
4444 ) ;
4545
46- let ignored_modules = collect_ignored_modules ( mounted_modules_by_path) ;
46+ let ignored_modules_by_pid = collect_ignored_modules ( mounted_modules_by_path) ;
4747
4848 let key_to_path = path_to_key
4949 . into_iter ( )
@@ -55,7 +55,7 @@ pub fn save_artifacts(
5555 debug_info,
5656 mapped_process_debug_info_by_pid,
5757 mapped_process_unwind_data_by_pid,
58- ignored_modules ,
58+ ignored_modules_by_pid ,
5959 key_to_path,
6060 }
6161}
@@ -247,10 +247,11 @@ fn save_unwind_data(
247247}
248248
249249/// Collect ignored modules by finding known-ignored and python modules in the mounted modules.
250+ /// Returns per-pid entries with runtime address ranges derived from symbol bounds + load bias.
250251fn collect_ignored_modules (
251252 mounted_modules_by_path : & HashMap < PathBuf , MountedModule > ,
252- ) -> Vec < ( String , u64 , u64 ) > {
253- let mut to_ignore = vec ! [ ] ;
253+ ) -> HashMap < pid_t , Vec < ( String , u64 , u64 ) > > {
254+ let mut by_pid : HashMap < pid_t , Vec < ( String , u64 , u64 ) > > = HashMap :: new ( ) ;
254255
255256 let ignore_paths = get_objects_path_to_ignore ( ) ;
256257
@@ -269,16 +270,22 @@ fn collect_ignored_modules(
269270 continue ;
270271 }
271272
272- for pm in m. process_mounted_module . values ( ) {
273- if let Some ( ref pud) = pm. process_unwind_data {
274- to_ignore. push ( (
273+ let addr_bounds = m. module_symbols . as_ref ( ) . and_then ( |ms| ms. addr_bounds ( ) ) ;
274+
275+ let Some ( ( elf_start, elf_end) ) = addr_bounds else {
276+ continue ;
277+ } ;
278+
279+ for ( & pid, pm) in & m. process_mounted_module {
280+ if let Some ( load_bias) = pm. symbols_load_bias {
281+ by_pid. entry ( pid) . or_default ( ) . push ( (
275282 path_str. to_string ( ) ,
276- pud . avma_range . start ,
277- pud . avma_range . end ,
283+ elf_start + load_bias ,
284+ elf_end + load_bias ,
278285 ) ) ;
279286 }
280287 }
281288 }
282289
283- to_ignore
290+ by_pid
284291}
0 commit comments