Ignore:
Timestamp:
Feb 14, 2018, 3:40:19 PM (4 years ago)
Author:
alain
Message:

blip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/elf.c

    r407 r433  
    201201                vfs_file_count_up( file_xp );
    202202
    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
     204uint32_t cycle = (uint32_t)hal_get_cycles();
     205if( CONFIG_DEBUG_ELF_LOAD < cycle )
     206printk("\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 ,
     209vseg->file_size , vseg->file_offset , vseg->mapper_xp );
     210#endif
     211
    207212        }
    208213
     
    223228        error_t      error;
    224229
    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
     231uint32_t cycle = (uint32_t)hal_get_cycles();
     232if( CONFIG_DEBUG_ELF_LOAD < cycle )
     233printk("\n[DBG] %s : thread %d enter for <%s> / cycle %d\n",
     234__FUNCTION__, CURRENT_THREAD, pathname, cycle );
     235#endif
    227236
    228237    // avoid GCC warning
     
    243252        }
    244253
    245     elf_dmsg("\n[DBG] %s : open file <%s>\n", __FUNCTION__ , pathname );
     254#if (CONFIG_DEBUG_ELF_LOAD & 1)
     255if( CONFIG_DEBUG_ELF_LOAD < cycle )
     256printk("\n[DBG] %s : open file <%s>\n", __FUNCTION__, pathname );
     257#endif
    246258
    247259        // load header in local buffer
     
    256268        }
    257269
    258         elf_dmsg("\n[DBG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname );
     270#if (CONFIG_DEBUG_ELF_LOAD & 1)
     271if( CONFIG_DEBUG_ELF_LOAD < cycle )
     272printk("\n[DBG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname );
     273#endif
    259274
    260275        if( header.e_phnum == 0 )
     
    293308        }
    294309
    295         elf_dmsg("\n[DBG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname );
     310#if (CONFIG_DEBUG_ELF_LOAD & 1)
     311if( CONFIG_DEBUG_ELF_LOAD < cycle )
     312printk("\n[DBG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname );
     313#endif
    296314
    297315        // load seg descriptors array to local buffer
     
    310328        }
    311329
    312         elf_dmsg("\n[DBG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname );
     330#if (CONFIG_DEBUG_ELF_LOAD & 1)
     331if( CONFIG_DEBUG_ELF_LOAD < cycle )
     332printk("\n[DBG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname );
     333#endif
    313334
    314335        // register loadable segments in process VMM
     
    335356        kmem_free(&req);
    336357
    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
     359cycle = (uint32_t)hal_get_cycles();
     360if( CONFIG_DEBUG_ELF_LOAD < cycle )
     361printk("\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
    339364
    340365        return 0;
Note: See TracChangeset for help on using the changeset viewer.