Adds LTO to the CI build for Linux, which bring it as close as possible to the planned formal release, which will additionally use FDO. Adds some helper scripts to work with FDO files. Improves the build notes for how to create and use FDO files.
30 lines
943 B
Bash
Executable file
30 lines
943 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Copyright (c) 2020 Kevin R Croft <krcroft@gmail.com>
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# A helper script that fetches, converts, and merges kernel sample
|
|
# (.prof) files (collected during prior DOSBox testing) into a single
|
|
# LLVM-compatible Raw Profile record that can be used to optimize builds.
|
|
|
|
# Depedencies:
|
|
# - zstd
|
|
# - autofdo
|
|
|
|
set -euo pipefail
|
|
|
|
# The tarball containing one or more profile records
|
|
PROFILES="https://gitlab.com/luxtorpeda/dosbox-tests/-/raw/master/archives/profiles.tar.zst"
|
|
BINARY="tests/dosbox"
|
|
|
|
# Move to our repo root
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
# Fetch and unpack the profiles
|
|
wget "${PROFILES}" -O - | zstd -d | tar -x
|
|
|
|
# Convert and merge the profiles
|
|
find . -name '*.prof' -print0 \
|
|
| xargs -0 -P "$(nproc)" -I {} \
|
|
create_llvm_prof --binary="${BINARY}" --profile="{}" --out="{}".profraw
|
|
llvm-profdata-9 merge -sample -output=current.profraw tests/*/*.profraw
|