Skip to contentSkip to conversation

config.json: collect data on failure by default

PATCH New [email protected] 1 participant 4 messages Jul 9, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 config.json: collect data on failure by default

---
 config.json | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
config.json +3 -1
index f54081b..99593c8 100644
@@ -61,7 +61,9 @@
             "RUNQEMU_TMPFS_DIR = '/home/pokybuild/tmp'",
             "BB_HEARTBEAT_EVENT = '60'",
             "BB_LOG_HOST_STAT_ON_INTERVAL = '1'",
-            "BB_LOG_HOST_STAT_CMDS_INTERVAL = 'oe-time-dd-test.sh 100'"
+            "BB_LOG_HOST_STAT_CMDS_INTERVAL = 'oe-time-dd-test.sh -c 100 -t 15'",
+            "BB_LOG_HOST_STAT_ON_FAILURE = '1'",
+            "BB_LOG_HOST_STAT_CMDS_FAILURE = 'oe-time-dd-test.sh -l'"
         ]
     },
     "templates" : {
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/4 collect-results: collect all host_stats files

data collection on failure is enabled by default.
Collect all host stats files created.

---
 scripts/collect-results | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
scripts/collect-results +11 -5
index 7178380..93834d6 100755
@@ -18,21 +18,27 @@ if [ -e $WORKDIR/buildhistory ]; then
     fi
 fi
 
-HSFILE=$WORKDIR/tmp/buildstats/*/host_stats
+HSFILE=$WORKDIR/tmp/buildstats/*/host_stats*
 d="intermittent_failure_host_data"
 
 mkdir -p $DEST/$target/$d
 
-step=0
+step_i=1
+step_f=1
 for f in $HSFILE; do
 	if [ -e $f ]; then
 	    cp $f $DEST/$target/$d
+        if [[ "$f" == *"failure"* ]] ; then
+            mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step_f}.txt
+            step_f=$((step_f+1))
+            continue
+        fi
 	    grep -m 1 "^top -" $f
 	    if [ $? -eq 0 ]; then
-		    mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step}_top.txt
+		    mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step_i}_top.txt
 	    else
-		    mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step}.txt
+		    mv $DEST/$target/$d/`basename $f` $DEST/$target/$d/`basename $f`_${step_i}.txt
 	    fi
-	    step=$((step+1))
+	    step_i=$((step_i+1))
 	fi
 done
Signature · 1 line
2.25.1
#2 lore raw

PATCH 3/4 summarize_top_output.py: summarize data logged on failure

In reply to [email protected]
---
 scripts/summarize_top_output.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
scripts/summarize_top_output.py +6 -4
index 50c9b0a..4e96ce9 100755
@@ -168,9 +168,11 @@ def main():
     target = sys.argv[2]
     host_data_dir = "intermittent_failure_host_data"
     directory = os.path.join(dest, target, host_data_dir)
-    for f in glob.glob(directory + "/*_top.txt"):
-        outputs = list_top_outputs(f)
-        short_summary, summary, kernel_summary, zombie_summary, other_build = summarize_top(outputs, target)
-        write_summary(short_summary, summary, kernel_summary, zombie_summary, other_build, target, f)
+    regs = (directory + "/*_top.txt", directory + "/*_failure_*.txt")
+    for exts in regs:
+        for f in glob.glob(exts):
+            outputs = list_top_outputs(f)
+            short_summary, summary, kernel_summary, zombie_summary, other_build = summarize_top(outputs, target)
+            write_summary(short_summary, summary, kernel_summary, zombie_summary, other_build, target, f)
 
 main()
Signature · 1 line
2.25.1
#3 lore raw

PATCH 4/4 scripts/generate-testresult-index.py: update index to list host data

In reply to [email protected]

Host data is collected on failure by default. List the collected files in the index.

---
 scripts/generate-testresult-index.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
scripts/generate-testresult-index.py +7 -5
index d85d606..5c33778 100755
@@ -152,13 +152,15 @@ for build in sorted(os.listdir(path), key=keygen, reverse=True):
         buildhistory.append((reldir + "testresults/qemuarm/buildhistory.txt", "qemuarm"))
 
     hd = []
-    counter = 0
-    # do we really need the loop?
-    for p in glob.glob(buildpath + "/*/*/host_stats*top_summary.txt"):
+    for p in glob.glob(buildpath + "/*/*/host_stats*summary.txt"):
         n_split = p.split(build)
         res = reldir[0:-1] + n_split[1]
-        hd.append((res, str(counter)))
-        counter += 1
+        n = os.path.basename(p).split("host_stats_")[-1]
+        if "failure" in n:
+            n = n.split("_summary.txt")[0]
+        elif "top" in n:
+            n = n.split("_top_summary.txt")[0]
+        hd.append((res, n))
 
 
     branch = get_build_branch(buildpath)
Signature · 1 line
2.25.1