summaryrefslogtreecommitdiff
path: root/meta/classes/image-swab.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-10 11:50:16 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-10 11:51:48 +0000
commit296866c38e1b88df42d66bdc32cfed2d5212914c (patch)
treef56631b4a7ed520ad4c7198c14a8746cc30cd01b /meta/classes/image-swab.bbclass
parentd3d236b2bf2784d7454dcb7fce595b6aac6967cd (diff)
downloadopenembedded-core-296866c38e1b88df42d66bdc32cfed2d5212914c.tar.gz
openembedded-core-296866c38e1b88df42d66bdc32cfed2d5212914c.tar.bz2
openembedded-core-296866c38e1b88df42d66bdc32cfed2d5212914c.zip
image-swab: Convert to attach strace to the process to obtain the required swabber data
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image-swab.bbclass')
-rw-r--r--meta/classes/image-swab.bbclass19
1 files changed, 17 insertions, 2 deletions
diff --git a/meta/classes/image-swab.bbclass b/meta/classes/image-swab.bbclass
index ec949ffe2e..b939ec4b45 100644
--- a/meta/classes/image-swab.bbclass
+++ b/meta/classes/image-swab.bbclass
@@ -2,7 +2,7 @@ HOST_DATA ?= "${TMPDIR}/host-contamination-data/"
SWABBER_REPORT ?= "${LOG_DIR}/swabber/"
SWABBER_LOGS ?= "${LOG_DIR}/contamination-logs"
TRACE_LOGDIR ?= "${SWABBER_LOGS}/${PACKAGE_ARCH}"
-export TRACE_LOGFILE = "${TRACE_LOGDIR}/${PN}-${PV}"
+TRACE_LOGFILE = "${TRACE_LOGDIR}/${PN}-${PV}"
SWAB_ORIG_TASK := "${BB_DEFAULT_TASK}"
BB_DEFAULT_TASK = "generate_swabber_report"
@@ -56,7 +56,22 @@ python() {
bb.data.setVarFlag('do_setscene', 'depends', " ".join(deps), d)
logdir = bb.data.expand("${TRACE_LOGDIR}", d)
bb.utils.mkdirhier(logdir)
- bb.data.setVar('BB_RUNTASK', 'bitbake-runtask-strace', d)
+ else:
+ bb.data.setVar('STRACEFUNC', '', d)
+}
+
+STRACEPID = "${@os.getpid()}"
+STRACEFUNC = "imageswab_attachstrace"
+
+do_configure[prefuncs] += "${STRACEFUNC}"
+do_compile[prefuncs] += "${STRACEFUNC}"
+
+imageswab_attachstrace () {
+ STRACE=`which strace`
+
+ if [ -x "$STRACE" ]; then
+ swabber-strace-attach "$STRACE -f -o ${TRACE_LOGFILE}-${BB_CURRENTTASK}.log -e trace=open,execve -p ${STRACEPID}" "${TRACE_LOGFILE}-traceattach-${BB_CURRENTTASK}.log"
+ fi
}
do_generate_swabber_report () {