Commit graph

41 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
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
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
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
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
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
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
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
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
Junichi Uekawa
9eccfc99f1 crosvm: tools: contrib: Improve output slightly.
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>
2023-10-19 13:27:15 +00:00
A. Cody Schuffelen
4748c54b95 Rename "unix" to "linux" in code and docs
$ for DIR in $(find . -name "unix"); do mv $DIR $(echo $DIR | sed "s/unix/linux/"); done
$ for FILE in $(find . -name "unix.rs"); do mv $FILE $(echo $FILE | sed "s/unix/linux/"); done
$ find . -type f -not -path '*/\.git/*' | xargs -I {} sed -E -i "s/mod unix/mod linux/g" {}
$ find . -type f -not -path '*/\.git/*' -not -path '*/third_party/perfetto/*' | xargs -I {} sed -E -i "s/([^o][^s])::unix/\1::linux/g" {}
$ find . -type f -not -path '*/\.git/*' | xargs -I {} sed -E -i "s/use unix::/use linux::/g" {}
$ find . -type f -not -path '*/\.git/*' -not -path '*/third_party/perfetto/*' | xargs -I {} sed -E -i "s/sys::unix/sys::linux/g" {}
$ find . -type f -not -path '*/\.git/*' | xargs -I {} sed -E -i "s/use unix as platform/use linux as platform/g" {}

Test: ./tools/dev_container ./tools/presubmit
Bug: b/298269162
Change-Id: I2c8acb14d77a5588dab4eae124f4a9afbb9025f5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4909060
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
2023-10-11 01:15:07 +00:00
Natsuko Mineno
dbbb4e45f4 cros_tracing_analyser: Remove average output
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>
2023-09-29 07:22:30 +00:00
Natsuko Mineno
49d7f75f82 cros_tracing_analyser: Add histogram
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>
2023-09-29 07:16:59 +00:00
Natsuko Mineno
fb2f9b097f cros_tracing_analyser: Add events for flamegraph
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>
2023-09-21 05:34:00 +00:00
Natsuko Mineno
c5e22dd8ed cros_tracing_analyser: Add a list sub-command
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>
2023-09-21 05:34:00 +00:00
Natsuko Mineno
f2786fc39d tracing_analyser: Add unit test for LatencyData
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>
2023-09-20 08:17:23 +00:00
Junichi Uekawa
d13de4b488 crosvm: tools: contrib: A tool to dump memory info.
Dumps memory stats and page cache stats relevant for diagnosing issues
with virtio-blk and ARCVM.

BUG=b:190337734
TEST=cargo run ${DUT}

Change-Id: Iacf8f5e7238ad6f2777162af11beccfb7403bf13
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4703695
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
2023-09-20 02:48:21 +00:00
Natsuko Mineno
4437dbd283 cros_tracing_analyser: Filter for flamegraph
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>
2023-09-20 00:55:57 +00:00
Natsuko Mineno
ad1924ea3f cros_tracing_analyser: Add unit test for EventData
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>
2023-09-20 00:55:50 +00:00
Natsuko Mineno
c2967a6ede cros_tracing_analyser: Add feature for flamegraph
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>
2023-09-20 00:55:45 +00:00
Natsuko Mineno
016b1c9b6c tools: contrib: Add cros_tracing_analyser
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>
2023-09-07 06:20:36 +00:00
Daniel Verkamp
41f57f8f89 Apply nightly rustfmt import style
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>
2023-09-06 22:13:26 +00:00
Keiichi Watanabe
8c4cf3102d tools: contrib: Add memstats_chart
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>
2023-08-10 02:17:22 +00:00
Zihan Chen
28ce4e5423 crosvm: Uprev rust toolchain and dev container
- 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>
2023-02-08 20:26:30 +00:00
Dennis Kempin
108a335d7d toolchain refactoring: Only support native out of the box
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>
2023-01-24 17:33:29 +00:00
Dennis Kempin
45b5c13047 Make common crates part of the crosvm workspace
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>
2022-10-31 21:33:33 +00:00
Dennis Kempin
1dab58a2cf Update all copyright headers to match new style
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>
2022-09-13 18:41:29 +00:00
Daniel Verkamp
d4505a7f1c base: replace PollToken with EventToken tree-wide
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>
2022-06-02 22:30:38 +00:00
Dennis Kempin
ba4adc0efb Add python presubmit checks
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>
2022-04-15 19:22:53 +00:00
Dennis Kempin
1e80b0d6a3 Refactoring Script: Move win_(sys_)util
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>
2022-03-22 22:23:41 +00:00
Dennis Kempin
4fa9b5147c Refactoring script: Copy sys_util(_core) to base
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>
2022-03-21 19:52:56 +00:00
Dennis Kempin
00cbeb7d4c Refactoring script: Copy common/io_uring to io_uring
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>
2022-03-21 19:52:56 +00:00
Dennis Kempin
dca90f49bd Refactoring script: Copy common/cros_async to cros_async
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>
2022-03-21 19:52:56 +00:00
Dennis Kempin
99e336b688 Refactoring script to use super:: instead of crate:: in win_sys_util
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>
2022-03-17 23:57:24 +00:00
Dennis Kempin
fd0b4cb74a Refactoring script to move common/base/ to base/
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>
2022-03-17 00:01:27 +00:00
Dennis Kempin
81b28dad70 Add script to refactor crate:: to super:: references
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>
2022-03-16 23:59:29 +00:00
Daniel Verkamp
c13c0c210b enumn: switch to upstream crates.io version
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>
2021-11-15 21:03:25 +00:00
Dennis Kempin
6e3350a956 Add base crate to cargo_refactor
We are adding an ebuild file for this crate in a future
CL: https://crrev.com/c/3251800

BUG=b:195126527
TEST=Run the script

Change-Id: If58c28075d5f3a3d2ad2b8c55714d1f8cdb968ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3251784
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-10-28 21:04:59 +00:00
Dennis Kempin
783791441d Refactor script: Move non-workspace crates to common/
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>
2021-10-27 22:51:25 +00:00