Skip to contentSkip to conversation

scripts/archive_buildstats.py: copy all buildstats

PATCH In review Randy MacLeod 2 participants 2 messages Jun 22, 2022 – Jun 23, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/archive_buildstats.py: copy all buildstats

As a first pass, collect all the tmp/buildstats logs using 'cp -a', to enable review and graphing of all builds. The goal is to understand the trends in the /proc/pressure/{cpu|io} data that is now gathered as part of the buildstats system.

---
 scripts/archive_buildstats.py | 27 +++++++++++++++++++++++++++
 scripts/run-config            |  1 +
 2 files changed, 28 insertions(+)
 create mode 100755 scripts/archive_buildstats.py
scripts/archive_buildstats.py new file +27 -0
new file mode 100755
index 0000000..bdbe9f4
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+import os, sys
+
+def usage():
+    print("Usage: " + sys.argv[0] + " <src> <dest> <target>")
+
+def main():
+    if len(sys.argv) != 4:
+        usage()
+        sys.exit()
+
+    builddir = sys.argv[1]
+    dest = sys.argv[2]
+    target = sys.argv[3]
+
+    bsdir = os.path.join(builddir, "tmp/buildstats")
+    directory = os.path.join(dest, target)
+
+    os.system('mkdir -p ' + directory)
+    # cp -a <path-to-worker-buildstats> <directory>
+    os.system('cp -a ' +  builddir + ' ' + directory)
+
+main()
scripts/run-config +1 -0
index 838847a..953977e 100755
@@ -334,6 +334,7 @@ elif args.phase == "finish" and args.stepname == "collect-results":
         hp.printheader("Running results collection")
         runcmd([scriptsdir + "/collect-results", args.builddir, args.results_dir, args.target])
         runcmd([scriptsdir + "/summarize_top_output.py", args.results_dir, args.target])
+        runcmd([scriptsdir + "/archive_buildstats.py", args.builddir, args.results_dir, args.target])
     sys.exit(0)
 
 if jcfg:
Signature · 1 line
2.32.0
#1 lore raw
Quoted 5 lines · Randy MacLeod

As a first pass, collect all the tmp/buildstats logs using 'cp -a', to enable review and graphing of all builds. The goal is to understand the trends in the /proc/pressure/{cpu|io} data that is now gathered as part of the buildstats system.

Quoted 7 lines
---
 scripts/archive_buildstats.py | 27 +++++++++++++++++++++++++++
 scripts/run-config            |  1 +
 2 files changed, 28 insertions(+)
 create mode 100755 scripts/archive_buildstats.py

The NAS couldn't cope with the number of small files these data trees contained leading to timeouts. If you want to do something like this you'll probably have to create tarball archives of the results.

Cheers,

Richard