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>
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>
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>
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>
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>
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>
Output related information closer together instead of in random order,
it was impossible to see what lines are related information because of
multithreading.
Output becomes like:
pcivirtio-fs 22356 private_dirty: 0 MB rss: 1020 MB VmPTE: 172 KiB
22356:pcivirtio-fs 22417:v_fs:_data:0 22418:v_fs:_data:1
BUG=None
TEST=cargo run ${DUT}
Change-Id: Ie922382f0ad8ad9d2ec8a57c4a209177fdc43be6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4954555
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
remove unused output option from average
BUG=b:297954291
TEST= Run `cargo test` and test pass.
TEST= Run the tool on trace.dat file and checked average and list
commands.
Change-Id: I60cb8032e8d4c37023763ec92ffc5d3877812579
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4885720
Reviewed-by: Morg <morg@google.com>
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Extract name and latency of cros_tracing events output it to json file
BUG=b:297954291
TEST= Run the tool with a trace.dat collected by trace-cmd.
Change-Id: I2871bdbfc1ba2819fe27ba017e12be93e2d3cee0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4866140
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
Reviewed-by: Morg <morg@google.com>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Extract name and latency of all events includes other than
virtiofs and syscall and output it to json file
BUG=b:297954291
TEST= Run the tool with a trace.dat collected by trace-cmd.
Change-Id: Ib3468df9fb44166958d434f7aac4493a08dcf09b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4864219
Reviewed-by: Morg <morg@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
Extract name and number of times of all cros_tracing events and print.
BUG=b:297954291
TEST= Run `cargo test` and test pass.
TEST= Run the tool on trace.dat file and checked average and list
commands.
Change-Id: I49b376d20fb906221bf5e0ae18f709156e29929e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4861879
Reviewed-by: Morg <morg@google.com>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
unit test for create_layer
BUG=b:297954291
TEST= Run cargo test and the tests pass
Change-Id: I8e7b36a53c9f3083192d72f6375d870a75e9976b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4857968
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Filter by event_name and how many time-consuming events to output
BUG=b:297954291
TEST= Run the tool with a trace.dat collected by trace-cmd.
Change-Id: Id2375a394cd43da8d9342d309c3830f19b51654e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4853089
Reviewed-by: Morg <morg@google.com>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
unit test for populate_event_names and calculate_latency_data
BUG=b:297954291
TEST= Run cargo test and the tests pass
Change-Id: Iff7a3ebcead4b2d777881c0f1cb5859e126bc5c4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4857960
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Reviewed-by: Morg <morg@google.com>
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
Extract name and latency of all events output it to json file
BUG=b:297954291
TEST= Run the tool with a trace.dat collected by trace-cmd.
Change-Id: Iea72e4aebaaecc4b11e7289af771540c32938d71
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4839555
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
Extract event_name and timestamp from input file and calculate latency of cros_tracing event and output it.
BUG=b:297954291
TEST= Run the tool with a trace.dat collected by trace-cmd.
Change-Id: Ia9b5814d35fa33a185278f7e3128592a2ac783d6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4806243
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Commit-Queue: Natsuko Mineno <natsukomineno@chromium.org>
Reviewed-by: Morg <morg@google.com>
As usual, some unsorted and grouped imports have appeared.
Change-Id: I79b51e4c52cee38f5b8c238e46dfe3193c753554
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4847980
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Add a tool to gather and visualize memory data for a running crosvm
instance.
BUG=b:290331222
TEST=Run the tool for ARCVM/Borealis
Change-Id: Iffb3c60dfab6bc9e21979ef3ce367cad0e8b0514
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4712086
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
- Rust toolchain is updated to 1.65.0
- Catapult dashboard upload tool is added to dev_container
- Bindgen is updated to latest version to support custom derive
- Derive Eq when PartialEq is derived as required by new Clippy
TEST=CQ, bindgen-all-the-things
FIXED=b:260784028
BUG=b:257303497
Change-Id: I2034cd09e0aed84d4e9b30f2e85d84d94a442ea4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4228427
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
cross-compilation requires additional configuration that depends
heavily on the host platform. Unfortunately cargo cannot be
configured on a per host platform basis so this has to be done
manually.
Most developers are just using native compilation (and using
the containers for everything else). So we can slim our
install-deps scripts a bit.
To verify the updated install scripts, this change includes
containers to simulate a fresh developer workstation that
can be used to verify out of the box workflows.
BUG=b:262829206
BUG=b:265995780
BUG=b:265842137
TEST=tools/contrib/minimal_container/test-all.sh and CQ
Change-Id: I0e803d0224306e5351728e2c80fcbcd8260d029d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4179290
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This greatly simplifies and speeds up compilation
and clippy times.
This ChromeOS-side building these crates has been
updated to copy the source out of the source tree
so that they will compile as a separate workspace.
BUG=b:256020427
TEST=presubmit
Change-Id: I2e0f1f6724924d6bdd70ea28d7777df7966cf724
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3988324
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This search/replace updates all copyright notices to drop the
"All rights reserved", Use "ChromiumOS" instead of "Chromium OS"
and drops the trailing dots.
This fulfills the request from legal and unifies our notices.
./tools/health-check has been updated to only accept this style.
BUG=b:246579983
TEST=./tools/health-check
Change-Id: I87a80701dc651f1baf4820e5cc42469d7c5f5bf7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3894243
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Pull the declaration of the `EventToken` enum up to the top level of the
base crate, replacing the identical implementations inside sys/windows
and sys/unix.
Use the `EventToken` name consistently throughout the tree to remove the
unix-flavored "poll" nomenclature.
BUG=b:213153157
TEST=tools/dev_container tools/presubmit --all
Change-Id: I0ba42037b533b796797a7a3f6d8d7e71a5592aba
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3642673
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
This change adds python type and formatting checks and
consolidates code health checks in ./tools/health-check.
Dealing with relative imports in python is tricky, so
we are making ./tools/impl a proper package with no
directly executable files.
Some of the bash shorthands in ./tools had to be converted
to python for this.
To make the new checks pass, we run the formatter and fix
some mypy type checks.
TEST=./tools/health-check
BUG=b:218559722,b:219965702
Change-Id: Ie18d3d6dd2f5a033141e167a6e1aa762791941d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3558592
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This script moves win_util from crosvm/common/ to crosvm/
and win_sys_util into base::windows.
The CL makes some prerequisite code changes needed to enable
building of tests after the script is applied.
BUG=b:223206469
TEST=presubmit
Change-Id: I5c1952596d3161730be3f42ce5d6cb554ab66b4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3537257
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
This will allow us to merge sys_util and win_sys_util.
The original source locations will remain until they
are moved into the ChromeOS source base.
See go/future-of-sys-util for details
BUG=b:22320646
TEST=run it
Change-Id: Ie1adcadba9d35f18cc7472dc78f05262114a726f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3536890
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
The crate is only used by cros_async, which has already been
copied to crosvm.
The old source location will eventually move to ChromeOS.
See go/future-of-sys-util for details
BUG=b:22320646
TEST=presubmit
Change-Id: Icf3522497cb4e8c04a4687403466b781f0d7a9ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3534501
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
The copy is going to be used by crosvm going forward, while the
old version will eventually be moved to ChromeOS.
See go/future-of-sys-util for details
BUG=b:22320646
TEST=presubmit
Change-Id: Ic3216855fc244e366423160464dc722a04dfc56d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3533607
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Had to add some exceptions here because of some mismatches between
the structrure of files vs modules.
BUG=b:22320646
TEST=python tools/contrib/refactor_use_references
Change-Id: Ia9da533bd8c89871893adfa461e47e4e2fe600d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3530119
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
This is a prerequisite for sys_util* to move into the base
crate. The crate should never have been in common in the
first place since it is not shared.
BUG=b:223206469
TEST=python tools/contrib/cargo_refactor.py
Change-Id: I60115e0418c6980d7bf7ff624a3cc0a24e71a57d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3530502
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
This will be run on crates that are to be moved into the
base crate.
The script is run in the follow up CL.
Note: This is a one-off script. It just has to work one,
not for the general case.
BUG=b:223206469
TEST=python tools/contrib/refactor_use_references.py
Change-Id: Ic92109572649c9130784b986c67fddc8f9b838d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3530497
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Developers may need to manually clean up the common/enumn directory - it
will be left behind if there are build artifacts (Cargo.lock, target
directory, etc.):
rm -rf common/enumn
BUG=b:205344148
TEST=cargo build
TEST=tools/presubmit
TEST=emerge-hatch crosvm # with https://crrev.com/c/3265967
Change-Id: I1af3bdd22f40e87895a78a5cbc8033476058c927
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3278774
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This CL contains just a refactoring script, a follow-up contains
the result of running it. This is easier to review than 100s of
search/replace.
I think it makes sense to leave this script around for future
reference if we need to shuffle things around again.
BUG=b:195126527
TEST=None
Change-Id: Ic8cc69946b8e6908877e4fbde44230d40a1ea566
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3232967
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>