diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-06-11 14:45:52 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-06-11 14:46:17 +0100 |
commit | 5a4c688958a7dc1258575c0f6c3bd1af165b2585 (patch) | |
tree | 50be9f432541c51769cecba5361c758005fc6f23 /meta/classes/packaged-staging.bbclass | |
parent | 4d503cfa062552046d9331a6dcfa724225cebc11 (diff) | |
download | poky-5a4c688958a7dc1258575c0f6c3bd1af165b2585.tar.gz |
packaged-staging.bbclass: Detect when we're using autotools_stage_all and don't hold the lock for as long when that is the case giving a significant performance boost with less lock contention and staging area file timestamp checking required
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes/packaged-staging.bbclass')
-rw-r--r-- | meta/classes/packaged-staging.bbclass | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/meta/classes/packaged-staging.bbclass b/meta/classes/packaged-staging.bbclass index 9b9ba16bff..5d0ee9aa99 100644 --- a/meta/classes/packaged-staging.bbclass +++ b/meta/classes/packaged-staging.bbclass | |||
@@ -63,6 +63,24 @@ python () { | |||
63 | bb.data.setVarFlag('do_setscene', 'recrdeptask', deps, d) | 63 | bb.data.setVarFlag('do_setscene', 'recrdeptask', deps, d) |
64 | 64 | ||
65 | bb.data.setVar("PSTAGING_ACTIVE", "1", d) | 65 | bb.data.setVar("PSTAGING_ACTIVE", "1", d) |
66 | |||
67 | # | ||
68 | # Here we notice if the staging function is one of our standard staging | ||
69 | # routines. If it is, we can remvoe the need to lock staging and take | ||
70 | # timestamps which gives a nice speedup | ||
71 | # | ||
72 | fastpath = False | ||
73 | stagefunc = bb.data.getVar('do_stage', d, 1).strip() | ||
74 | if stagefunc == "autotools_stage_all": | ||
75 | fastpath = True | ||
76 | if stagefunc == "do_stage_native" and bb.data.getVar('AUTOTOOLS_NATIVE_STAGE_INSTALL', d, 1) == "1": | ||
77 | fastpath = True | ||
78 | if fastpath: | ||
79 | bb.note("Can optimise " + bb.data.getVar('FILE', d, 1)) | ||
80 | bb.data.setVar("PSTAGING_NEEDSTAMP", "0", d) | ||
81 | bb.data.setVar("STAGE_TEMP_PREFIX", "${WORKDIR}/temp-staging-pstage", d) | ||
82 | else: | ||
83 | bb.data.setVar("PSTAGING_NEEDSTAMP", "1", d) | ||
66 | else: | 84 | else: |
67 | bb.data.setVar("PSTAGING_ACTIVE", "0", d) | 85 | bb.data.setVar("PSTAGING_ACTIVE", "0", d) |
68 | } | 86 | } |
@@ -297,14 +315,30 @@ populate_staging_postamble () { | |||
297 | fi | 315 | fi |
298 | } | 316 | } |
299 | 317 | ||
300 | do_populate_staging[lockfiles] = "${STAGING_DIR}/staging.lock" | 318 | autotools_staging_pstage () { |
319 | mkdir -p ${PSTAGE_TMPDIR_STAGE}/staging/ | ||
320 | cp -fpPR ${WORKDIR}/temp-staging-pstage/${STAGING_DIR}/* ${PSTAGE_TMPDIR_STAGE}/staging/ | ||
321 | cp -fpPR ${WORKDIR}/temp-staging-pstage/${STAGING_DIR}/* ${STAGING_DIR}/ | ||
322 | } | ||
323 | |||
324 | #do_populate_staging[lockfiles] = "${STAGING_DIR}/staging.lock" | ||
301 | do_populate_staging[dirs] =+ "${DEPLOY_DIR_PSTAGE}" | 325 | do_populate_staging[dirs] =+ "${DEPLOY_DIR_PSTAGE}" |
302 | python do_populate_staging_prepend() { | 326 | python do_populate_staging_prepend() { |
303 | bb.build.exec_func("populate_staging_preamble", d) | 327 | needstamp = bb.data.getVar("PSTAGING_NEEDSTAMP", d, 1) |
328 | lock = bb.data.expand("${STAGING_DIR}/staging.lock", d) | ||
329 | if needstamp == "1": | ||
330 | stamplock = bb.utils.lockfile(lock) | ||
331 | bb.build.exec_func("populate_staging_preamble", d) | ||
304 | } | 332 | } |
305 | 333 | ||
306 | python do_populate_staging_append() { | 334 | python do_populate_staging_append() { |
307 | bb.build.exec_func("populate_staging_postamble", d) | 335 | if needstamp == "1": |
336 | bb.build.exec_func("populate_staging_postamble", d) | ||
337 | bb.utils.unlockfile(stamplock) | ||
338 | else: | ||
339 | stamplock = bb.utils.lockfile(lock) | ||
340 | bb.build.exec_func("autotools_staging_pstage", d) | ||
341 | bb.utils.unlockfile(stamplock) | ||
308 | } | 342 | } |
309 | 343 | ||
310 | 344 | ||