Commit graph

516 commits

Author SHA1 Message Date
Junichi Uekawa
f99e505edb tools: contrib: crosvmdump support --block.
--disk and --rwdisk are deprecated.

BUG=None
TEST=cargo run localhost2234

Change-Id: Ifb16032252a85edb691dbb040caff9e47303511e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5937387
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
2024-10-21 07:18:50 +00:00
Dennis Kempin
61bb120f6a infra: Add android-aarch64 builder
This builder will only run clippy using the new
presubmit recipe.
Also updates the health_check builder to use the
same recipe.

BUG=b:349907813
TEST=lucicfg validate main.star

Change-Id: Icf8a721b6eb37675dd289d496888b62de7ea9660
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5689951
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
2024-07-11 17:43:44 +00:00
Dennis Kempin
fb512a85b2 Add aarch64-linux-android target
This allows cargo to build for android. A new
dev container is built to include this.

To allow us to build the new container, we had to
remove the ffmpeg dependencies for armhf which fail
to install in the current version of debian.

BUG=b:349907813
TEST=dev_container presubmit clippy_android

Change-Id: I7fbcd460e53fbd339a28b451a91b0722d34257b8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5689659
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2024-07-11 17:35:22 +00:00
Dennis Kempin
33d5aa219a Enable clippy for android code
This change enables clippy builds of android specific code.

Doing so without adding the full Android SDK into our container
is a bit hacky. The CL https://crrev.com/c/5671653 adds env variables
to the minijail build.rs to allow us to skip building the library, and
generate bindings for linux instead of android.

This allow us to build all non-gpu related features of the
android build. It will not link, but it will run clippy.

This CL fixes various clippy issues that come up in this new
configuration

BUG=b:349907813
TEST=tools/clippy -p android
TEST=tools/presubmit clippy_android

Change-Id: I1f51d383051bbeeeff55d716feb7b56c3e24588b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5672567
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2024-07-09 20:43:44 +00:00
Daniel Verkamp
8c2a5647d1 rust-toolchain: update to Rust 1.77.2
This also upgrades the dev_container to package the new Rust version.

A few final clippy fixes are included as well.

BUG=b:344974550
TEST=tools/clippy

Change-Id: Iab4253e9cd88fdae989bb5b5170040b6af85baca
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609084
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-06-18 18:21:17 +00:00
Dennis Kempin
38d1ac5b1b Rebuild testvm and devcontainer
This uprevs both testvm and devcontainer and uploads new builds.
This will update them to the latest debian images and packages.

Some minor tweaks were made to satisfy the newer versions of
mdformat and python.

BUG=None
TEST=presubmit all --no-delta

Change-Id: I73e30aa1d9cefb5cf4ac117f513c2a98bf3c9ac5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5416093
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-06-11 22:24:48 +00:00
Daniel Verkamp
52b8e42869 Cargo.toml: avoid "*" versions for external crates
Ensure that every Cargo.toml dependency on a third-party crates.io crate
specifies at least a major version, or a minor version for 0.x crates,
to ensure that if a new major version is published, it cannot cause API
breaks.

The versions are selected to match the ones already in Cargo.lock, so
this should have no functional change, but it will help prevent new "*"
versions from being introduced via copy-and-paste.

For rationale, see the Cargo FAQ:
<https://doc.rust-lang.org/cargo/faq.html#can-libraries-use--as-a-version-for-their-dependencies>

`minijail`, `audio_streams`, and `cras` are left as "*" for now, since
they have unusual situations (imported from a submodule and/or replaced
at build time with ebuild magic).

BUG=None
TEST=tools/dev_container tools/presubmit
TEST=verify Cargo.lock is unchanged

Change-Id: Ifa18199f812f01d2d10bfb4146b3353c1a76527c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5555656
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-05-22 01:01:42 +00:00
Zihan Chen
b23620ec88 tools/merge_bot: Don't initiate merge just for recipe roller
Recipe roller has lead to many unwanted merge attempts. Don't start
a merge unless there are some other things to merge.

TEST=copy and paste in REPL for a manual mock test

BUG=b:333576491

Change-Id: Ia11c6706e98d60e6b4a908716a90cd4e04b55527
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5438909
Auto-Submit: Zihan Chen <zihanchen@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2024-04-09 20:58:32 +00:00
Dennis Kempin
3b9fd74aa0 cros_container: Fix crosvm ebuild name
cros added another package named crosvm in a different path,
so we need to explicitly specify the full path now.

BUG=None
TEST=None

Change-Id: I2920fa95ad570932757862b1686dc5a63e2eac4f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5430298
Reviewed-by: Zihan Chen <zihanchen@google.com>
2024-04-05 21:43:25 +00:00
Daniel Verkamp
94a9b3f650 tools/install-mingw64-deps: remove unused winetricks vars
The mingw64 install script does not install winetricks, so it does not
need these variables. They are probably left over from a previous
refactoring. tools/setup-wine64 has the same variables, but they are
actually used in that case.

TEST=make -C tools/impl/dev_container crosvm_dev

Change-Id: I3993f4e53677752c973fc683d13f9dda68f6aae0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5353268
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-03-07 19:35:33 +00:00
Daniel Verkamp
64b71e3ed6 cros_tracing_analyser: update to shlex 1.3
BUG=b:321994092

Change-Id: I4200fd5a7081c1ff72c11e68ab65d3c1802c4b2e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5348295
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2024-03-06 04:12:15 +00:00
Kaiyi Li
33f1afda24 gpu_display: wndproc for vulkan
Windows procedure implementation for the vulkan display.

Test: ran vulkaninfo
Change-Id: Iab7b501092155cdb7eacf6e71c2da4ec6c2253f9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5214574
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Colin Downs-Razouk <colindr@google.com>
Reviewed-by: Pujun Lun <lunpujun@google.com>
2024-03-04 23:14:40 +00:00
A. Cody Schuffelen
ecc0206af8 Upgrade rust to 1.73.0
There don't appear to be any new clippy warnings, and this is the
version of Rust that Android is now using: b/303252546. Work for the
next version is tracked in b/310977762.

This doesn't have any particular features I'm looking for (async traits
only come in 1.75.0). I'm not particularly attached to this change. If
it's easy to upgrade the container though, we could ensure no new clippy
warnings appear.

Android rust versions appear here:
https://cs.android.com/android/platform/superproject/main/+/main:prebuilts/rust/linux-x86/

Also not sure what the ChromeOS release schedule is.

Release docs: https://releases.rs/docs/1.73.0/

Test: tools/dev_container --clean bash -c "rustc --version && tools/presubmit clippy"
Change-Id: I2d3010c3032053709f0c0beb7dcbe2b80d782415
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5201659
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2024-02-20 19:11:51 +00:00
Dennis Kempin
e45905b53e dev_container: Fix libc6:arm64 issue during container build
libc6:arm64 will call telinit to restart affected services.
This will block indefinitely in the container without init running.
The workaround is to replace telinit with true to make it a
no-op.
Also removes the mount caches from the build process as they seem
don't seem to work with APTs file lock.

BUG=b:322015733
TEST=make -C tools/impl/dev_container

Change-Id: If1079581680ac9edc981ad46afb3173508668335
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5230818
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2024-02-20 19:11:51 +00:00
Kaiyi Li
c28067d1d9 Reformat comments
Test: presubmit
Change-Id: I39c261d9985989873b698213c5d8b653fc13757b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5299850
Auto-Submit: Kaiyi Li <kaiyili@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2024-02-15 23:30:13 +00:00
Ryan Neph
b3c42bb9d7 Cargo.toml: add vulkano as top-level feature
Hook rutabaga_gfx/vulkano into a new top-level feature of the same name,
so that it can be detected for conditional compilation of gpu device
creation details.

Also moves the `vulkano` dependency out of windows-specific list and
into generic list for all platforms.

(Note: the existing rutabaga_gfx/Cargo.toml hacks must still be locally
applied and rust-toolchain channel must be manually set to 1.70 or
greater to successfully build with --feature=vulkano)

BUG=b:246334944
BUG=b:244591751
Test=tools/dev_container tools/presubmit

Change-Id: Ic1938f3d8599de1414539abf5a4b57a9fe1764dd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5264226
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Ryan Neph <ryanneph@google.com>
2024-02-08 00:17:33 +00:00
Takaya Saeki
87f08e43c8 contrib: add a tool to find the bottleneck virtio device
This commit addds a tool to find the bottleneck virtio device by
analyzing the output of trace-cmd. This tool analyzes what processes
crosvm's vcpu process waited for, for how long time. For example, if the
vcpu processes are mostly waiting for vitio-blk process, the bottleneck
is likely to be the blk. If the vcpu processes are mostly waiting for
other vcpu processes or often preempted by other processes, the
bottleneck is likely to be the processor.
See README.md for the details.

BUG=b:302240202
TEST=cargo test

Change-Id: I98cff9e1158cf7980d522e549edef002630763b4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4891880
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Takaya Saeki <takayas@chromium.org>
2024-02-07 09:03:10 +00:00
Vikram Auradkar
fa539725eb tools: add simple windows example script
Makes gpu argument optional

BUG=b:316406247
TEST=ran the script on windows

Change-Id: I08e7961f2477ee56ad162420a99c469e3f4c7b1b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5124591
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
2024-01-27 06:17:57 +00:00
Zhenyu Wang
7d57013ab8 dev_container: Pass proxy setting
If running behind proxy, need to pass proxy setting for container as well,
otherwise can't pull crates properly. So this tries to add 'http_proxy'
and 'https_proxy' in environment for container.

Change-Id: I897703f571d9fe5bd03b819fc6b13a9e04384e6f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5232200
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-01-24 18:36:22 +00:00
Daniel Verkamp
b27a77e158 tools/merge_bot: overwrite profile .xz if it exists
Add -f to the xz command line so the compressor will always overwrite
workspace/profiles/benchmarks.profdata.xz even if it exists instead of
failing:

  $ tools/dev_container xz -9e -T 0 /workspace/profiles/benchmarks.profdata
  [...]
  xz: /workspace/profiles/benchmarks.profdata.xz: File exists

Change-Id: I74aae3ee052adacd2a4f8da69e6264273cfebcc0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5226612
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
2024-01-23 15:53:37 +00:00
Yuan Yao
f3dba12e39 cros_tracing_analyser: Fix divide by zero error
When a .dat file contains only "Enter: " trace record but no
corresponding "Exit: " trace record, the calculate_function_time() will
ends up at divede by zero error. This CL fixes the error.

BUG=b:320395473
TEST=run with the edge case .dat file

Change-Id: I79709258d914156f5fcff1a6fd9c2d0be16c8c41
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5198660
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Morg <morg@google.com>
Commit-Queue: Yuan Yao <yuanyaogoog@chromium.org>
2024-01-17 09:55:20 +00:00
Daniel Verkamp
650fbaf7fc kvm_sys: add riscv support to bindgen.sh
This generates riscv64/bindings.rs from the kernel headers to bring it
in line with the other auto-generated bindings, which is possible now
that we are generating the bindings from new enough kernel headers
(Linux 6.6).

BUG=b:287496832
TEST=tools/dev_container tools/presubmit crosvm_unit_tests_riscv64

Change-Id: I86c17d75a467368dcc99e616a2dfd31ee8cb1071
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4676074
Reviewed-by: Dylan Reid <dgreid@rivosinc.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-01-09 00:37:43 +00:00
Daniel Verkamp
c970dd44f4 bindgen: update to Linux 6.6 headers
The obsolete KVM_SET_MEMORY_ALIAS ioctl was removed from the kernel; it
was already unused in crosvm, so remove the corresponding ioctl macro.

Change-Id: I1ecfce4b8df886680154c567f82ab7f006fbfd1f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5178535
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2024-01-09 00:37:43 +00:00
Dennis Kempin
518058007c dev_container: Clarify documentation for rebuilding container
Consolidates the instructions into a README.md file to make it
easier to discover.

BUG=b:273481336
TEST=None

Change-Id: I3b7a4a204ba5802bcfdb24db5a808fadce9c757e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5123312
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-12-15 18:58:31 +00:00
Dennis Kempin
a82d43ef87 dev_container: Pass through NEXTEST_PROFILE
This allows postsubmit to run with the postsubmit nextest profile
to fail flaky tests.

BUG=b:300669562
TEST=export NEXTEST_PROFILE=postsubmit; dev_container run_tests

Change-Id: I4ac9c351e63243cb1c66fabfb755949530768917
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5121290
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-12-14 19:01:30 +00:00
Vikram Auradkar
2768f223ee clippy: enforce safety block comments
BUG=b:316174930
TEST=none

Change-Id: I5c7811b2c548155aa003e4b71a54bbc16e2f2588
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5120567
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-12-14 18:21:54 +00:00
Daniel Verkamp
324877dbd8 media: ffmpeg: generate bindings in build.rs
Generate bindings for the installed version of the ffmpeg libraries at
build time instead of checking in a static version of the bindings.

BUG=b:309563850
TEST=cargo build --features=ffmpeg

Change-Id: I38d922dd7332c4385ae6a0ae93e893538c3b1cce
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5027711
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-12-08 20:58:57 +00:00
Dennis Kempin
73aed77b49 Run rustfmt on whole codebase with nightly enabled
Nigthly is enabled as part of https://crrev.com/c/4950268
This change contains the formatting changes resulting from the switch.

BUG=b:302055317
TEST=dev_container presubmit format --no-delta

Change-Id: Idaf2b8bae2e09c624b19d9cd3dd5fc8e4d099b3c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5067088
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-11-29 18:41:29 +00:00
Dennis Kempin
a5b5e4b9a6 Enable rustfmt nightly in container and CI
This enables nightly rustfmt features in CI so we can keep a consistent
imports style.

The resulting formatting changes are in the follow-up CL and will
need to submit together.

This change also uncovered a bug from a previous commit that caused only
the first command in a series to be waited for. Formatting issues would
not be reported by the tool. The bug is fixed as part of this CL.

BUG=b:302055317
TEST=dev_container presubmit format --no-delta

Change-Id: I5d50609cc89d7e78bce66db120737a302f5c57e8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4950268
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-11-29 18:41:29 +00:00
Zihan Chen
a6963fa305 fixup: tools: Fixing merge bot no dir found error
For some reason, when running in production CI the merge bot
script can't find directories created inside the container. This
is the best explanation I can think of for the error I see in CI
log. This CL moves `mkdir` for all directories host need to access
to run from host.

BUG=b:181105093
TEST=untested, as led can't reproduce this issue

Change-Id: I9b10838c06c32ff607b98e21616f09c4b96392f3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5064383
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-11-28 14:56:38 +00:00
Zihan Chen
fda3cfc61f tools/merge_bot: Generate PGO profile at merge
Merge bot will now automatically run crosvm benchmark suite and
produce merged profile data file for PGO use at each merge commit
generated on Monday.

As profile data functions with snapshot of code and generating
them requires a non-trivial amount of compute, we decided on
generate profiles at each "natural" snapshot point (cros merges)
instead of each commit, and thus `merged.profdata` will not be
available in upstream repository.

We decided against generating profile at every merge to avoid
bloating cros repository. The profile is also compressed
with xz to reduce its footprint.

TEST=./tools/chromeos/merge_bot --verbose update-dry-runs origin/main
TEST=https://luci-milo.appspot.com/swarming/task/662c0e8432332c11

Change-Id: I0787f3e01b9a83e9e53f36c36cda1a043ceee0d8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5038001
Commit-Queue: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-11-28 00:52:26 +00:00
Keiichi Watanabe
6b6edff308 cros_tracing_analyser: Change the "list" output format to CSV
The current output of the "list" subcommand is like:
```
\#1: create: 1234 usec
\#2: mkdir: 567 usec
```

This output format is not so easy for futher processing.
Also, it doesn't contain how many times a result is sent.
So, this CL update the format to the following one:
```
name,total (us), count
create, 1234, 400
mkdir, 567, 89
```

BUG=none
TEST=cros_trace_analyser list --input trace.dat

Change-Id: Ia0e0d2d9777e8ba7431a8b90e8ec54e65d242166
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5061774
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Morg <morg@google.com>
Reviewed-by: Morg <morg@google.com>
2023-11-28 00:50:26 +00:00
Dennis Kempin
75f5fe0418 presubmit: Disable cl_tests
The tests stopped working due to issues with git.

BUG=b:309148074

Change-Id: I08cd522660927bb4d46d48ea9c6f3cbf8ec51486
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5005630
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-11-20 21:55:04 +00:00
Dennis Kempin
5cf0a98827 dev_container: Build new container without riscv
Also adds lld, which will be used in a follow-up to improve
linking performance.
Since debian has had a stable release since then, we also
need to upgrade a few library versions in the testvm.

Swap tests that require userfaultfd were able to run without
root before. In the latest version of debian we need to configure
for unprivileged access.
Since this is the case for glinux workstations as well, let's
mark those tests as root-only and let them execute via sudo.

BUG=b:304875018,b:256905223
TEST=presubmit

Change-Id: Ied0b34e248990378a7864b4a394aa21d8f824f71
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5013631
Reviewed-by: Zihan Chen <zihanchen@google.com>
Reviewed-by: Shin Kawamura <kawasin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-11-20 18:34:35 +00:00
Zihan Chen
0c57e655ed crosvm: Add more release build profiles
Add codegen-units=1 build profile to further reduce binary size
and potentially improve performance.
tools/build_release is updated to allow choice of build profiles.
To keep binary size measurement trend consistent, release build
recipe is running with chromeos profile.

crosvm size of different profiles at current cl:
relase profile (w/o strip symbols) 24192680,
chromeos profile (strip symbols from release) 15088272,
lto profile (fat lto & strip symbols) 14326144,
largecodegen profile (codegen-units=1 w/ fat lto) 13764896

TEST=./tools/build_release --profile largecodegen

BUG=b:181105093

Change-Id: I057ddfce3e78aa4dfe6b4810f4bcb1f13b954bb4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5027712
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-11-16 20:18:01 +00:00
Vikram Auradkar
41d4b92cef tools: remove link run_test2
BUG=b:308883445
TEST=none

Change-Id: I6fe0dbf90ebaee2cd0d1585a0b3f02e1761f3826
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5027694
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2023-11-14 01:21:43 +00:00
Daniel Verkamp
fb19a6c304 dev_container: check if /dev/kvm is a char device
/dev/kvm is not a normal file, so os.path.isfile("/dev/kvm") returns
False. Use pathlib's is_char_device() check instead.

TEST=tools/dev_container --stop; tools/dev_container

Fixes: 0be7e9757e ("dev_container: Only pass /dev/kvm if present")
Change-Id: I150009beb9b0b438013c2dd86fae7f99c959be75
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5021441
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Pierre-Clément Tosi <ptosi@google.com>
2023-11-13 17:03:08 +00:00
Vikram Auradkar
fd83ee4f2e tools: start podman machine on windows if it not already running
BUG=b:308883445
TEST=on windows ran `py .\tools\dev_contain` with/out machine running

Change-Id: Ib6fe00e4f5b6630a9595b57aedd3dcc00efe8860
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5010883
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
2023-11-08 20:42:13 +00:00
Dennis Kempin
50c265f856 install-deps: Upgrade binstall and fix source builds of dependencies
Running cargo binstall on some packages will install them from source
if no binary release is available.
In that case, the rust-toolchain file of the CWD is used for building,
which may not be the right version required by the binary package
we are trying to install.

The new version of binstall is now also able to pull binaries from
github releases without hitting API quotas.

BUG=b:309563518
TEST=./install-deps

Change-Id: I869002cf766f806f66ba58d5b712b81c0bd30f4f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5014783
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2023-11-08 18:03:37 +00:00
Jakob Vukalovic
8b21047281 cros_fdt: Add device tree overlay tests
Add test for the device tree overlay mechanism.

Bug: b/296796644
Test: cd cros_fdt && cargo test
Change-Id: I8e8d129344e1ad4ddf0d7af7b3f21c0c9d9ca038
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4855966
Commit-Queue: Jakob Vukalović <jakobvukalovic@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-11-07 18:15:21 +00:00
Pierre-Clément Tosi
797de4a579 tools/cl: Add support for SSO Git remote
Some users of *.googlesource.com access the platform through the
internal Single Sign-On authentication mechanism so consider the sso://
remote as valid.

TEST=tools/cl upload

Change-Id: Ie7ebe4c9e165241645fddcdf1884b7e9e7a7d83d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5009550
Auto-Submit: Pierre-Clément Tosi <ptosi@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-11-07 17:55:30 +00:00
Pierre-Clément Tosi
0be7e9757e dev_container: Only pass /dev/kvm if present
Avoid passing the file to Podman/Docker if it isn't present as that
prevents the container from running:

    Error: stat /dev/kvm: no such file or directory

Even though the script may be used in cases where KVM isn't necessary.

Remove the check for POSIX as non-POSIX OSes are very unlikely to have a
file at that path.

TEST=tools/dev_container tools/run_tests --platform=aarch64

Change-Id: If46bb42076c79adfeab4baceb01913a9179ac00d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5010772
Auto-Submit: Pierre-Clément Tosi <ptosi@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-11-07 17:48:21 +00:00
Vikram Auradkar
8dacb2ed64 config: force lf as line endings
this allows sharing repo on windows running a linux container

BUG=b:308883445
TEST=on windows ran
       py .\tools\dev_container tools/presubmit line_endings

Change-Id: Ief73f1ad2da201dac0337711d0c4f706a936f7a6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5008193
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2023-11-07 17:38:58 +00:00
Keiichi Watanabe
01065a8286 tools: contrib: Explain memstats tool's graph
Add a section to explain what memstats shows in the graph.

BUG=none
TEST=read the doc

Change-Id: If7990c844a63e381adab403af00f02a40ef35bb7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4942210
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2023-11-07 12:33:50 +00:00
Keiichi Watanabe
316783a88b cros_tracing_analyser: Fix unused Result warning
BUG=none
TEST=cargo build

Change-Id: I144eec11637f3bb9a7bfa741a72a61d58b0f5f37
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5000826
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Morg <morg@google.com>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
2023-11-06 12:52:51 +00:00
Keiichi Watanabe
64aa6d408f cros_trace_analyser: Use libtracecmd-rs v0.2.1
With a fix in libtracemd-rs v0.2.1 [1], we no longer need to rebuild
libtracecmd-rs every time.
[1]: https://github.com/google/libtracecmd-rs/pull/6

BUG=none
TEST=cargo build

Change-Id: Ica1342c9b23ed778fff2c0677717e3953b42dbd9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5000825
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Reviewed-by: Morg <morg@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2023-11-06 12:52:51 +00:00
Dennis Kempin
6a9a779d9b presubmit: Remove infra checks from presubmit tooling
We should be using the builder-provided vpython to be able to
reliably testing recipes in the right environment.

Let's remove these to unblock the recipe roller, then add them
as a seprate step in the health check build recipe.

BUG=None
TEST=CQ

Change-Id: I14fa4d744ab83c01c54f9618854e5e5f657d9f60
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5005627
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-11-03 21:17:36 +00:00
A. Cody Schuffelen
9cd31f1669 Stub out bare minimum to compile base on MacOS
Also add compilation scripts

Bug: b/309011910
Test: tools/install-mac-deps && tools/mac-build
Change-Id: I5aa200238fb83c94115ca2f3624ca84a34d9555a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4997935
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
2023-11-03 19:09:27 +00:00
Vikram Auradkar
39f462aad8 tools: script to install podman on windows
the script may need a few other changes as my dev box already had
podman and potentially other dependencies. I uninstalled podman to test.

BUG=b:308883445
TEST=used script install on a dev box.

Change-Id: Ieb44587cc79b22952bc0c8154c9001f608e51769
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4998699
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
2023-11-02 18:33:16 +00:00
Vikram Auradkar
92e8988fd4 tools: windows support for dev_container
Won't allow running e2e or integration tests.

BUG=b:308883445
TEST=py .\tools\dev_container tools/presubmit clippy

Change-Id: Ib97eb6640ce25ebfa71b3edce734a1de3ddf9409
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4996643
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-11-02 18:33:16 +00:00