mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-31 14:37:59 +00:00
Merge pull request #3318 from MilhouseVH/le92_mt_build
buildsystem: add multithreaded ad-hoc package build
This commit is contained in:
commit
74bd23c21d
14
scripts/build_mt
Executable file
14
scripts/build_mt
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
|
. config/options ""
|
||||||
|
. config/multithread
|
||||||
|
|
||||||
|
# Setup both toolchain cmake configs to avoid potentially racy behaviour later.
|
||||||
|
# Use a fork for host to isolate any variable modifications.
|
||||||
|
( setup_toolchain host )
|
||||||
|
setup_toolchain target
|
||||||
|
|
||||||
|
MTADDONBUILD=no start_multithread_build ${@}
|
@ -27,8 +27,15 @@ class HistoryEvent:
|
|||||||
self.secs = (datetime.datetime.strptime(self.datetime, "%Y-%m-%d %H:%M:%S.%f") - EPOCH).total_seconds()
|
self.secs = (datetime.datetime.strptime(self.datetime, "%Y-%m-%d %H:%M:%S.%f") - EPOCH).total_seconds()
|
||||||
return self.secs
|
return self.secs
|
||||||
|
|
||||||
def secs_to_hms(secs):
|
def secs_to_hms(seconds, blankzero=False):
|
||||||
return "%02d:%02d:%06.3f" % (int(secs / 3600), int(secs / 60 % 60), secs % 60)
|
hours = "%02d" % int(seconds / 3600)
|
||||||
|
mins = "%02d" % int(seconds / 60 % 60)
|
||||||
|
secs = "%06.3f" % (seconds % 60)
|
||||||
|
if blankzero and hours == "00":
|
||||||
|
hours = " "
|
||||||
|
if mins == "00":
|
||||||
|
mins = " "
|
||||||
|
return "%2s:%2s:%s" % (hours, mins, secs)
|
||||||
|
|
||||||
def get_slot_val(slot):
|
def get_slot_val(slot):
|
||||||
return slots[slot]["total"]
|
return slots[slot]["total"]
|
||||||
@ -87,7 +94,7 @@ for slotn in slots:
|
|||||||
|
|
||||||
elapsed = (ended - started)
|
elapsed = (ended - started)
|
||||||
|
|
||||||
print("Total Build Time: %s\n" % secs_to_hms(elapsed))
|
print("Total Build Time: %s\n" % secs_to_hms(elapsed, blankzero=False))
|
||||||
|
|
||||||
print("Peak concurrency: %d out of %d slots\n" % (peak, len(slots)))
|
print("Peak concurrency: %d out of %d slots\n" % (peak, len(slots)))
|
||||||
|
|
||||||
@ -100,13 +107,13 @@ for rank, slotn in enumerate(sorted(slots, key=get_slot_val, reverse=True)):
|
|||||||
slot = slots[slotn]
|
slot = slots[slotn]
|
||||||
pct = (100 * slot["total"] / elapsed) if elapsed > 0.0 else 0.0
|
pct = (100 * slot["total"] / elapsed) if elapsed > 0.0 else 0.0
|
||||||
state = " active" if slot["active"] else " "
|
state = " active" if slot["active"] else " "
|
||||||
stime = secs_to_hms(slot["total"]).replace("00:", " :")
|
stime = secs_to_hms(slot["total"], blankzero=True)
|
||||||
lines.append("%s %s (%04.1f%%)%s" % (slotn, stime, pct, state))
|
lines.append("%s %s (%04.1f%%)%s" % (slotn, stime, pct, state))
|
||||||
|
|
||||||
for rank, concurrentn in enumerate(sorted(concurrency, key=get_concurrent_val, reverse=True)):
|
for rank, concurrentn in enumerate(sorted(concurrency, key=get_concurrent_val, reverse=True)):
|
||||||
concurrent = concurrency[concurrentn]
|
concurrent = concurrency[concurrentn]
|
||||||
pct = (100 * concurrent["total"] / elapsed) if elapsed > 0.0 else 0.0
|
pct = (100 * concurrent["total"] / elapsed) if elapsed > 0.0 else 0.0
|
||||||
stime = secs_to_hms(concurrent["total"]).replace("00:", " :")
|
stime = secs_to_hms(concurrent["total"], blankzero=True)
|
||||||
lines[rank] += " %02d %s (%04.1f%%)" % (concurrentn, stime, pct)
|
lines[rank] += " %02d %s (%04.1f%%)" % (concurrentn, stime, pct)
|
||||||
|
|
||||||
for rank, line in enumerate(lines):
|
for rank, line in enumerate(lines):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user