summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-03-03 15:41:29 -0600
committerLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-03-03 15:57:51 -0600
commit4e5b2d0e0abe2c6e52c3ca27272a52ef79a99a76 (patch)
tree8cf17a8dee64dfbf75fafddfe6c3f2149e77d553
parent2e5181e510f3fffee53cfeab0380e8ad9b5ae60c (diff)
downloadpoky-contrib-lsandov1/buildstats-forky-process.tar.gz
poky-contrib-lsandov1/buildstats-forky-process.tar.bz2
poky-contrib-lsandov1/buildstats-forky-process.zip
buildhistory.bbclass: strace -c every tasklsandov1/buildstats-forky-process
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
-rw-r--r--meta/classes/buildstats.bbclass12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/classes/buildstats.bbclass b/meta/classes/buildstats.bbclass
index 960653c7046..05a77e8a348 100644
--- a/meta/classes/buildstats.bbclass
+++ b/meta/classes/buildstats.bbclass
@@ -128,6 +128,7 @@ python run_buildstats () {
# set the buildname
########################################################################
bb.utils.mkdirhier(bsdir)
+ bb.utils.mkdirhier('/tmp/strace')
set_buildtimedata("__timedata_build", d)
build_time = os.path.join(bsdir, "build_stats")
# write start of build into build_time
@@ -162,6 +163,17 @@ python run_buildstats () {
f.write("Event: %s \n" % bb.event.getName(e))
f.write("Started: %0.2f \n" % e.time)
+ pn = d.getVar("PN", True)
+ parentpid = os.getpid()
+ pid = os.fork()
+ if pid == 0:
+ os.setsid()
+ pid2 = os.fork()
+ if pid2 > 0:
+ os._exit(os.EX_OK)
+ output = subprocess.check_output("strace -p %s -f -c -q -o /tmp/strace/%s.%s.%s" % (parentpid, pn, e.task, parentpid), shell=True)
+ os._exit(os.EX_OK)
+
elif isinstance(e, bb.build.TaskSucceeded):
write_task_data("passed", os.path.join(taskdir, e.task), e, d)
if e.task == "do_rootfs":