Re: [PATCH v5 3/4] rust: add bitmap API.
From: Miguel Ojeda
Date: Fri Mar 28 2025 - 05:06:46 EST
On Fri, Mar 28, 2025 at 9:51 AM David Gow <davidgow@xxxxxxxxxx> wrote:
>
> KUnit. That being said, I suspect that supporting the "just build this
> one test module against your existing kernel" case is going to be a
> bit more of a pain here anyway, as it might end up depending on having
> exactly the same toolchain/config/etc due to Rust's ABI not being
> stable. (Am I missing anything here, Miguel?) And, of course, Rust's
> built-in tests here would get automatically compiled down to KUnit
> tests if enabled.
The ABI is not stable indeed, and modules need to be built with the
same toolchain.
> So, what I suspect you're looking for here is a separate module /
> crate which benchmarks the bitmap type. With the way Rust crates are
> laid out, I suspect this would need to live in a separate directory
> and look something like samples/rust/rust_minimal.rs?
Yeah, the module Yury mentioned seems like a normal one that calls
`ktime_get()` etc., so doing something like that in Rust should be
fine too.
But, yeah, I was thinking more in terms of having a proper framework
for those, rather than doing a custom thing per module and even having
those `ktime_get()` calls manually placed for every test etc.
Thanks for the context!
Cheers,
Miguel