summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-05-11 12:17:54 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-15 19:06:06 +0100
commit75fcc7c806004176dd6a981d9e318e220d605a7d (patch)
tree08fd52415c050bfc8099fc8a63bab5412a5563f0 /meta/classes/sstate.bbclass
parentd09e4df16bc3a937c89ed4375cc3c562f78c7624 (diff)
downloadpoky-75fcc7c806004176dd6a981d9e318e220d605a7d.tar.gz
sstate.bbclass: Optimize the generation and install path fixups
The fixmepath file that is generated contains a list of all of the files that need their paths fixed. In the previous version the fixmepath was generated to include all of the files that sed may have changed. In the new version, we first grep the files to see if they contain a path that needs to be changed, only then do we perform the sed operation on those files. This results in a modest performance increate in the creation of the sstate file. The following numbers include the do_package and do_populate_sysroot tasks on the perl recipe. Before the change: real 4m23.018s user 1m57.067s sys 1m33.327s After the change: real 4m13.083s user 1m54.062s sys 1m26.064s However, a more significnt performance gain is felt during the extraction/install of sstate cache files, as the fixmepaths file now has a significantly smaller list of files to modify. Before the change: real 0m39.798s user 0m11.158s sys 0m12.642s After the change: real 0m25.511s user 0m8.408s sys 0m5.077s (All numbers above were recorded with a cold filesystem cache on a machine with 12 GB of ram.) (From OE-Core rev: 46067264bedeff8248a2b2441733420fe6651f84) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index ad7d121f25..3fc615d1e7 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -321,10 +321,13 @@ def sstate_hardcode_path(d):
321 sstate_builddir = d.getVar('SSTATE_BUILDDIR', True) 321 sstate_builddir = d.getVar('SSTATE_BUILDDIR', True)
322 322
323 if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d): 323 if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d):
324 sstate_grep_cmd = "grep -l -e '%s'" % (staging)
324 sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIR:g'" % (staging) 325 sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIR:g'" % (staging)
325 elif bb.data.inherits_class('cross', d): 326 elif bb.data.inherits_class('cross', d):
327 sstate_grep_cmd = "grep -l -e '(%s|%s)'" % (staging_target, staging)
326 sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRTARGET:g; s:%s:FIXMESTAGINGDIR:g'" % (staging_target, staging) 328 sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRTARGET:g; s:%s:FIXMESTAGINGDIR:g'" % (staging_target, staging)
327 else: 329 else:
330 sstate_grep_cmd = "grep -l -e '%s'" % (staging_host)
328 sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % (staging_host) 331 sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % (staging_host)
329 332
330 sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD', True) 333 sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD', True)
@@ -333,7 +336,9 @@ def sstate_hardcode_path(d):
333 # fixmepath file needs relative paths, drop sstate_builddir prefix 336 # fixmepath file needs relative paths, drop sstate_builddir prefix
334 sstate_filelist_relative_cmd = "sed -i -e 's:^%s::g' %sfixmepath" % (sstate_builddir, sstate_builddir) 337 sstate_filelist_relative_cmd = "sed -i -e 's:^%s::g' %sfixmepath" % (sstate_builddir, sstate_builddir)
335 338
336 sstate_hardcode_cmd = "%s | %s | xargs %s" % (sstate_scan_cmd, sstate_filelist_cmd, sstate_sed_cmd) 339 # Limit the fixpaths and sed operations based on the initial grep search
340 # This has the side effect of making sure the vfs cache is hot
341 sstate_hardcode_cmd = "%s | xargs %s | %s | xargs %s" % (sstate_scan_cmd, sstate_grep_cmd, sstate_filelist_cmd, sstate_sed_cmd)
337 342
338 print "Removing hardcoded paths from sstate package: '%s'" % (sstate_hardcode_cmd) 343 print "Removing hardcoded paths from sstate package: '%s'" % (sstate_hardcode_cmd)
339 os.system(sstate_hardcode_cmd) 344 os.system(sstate_hardcode_cmd)