Skip to content

Commit 0dc13c1

Browse files
committed
Add Resource Monitoring during Build
1 parent 0e656b8 commit 0dc13c1

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,15 +217,37 @@ jobs:
217217
#git commit -s -a -m "getting rid of -dirty"
218218
219219
BUILD_TYPE="gki"
220-
BAZEL_ARGS=(--jobs=$(nproc --all) --verbose_failures --lto=thin)
220+
BAZEL_ARGS=(--jobs=$(nproc --all) --verbose_failures --lto=thin --sandbox_debug --verbose_failures --subcommands)
221221
if [ "${{ inputs.soc }}" == "sun" ]; then
222222
BUILD_TYPE="perf"
223223
BAZEL_ARGS+=(-g)
224224
fi
225225
226+
(stdbuf -oL bash -c '
227+
while true; do
228+
echo "=== $(date) ==="
229+
free -h
230+
echo "======"
231+
df -h
232+
echo "======"
233+
top -b -n 1 | head -n 15
234+
echo ""
235+
sleep 60
236+
done
237+
') &
238+
MONITOR_PID=$!
239+
trap "kill $MONITOR_PID" EXIT
240+
241+
bash -c '
242+
while true; do
243+
sync; echo 3 > /proc/sys/vm/drop_caches
244+
sleep 120
245+
done
246+
' >/dev/null 2>&1 &
247+
226248
if [ -f ./kernel_platform/build_with_bazel.py ]; then
227249
./kernel_platform/oplus/bazel/oplus_modules_variant.sh ${{ inputs.soc }} "$BUILD_TYPE" ""
228-
./kernel_platform/build_with_bazel.py -t ${{ inputs.soc }} "$BUILD_TYPE" "${BAZEL_ARGS[@]}" -o "$(pwd)/out"
250+
./kernel_platform/build_with_bazel.py -t ${{ inputs.soc }} $BUILD_TYPE "${BAZEL_ARGS[@]}" -o "$(pwd)/out"
229251
else
230252
LTO=thin ./kernel_platform/oplus/build/oplus_build_kernel.sh ${{ inputs.soc }} "$BUILD_TYPE"
231253
fi

0 commit comments

Comments
 (0)