Changeset 433 for trunk/kernel/libk/elf.c
- Timestamp:
- Feb 14, 2018, 3:40:19 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/elf.c
r407 r433 201 201 vfs_file_count_up( file_xp ); 202 202 203 elf_dmsg("\n[DBG] %s : found %s vseg / base = %x / size = %x\n" 204 " file_size = %x / file_offset = %x / mapper_xp = %l\n", 205 __FUNCTION__ , vseg_type_str(vseg->type) , vseg->min , vseg->max - vseg->min , 206 vseg->file_size , vseg->file_offset , vseg->mapper_xp ); 203 #if CONFIG_DEBUG_ELF_LOAD 204 uint32_t cycle = (uint32_t)hal_get_cycles(); 205 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 206 printk("\n[DBG] %s : found %s vseg / base %x / size %x\n" 207 " file_size %x / file_offset %x / mapper_xp %l / cycle %d\n", 208 __FUNCTION__ , vseg_type_str(vseg->type) , vseg->min , vseg->max - vseg->min , 209 vseg->file_size , vseg->file_offset , vseg->mapper_xp ); 210 #endif 211 207 212 } 208 213 … … 223 228 error_t error; 224 229 225 elf_dmsg("\n[DBG] %s : core[%x,%d] enter for <%s>\n", 226 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , pathname ); 230 #if CONFIG_DEBUG_ELF_LOAD 231 uint32_t cycle = (uint32_t)hal_get_cycles(); 232 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 233 printk("\n[DBG] %s : thread %d enter for <%s> / cycle %d\n", 234 __FUNCTION__, CURRENT_THREAD, pathname, cycle ); 235 #endif 227 236 228 237 // avoid GCC warning … … 243 252 } 244 253 245 elf_dmsg("\n[DBG] %s : open file <%s>\n", __FUNCTION__ , pathname ); 254 #if (CONFIG_DEBUG_ELF_LOAD & 1) 255 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 256 printk("\n[DBG] %s : open file <%s>\n", __FUNCTION__, pathname ); 257 #endif 246 258 247 259 // load header in local buffer … … 256 268 } 257 269 258 elf_dmsg("\n[DBG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname ); 270 #if (CONFIG_DEBUG_ELF_LOAD & 1) 271 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 272 printk("\n[DBG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname ); 273 #endif 259 274 260 275 if( header.e_phnum == 0 ) … … 293 308 } 294 309 295 elf_dmsg("\n[DBG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname ); 310 #if (CONFIG_DEBUG_ELF_LOAD & 1) 311 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 312 printk("\n[DBG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname ); 313 #endif 296 314 297 315 // load seg descriptors array to local buffer … … 310 328 } 311 329 312 elf_dmsg("\n[DBG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname ); 330 #if (CONFIG_DEBUG_ELF_LOAD & 1) 331 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 332 printk("\n[DBG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname ); 333 #endif 313 334 314 335 // register loadable segments in process VMM … … 335 356 kmem_free(&req); 336 357 337 elf_dmsg("\n[DBG] %s : core[%x,%d] exit for <%s> / entry_point = %x\n", 338 __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , pathname , header.e_entry ); 358 #if CONFIG_DEBUG_ELF_LOAD 359 cycle = (uint32_t)hal_get_cycles(); 360 if( CONFIG_DEBUG_ELF_LOAD < cycle ) 361 printk("\n[DBG] %s : thread %d exit for <%s> / entry_point %x / cycle %d\n", 362 __FUNCTION__, CURRENT_THREAD, pathname, header.e_entry, cycle ); 363 #endif 339 364 340 365 return 0;
Note: See TracChangeset
for help on using the changeset viewer.