Skip to contentSkip to conversation

buildstats.bbclass: Remove useless variables

PATCH New Junling Zheng 1 participant 2 messages Jun 3, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 buildstats.bbclass: Remove useless variables

Remove useless variables bn and bsdir in write_task_data().

---
 meta/classes/buildstats.bbclass | 2 --
 1 file changed, 2 deletions(-)
meta/classes/buildstats.bbclass +0 -2
index 2590c60c63..e7d47c74df 100644
@@ -80,8 +80,6 @@ def get_buildtimedata(var, d):
     return timediff, cpuperc
 
 def write_task_data(status, logfile, e, d):
-    bn = d.getVar('BUILDNAME')
-    bsdir = os.path.join(d.getVar('BUILDSTATS_BASE'), bn)
     with open(os.path.join(logfile), "a") as f:
         elapsedtime = get_timedata("__timedata_task", d, e.time)
         if elapsedtime:
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 buildstats.bbclass: Do not recalculate build start time

The build start time is recorded in __timedata_build, which we should use rather than recalculating it.

---
 meta/classes/buildstats.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/buildstats.bbclass +1 -1
index e7d47c74df..6f87187233 100644
@@ -136,7 +136,7 @@ python run_buildstats () {
                 if x:
                     f.write(x + " ")
             f.write("\n")
-            f.write("Build Started: %0.2f \n" % time.time())
+            f.write("Build Started: %0.2f \n" % d.getVar('__timedata_build', False)[0])
 
     elif isinstance(e, bb.event.BuildCompleted):
         build_time = os.path.join(bsdir, "build_stats")
Signature · 1 line
2.17.1