-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add PGO Applicability Feature (Prototype) #5193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
valeriepieger
wants to merge
27
commits into
firecracker-microvm:main
Choose a base branch
from
valeriepieger:add-pgo-build-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
a7f6494
tools/devtool: add PGO helper scripting to devtool
valeriepieger 69e3eae
docs/pgo-getting-started.md: added a getting started guide for PGO
valeriepieger 41864da
feat: Add PVTime support for ARM
DakshinD 10429dc
test: Add steal time integration tests
DakshinD a2ae6bd
doc: Add changelog entry for PVTime
DakshinD 83b3e77
build(deps): Bump the firecracker group with 12 updates
dependabot[bot] e8a6d6a
test(signal): remove flaky unit test
Manciukic 1ebf723
test(jailer): use tmp dir for mknod test
Manciukic ead75b7
refactor(test/cgroup): use a TempDir instead of a manually created dir
Manciukic 377b7fa
test(net): add retry in test_tap_offload
Manciukic 482b2ec
test(balloon): ensure we gave stats enough time to update before reading
Manciukic 421b155
fix(test/pvtime): bump tolerance to 10s
Manciukic 080c876
fix(test_reboot): do not assert thread count
Manciukic ee6a2cc
feat(tests): add systemd_analyze data as boot time metric
ShadowCurse 7d164e6
refactor(tests): update boot time device metrics
ShadowCurse 65b8b33
feat(tests): add resume metric to boot time tests
ShadowCurse 949ac4c
chore: ignore boot test resume_time metric in A/B
ShadowCurse 783ca67
doc: fix arguments to ab_test.py in README
roypat 29517f6
fix(ab): only reduce dimension set for printing
roypat 3a990f2
ab: ignore some block throughput metrics on m8g
roypat 7579beb
build(deps): Bump the firecracker group with 9 updates
dependabot[bot] 61a93c5
allow specifying custom cpu template inline in config json
roypat 3582c78
chore: Update CHANGELOG in preparation of 1.12.0 release
zulinx86 85099fe
chore: Update release status in preparation of v1.12.0 release
zulinx86 3827acd
chore: Add CHANGELOG entries for newly supported instance types
zulinx86 bacff13
chore: Bump Rust dependencies
zulinx86 06b7ece
chore: Bump version to 1.13.0-dev
zulinx86 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,6 @@ test_results/* | |
/resources/linux | ||
/resources/x86_64 | ||
/resources/aarch64 | ||
llvm.sh | ||
vmlinux | ||
vmlinux.bin |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>img/quickstart_guide/rootfs.ext4</Key><RequestId>F23FN2VRXVEBN5NM</RequestId><HostId>RrqeuoufdOrTKnTLGPPYxjH2RiVaSJydFn55q2W4YypHv89V3TWTxzszOt7fMQTf0w86xQRdRUk=</HostId></Error> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -411,6 +411,9 @@ cmd_help() { | |
echo " Downloads the CI artifacts used for testing from our S3 bucket. If --force is passed, purges any existing" | ||
echo " artifacts first. Useful for refreshing local artifacts after an update, or if something got messed up." | ||
echo "" | ||
echo " pgo_build [instrument|profile|merge|optimize]" | ||
echo " Build Firecracker with Profile-Guided Optimization (PGO). See README-pgo.md for more information" | ||
echo "" | ||
|
||
cat <<EOF | ||
test_debug [-- [<pytest args>]] | ||
|
@@ -1083,6 +1086,49 @@ cmd_build_ci_artifacts() { | |
cmd_fix_perms | ||
} | ||
|
||
cmd_pgo_build() { | ||
# For error checking and detecting architecture type | ||
set -e | ||
|
||
PROFDATA_DIR=/tmp/firecracker-profdata | ||
PROFDATA_FILE=/tmp/firecracker.profdata | ||
|
||
arch=$(uname -m) | ||
if [[ "$arch" != "x86_64" ]]; then | ||
echo "Warning: Non-x86_64 architecture detected ($arch)" | ||
echo "Some features like /dev/kvm and full microVM profiling may not work." | ||
fi | ||
|
||
|
||
case "$1" in | ||
instrument) | ||
echo "Building instrumented Firecracker binary" | ||
RUSTFLAGS="-Cprofile-generate=/tmp/firecracker-profdata" cargo build --release | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these commands should be run inside the devctr to avoid the missing dependencies issues mentioned in the doc. Maybe we can extend |
||
echo "Instrumentation complete." | ||
;; | ||
profile) | ||
echo "Run workloads manually to generate .profraw files in /tmp/firecracker-profdata/" | ||
echo "Please consult README-pgo.md for more information." | ||
;; | ||
merge) | ||
echo "Merging .profraw files" | ||
if ! llvm-profdata merge -output=${PROFDATA_FILE} ${PROFDATA_DIR}/*.profraw; then | ||
echo "Error: Failed to merge profile data." | ||
echo " Make sure .profraw files exist and are readable." | ||
exit 1 | ||
fi | ||
echo "Merging complete." | ||
;; | ||
optimize) | ||
echo "Building optimized Firecracker with profile data" | ||
RUSTFLAGS="-Cprofile-use=/tmp/firecracker.profdata -Cllvm-args=-pgo-warn-missing-function" cargo build --release | ||
;; | ||
*) | ||
echo "Usage: $0 pgo_build [instrument|profile|merge|optimize]" | ||
exit 1 | ||
;; | ||
esac | ||
} | ||
|
||
main() { | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra file (
vmlinux
as well)