upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMoonEyes <ducoinbenjamin@yahoo.fr>2026-12-02 00:07:43 +0000
committerGitHub <noreply@github.com>2026-12-02 00:07:43 +0000
commit5d06e4793ea69a58db72e6b05ab8a7f6fd64847c (patch)
tree8c16d41764631f1cea97aa5f3f805b2bdcf35634 /scripts
parentce08fea0af9be991b2b1fe1a6d3be5f3c9814aa4 (diff)
parentf4831896242ebadf893fe061b5467673d2970861 (diff)
Merge pull request #2967 from aznohonza/tools/cgroup-memory-peak
game_run_summary: record the run cgroup's memory peak
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/run_game_wine.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/run_game_wine.sh b/scripts/run_game_wine.sh
index 96daae6d0..55acf853f 100755
--- a/scripts/run_game_wine.sh
+++ b/scripts/run_game_wine.sh
@@ -245,6 +245,8 @@ else
245fi 245fi
246export QT_QPA_PLATFORM=offscreen 246export QT_QPA_PLATFORM=offscreen
247DRM_SYSFS=${LEONIDA_DRM_SYSFS_DIR:-/sys/class/drm} 247DRM_SYSFS=${LEONIDA_DRM_SYSFS_DIR:-/sys/class/drm}
248CGROUP_SELF=${LEONIDA_SELF_CGROUP_PATH:-/proc/self/cgroup}
249CGROUP_ROOT=${LEONIDA_CGROUP_ROOT:-/sys/fs/cgroup}
248if [ -n "$DEVICE" ]; then 250if [ -n "$DEVICE" ]; then
249 export MESA_VK_DEVICE_SELECT="$DEVICE!" 251 export MESA_VK_DEVICE_SELECT="$DEVICE!"
250 # kwin and Xwayland's glamor on the card that renders, so the present path stays on one device. 252 # kwin and Xwayland's glamor on the card that renders, so the present path stays on one device.
@@ -325,6 +327,13 @@ wait "$WATCH" 2>/dev/null || true
325teardown; SESSION_PID= 327teardown; SESSION_PID=
326T1=$(date +%s) 328T1=$(date +%s)
327 329
330# The cgroup's peak memory (cgroup v2, kernel 5.19+): the run's own systemd scope when it has one (the unit
331# also carries MemoryMax), else the caller's cgroup since it was created. Absent on cgroup v1: no line then.
332cg_rel=$(sed -n 's/^0:://p' "$CGROUP_SELF" 2>/dev/null || true)
333if [ -n "$cg_rel" ] && [ -r "$CGROUP_ROOT$cg_rel/memory.peak" ]; then
334 cat "$CGROUP_ROOT$cg_rel/memory.peak" > "$RUN/memory_peak" 2>/dev/null || rm -f "$RUN/memory_peak"
335fi
336
328echo "== $(tr '\n' ';' < "$RUN/session.txt" 2>/dev/null | sed 's/;$//')" 337echo "== $(tr '\n' ';' < "$RUN/session.txt" 2>/dev/null | sed 's/;$//')"
329if [ ! -f "$RUN/exit_code" ]; then 338if [ ! -f "$RUN/exit_code" ]; then
330 echo "the run did not start or the session ended early ($((T1 - T0)) s); see $RUN/session.log" >&2 339 echo "the run did not start or the session ended early ($((T1 - T0)) s); see $RUN/session.log" >&2