Commit graph

15 commits

Author SHA1 Message Date
heather7283
768f254286 pgo: prefer full-headless-sway over full-headless-cage 2024-12-08 14:02:11 +04:00
heather7283
7e88e0bfdc
pgo: explicitly set LLVM_PROFILE_FILE envvar
When building foot with pgo under gentoo's portage, LLVM tried to
generate profile data files directly under system root, triggering
sandbox violation and causing build to fail. Setting this envvar fixes
the issue by explicitly specifying profiling data location.

Reference: https://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation
2024-12-08 09:10:43 +01:00
Daniel Eklöf
7999975016
Don't use fancy Unicode quotes, stick to ASCII 2024-02-06 12:36:45 +01:00
Fazzi
85a4e4ccc1 add CCACHE_DISABLE=1 to pgo.sh to avoid errors when ccache is enabled 2023-10-20 10:06:05 +01:00
Andrea Pappacoda
1313e6352a
build: fix GCC detection in pgo.sh
On my system, GCC doesn't output its name when passing the --version
flag:

    $ cc --version
    cc (Debian 12.2.0-3) 12.2.0
    Copyright (C) 2022 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

As the Free Software Foundation is unlikely to write another compiler, I
think that searching for the foundation's name instead of GCC is a good
enough fix (and I'm almost sure we wouldn't be the first ones to do so).
2022-10-23 23:56:34 +02:00
Daniel Eklöf
b1c03861cd
pgo: verify source dir really is a foot source dir before proceeding 2021-10-06 20:10:58 +02:00
Daniel Eklöf
b6df5f6456
pgo.sh: set -x *after* verifying input 2021-09-12 16:11:42 +02:00
Daniel Eklöf
5493267bf7
pgo: pgo.sh: remove both gcc and clang generated profile stats 2021-09-12 10:39:45 +02:00
Daniel Eklöf
a941253ba7
pgo: pgo.sh: add meson bld/src dir arguments last 2021-09-12 10:39:45 +02:00
Daniel Eklöf
6d67c2b4ab
pgo: pgo.sh: run ‘find’ in the build-directory, not cwd 2021-09-12 10:39:45 +02:00
Daniel Eklöf
e907ec209c
pgo: pgo.sh: allow a pre-existing build directory 2021-09-12 10:39:45 +02:00
Daniel Eklöf
cf7c5050f6
pgo: pgo.sh: auto: don’t use full-headless-sway
This requires Sway >= 1.6.2, which hasn’t been released yet. Thus,
don’t auto-use it.

Users can still request it explicitly.
2021-09-12 10:39:44 +02:00
Daniel Eklöf
99c4e51e19
pgo: add set -x to all PGO scripts
Without this, debugging error reports from users is going to be _very_
difficult...
2021-09-12 10:39:44 +02:00
Daniel Eklöf
801bce335b
pgo: full-headless-cage: new headless variant
Appears to work, but cage spams a lot of

 00:00:08.026 [types/wlr_output.c:720] Basic output test failed for HEADLESS-1
 00:00:08.036 [types/wlr_output.c:720] Basic output test failed for HEADLESS-1
2021-09-12 10:39:44 +02:00
Daniel Eklöf
a43ae0d098
pgo: replace meson-pgo.sh with several script primitives
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
2021-09-12 10:39:43 +02:00