Ignore:
Timestamp:
Oct 31, 2008, 4:55:06 AM (17 years ago)
Author:
bird
Message:

footer.kmk,header.kmk: KBUILD_PROFILE_SELF updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/header.kmk

    r1782 r2008  
    3636ifdef KBUILD_PROFILE_SELF
    3737 _KBUILD_TS_HEADER_START := $(nanots ) # just a dummy warm up query
    38  $(info prof: since start - since previous - event description)
    39  $(info stat: $(make-stats ))
     38 $(info prof: since start - since previous -- event description)
     39 ifeq ($(KBUILD_PROFILE_SELF),2)
     40  $(info stat: $(make-stats ))
     41 endif
    4042 _KBUILD_TS_HEADER_START := $(nanots )
    4143 _KBUILD_TS_PREV := $(_KBUILD_TS_HEADER_START)
     44
     45 _KBUILD_FMT_ELAPSED_EX = $(int-div $(int-add $(int-sub $1, $2),500000),1000000)ms
     46 _KBUILD_FMT_ELAPSED = $(call _KBUILD_FMT_ELAPSED_EX,$(_KBUILD_TS_NOW),$1)
     47
     48define def_profile_self
     49 _KBUILD_TS_NOW := $(nanots )
     50 $(info prof: $(call _KBUILD_FMT_ELAPSED,$(_KBUILD_TS_HEADER_START)) - $(call _KBUILD_FMT_ELAPSED, $(_KBUILD_TS_PREV)) -- $(strip $1))
     51 ifeq ($(KBUILD_PROFILE_SELF),2)
     52  $(info stat: $(make-stats ))
     53 endif
     54 _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
     55endef
     56
    4257endif
    4358
     
    10061021# Include the config.kmk we found file (or the default one).
    10071022ifdef KBUILD_PROFILE_SELF
    1008  _KBUILD_TS_NOW := $(nanots )
    1009  $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - including $(_CFGFILE))
    1010  $(info stat: $(make-stats ))
    1011  _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
    1012 
     1023 $(evalcall def_profile_self, including $(_CFGFILE))
    10131024 include $(_CFGFILE)
    1014 
    1015  _KBUILD_TS_NOW := $(nanots )
    1016  $(info prof: $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_NOW), $(_KBUILD_TS_PREV)) - included $(_CFGFILE))
    1017  $(info stat: $(make-stats ))
    1018  _KBUILD_TS_PREV := $(_KBUILD_TS_NOW)
     1025 $(evalcall def_profile_self, included $(_CFGFILE))
    10191026else
    10201027 include $(_CFGFILE)
     
    12041211
    12051212ifdef KBUILD_PROFILE_SELF
    1206  _KBUILD_TS_HEADER_END := $(nanots )
    1207  $(info prof: $(int-sub $(_KBUILD_TS_HEADER_END), $(_KBUILD_TS_HEADER_START)) - $(int-sub $(_KBUILD_TS_HEADER_END), $(_KBUILD_TS_PREV)) - end of header.kmk)
    1208  $(info stat: $(make-stats ))
    1209  _KBUILD_TS_PREV := $(_KBUILD_TS_HEADER_END)
     1213 $(evalcall def_profile_self, end of header.kmk)
     1214 _KBUILD_TS_HEADER_END := $(_KBUILD_TS_PREV)
    12101215endif
    12111216
Note: See TracChangeset for help on using the changeset viewer.