config/functions: store config info in history

This commit is contained in:
MilhouseVH 2019-12-28 22:49:32 +00:00
parent 748befe904
commit 439f38bcff

View File

@ -1424,6 +1424,12 @@ pkg_lock_status() {
( (
flock --exclusive 94 flock --exclusive 94
# Write the configured number of slots to history to improve accuracy of later analysis
if [ ! -f "${THREAD_CONTROL}/history" ]; then
printf "%s: <%06d> [%0*d/%0*d] %-7s %-7s %s %s\n" \
"$(date +%Y-%m-%d\ %H:%M:%S.%N)" $$ ${idwidth} 0 ${#MTMAXJOBS} 0 "IDLE" "config" "info" "slots=${MTMAXSLOT};jobs=${MTMAXJOBS}" >>"${THREAD_CONTROL}/history"
fi
printf -v line "%s: <%06d> [%0*d/%0*d] %-7s %-7s %-35s" \ printf -v line "%s: <%06d> [%0*d/%0*d] %-7s %-7s %-35s" \
"$(date +%Y-%m-%d\ %H:%M:%S.%N)" $$ ${idwidth} ${this_job} ${#MTMAXJOBS} ${PARALLEL_SEQ:-0} "${status}" "${task}" "${pkg}" "$(date +%Y-%m-%d\ %H:%M:%S.%N)" $$ ${idwidth} ${this_job} ${#MTMAXJOBS} ${PARALLEL_SEQ:-0} "${status}" "${task}" "${pkg}"
[ -n "${msg}" ] && line+=" (${msg})" [ -n "${msg}" ] && line+=" (${msg})"