Re: [PATCH 3/3] rust: add tracepoint support
From: Boqun Feng
Date: Thu Jun 06 2024 - 15:01:02 EST
On Thu, Jun 06, 2024 at 07:35:44PM +0200, Peter Zijlstra wrote:
> On Thu, Jun 06, 2024 at 08:49:06AM -0700, Boqun Feng wrote:
>
> > Long-term plan is to 1) compile the C helpers in some IR and 2) inline
> > the helpers with Rust in IR-level, as what Gary has:
> >
> > https://lore.kernel.org/rust-for-linux/20240529202817.3641974-1-gary@xxxxxxxxxxx/
>
> Urgh, that still needs us to maintain that silly list of helpers :-/
>
But it's an improvement from the current stage, right? ;-)
> Can't we pretty please have clang parse the actual header files into IR
> and munge that into rust? So that we don't get to manually duplicate
> everything+dog.
That won't always work, because some of our kernel APIs are defined as
macros, and I don't think it's a trivial job to generate a macro
definition to a function definition so that it can be translated to
something in IR. We will have to do the macro -> function mapping
ourselves somewhere, if we want to inline the API across languages.
Regards,
Boqun