mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
All scripts are in the ‘pgo’ directory:
* options: command line options for generate-alt-random-writes.py,
sourced by other scripts.
* pgo.sh: top-level script, generates a meson build directory, selects
a PGO method, generates the profiling data, re-configures the meson
build directory and does the final build.
This script is intended to be used by end-users, and shows _how_ to
integrate the script primitives.
Build servers will most likely *not* want to use this script as-is.
* partial.sh: generates alt-random-write data and runs “foot{,client}
--version”, and then feeds the alt-random data to the PGO helper
binary. Does not require a running Wayland session. Touches
$blddir/pgo-ok on success.
* full-inner.sh: runs “footclient --version”, and then a complex
“foot” command that first generates alt-random-write data, and then
“cat’s” it. Requires a running Wayland session, *but*, this script
is usually not called directly (see below). Touches $blddir/pgo-ok
onsucces..
* full-current-session.sh: runs full-inner.sh. That is, it runs foot
in the currently running Wayland session. Note that this will pop up a
foot window.
* full-headless-sway.sh: generates a custom Sway configuration that
exec’s foot-headless-sway-inner.sh (see below), and then executes a
headless Sway. In other words, this script does a *full* PGO build,
but *without* requiring a running Wayland session. Requires Sway >=
1.6.2.
* full-headless-sway.sh: runs full-inner.sh + “swaymsg exit”.
To do a custom PGO build, without using pgo.sh, you’d need to:
CFLAGS=”$CFLAGS -O3” meson --buildtype=release -Db_lto=true
meson configure -Db_pgo=generate
ninja
ninja test (only needed if tllist+fcft are built as subprojects)
Run *one* of:
- partial.sh
- full-current-session.sh
- full-headless-sway.sh
meson configure -D b_pgo=use
ninja
31 lines
658 B
Bash
Executable file
31 lines
658 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
srcdir=$(realpath "${1}")
|
|
blddir=$(realpath "${2}")
|
|
|
|
. "${srcdir}"/pgo/options
|
|
|
|
pgo_data=$(mktemp)
|
|
trap "rm -f ${pgo_data}" EXIT INT HUP TERM
|
|
|
|
rm -f "${blddir}"/pgo-ok
|
|
|
|
# To ensure profiling data is generated in the build directory
|
|
cd "${blddir}"
|
|
|
|
LC_CTYPE=en_US.UTF-8 "${blddir}"/footclient --version
|
|
LC_CTYPE=en_US.UTF-8 "${blddir}"/foot \
|
|
-o tweak.render-timer=log \
|
|
--config=/dev/null \
|
|
--term=xterm \
|
|
sh -c "
|
|
set -eu
|
|
|
|
'${srcdir}/scripts/generate-alt-random-writes.py' \
|
|
${script_options} \"${pgo_data}\"
|
|
|
|
cat \"${pgo_data}\"
|
|
"
|
|
touch "${blddir}"/pgo-ok
|