# Re: \[PATCH v2 1/2\] rust: add static\_key\_false

- From: Alice Ryhl \<aliceryhl@google.com\>
- Date: 2024-06-21 10:38:35 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2024/06/2648137
- Thread: https://ratatoskr.run/linux-trace-kernel/2024/06/2632554/t.md

```text
On Wed, Jun 12, 2024 at 5:03 PM Conor Dooley [ref] wrote:
>
> On Mon, Jun 10, 2024 at 02:01:04PM +0000, Alice Ryhl wrote:
> > Add just enough support for static key so that we can use it from
> > tracepoints. Tracepoints rely on `static_key_false` even though it is
> > deprecated, so we add the same functionality to Rust.
> >
> > It is not possible to use the existing C implementation of
> > arch_static_branch because it passes the argument `key` to inline
> > assembly as an 'i' parameter, so any attempt to add a C helper for this
> > function will fail to compile because the value of `key` must be known
> > at compile-time.
> >
> > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
>
> > +#[cfg(target_arch = "x86_64")]
>
> > +#[cfg(target_arch = "aarch64")]
>
> This patch breaks the build on riscv (and I assume loongarch):
>
> error[E0432]: unresolved import `_static_key_false`
> --> /stuff/linux/rust/kernel/static_key.rs:87:10
> |
> 87 | pub use {_static_key_false, static_key_false};
> |          ^^^^^^^^^^^^^^^^^ no external crate `_static_key_false`
>
> Cheers,
> Conor.

Thank you. Fixed in v3.
https://lore.kernel.org/all/20240621-tracepoint-v3-0-9e44eeea2b85@google.com/

Alice
```
