[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240731121539.0888738b@gandalf.local.home>
Date: Wed, 31 Jul 2024 12:15:39 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Gary Guo <gary@...yguo.net>
Cc: Alice Ryhl <aliceryhl@...gle.com>, Masami Hiramatsu
<mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Peter Zijlstra <peterz@...radead.org>, Josh Poimboeuf
<jpoimboe@...nel.org>, Jason Baron <jbaron@...mai.com>, Ard Biesheuvel
<ardb@...nel.org>, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor
<alex.gaynor@...il.com>, Wedson Almeida Filho <wedsonaf@...il.com>, Boqun
Feng <boqun.feng@...il.com>, "Björn Roy Baron"
<bjorn3_gh@...tonmail.com>, Benno Lossin <benno.lossin@...ton.me>, Andreas
Hindborg <a.hindborg@...sung.com>, linux-trace-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org, Arnd Bergmann
<arnd@...db.de>, linux-arch@...r.kernel.org, Thomas Gleixner
<tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov
<bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, "Peter Zijlstra (Intel)"
<peterz@...radaed.org>, Sean Christopherson <seanjc@...gle.com>, Uros
Bizjak <ubizjak@...il.com>, Catalin Marinas <catalin.marinas@....com>, Will
Deacon <will@...nel.org>, Marc Zyngier <maz@...nel.org>, Oliver Upton
<oliver.upton@...ux.dev>, Mark Rutland <mark.rutland@....com>, Ryan Roberts
<ryan.roberts@....com>, Fuad Tabba <tabba@...gle.com>,
linux-arm-kernel@...ts.infradead.org, Paul Walmsley
<paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>, Albert Ou
<aou@...s.berkeley.edu>, Anup Patel <apatel@...tanamicro.com>, Andrew Jones
<ajones@...tanamicro.com>, Alexandre Ghiti <alexghiti@...osinc.com>, Conor
Dooley <conor.dooley@...rochip.com>, Samuel Holland
<samuel.holland@...ive.com>, linux-riscv@...ts.infradead.org, Huacai Chen
<chenhuacai@...nel.org>, WANG Xuerui <kernel@...0n.name>, Bibo Mao
<maobibo@...ngson.cn>, Tiezhu Yang <yangtiezhu@...ngson.cn>, Andrew Morton
<akpm@...ux-foundation.org>, Tianrui Zhao <zhaotianrui@...ngson.cn>,
loongarch@...ts.linux.dev
Subject: Re: [PATCH v4 2/2] rust: add tracepoint support
On Tue, 30 Jul 2024 11:35:27 +0100
Gary Guo <gary@...yguo.net> wrote:
> > +/*
> > + * Declare an exported function that Rust code can call to trigger this
> > + * tracepoint. This function does not include the static branch; that is done
> > + * in Rust to avoid a function call when the tracepoint is disabled.
> > + */
> > +#define DEFINE_RUST_DO_TRACE(name, proto, args)
> > +#define DEFINE_RUST_DO_TRACE_REAL(name, proto, args) \
> > + notrace void rust_do_trace_##name(proto) \
> > + { \
> > + __DO_TRACE(name, \
> > + TP_ARGS(args), \
> > + cpu_online(raw_smp_processor_id()), 0); \
>
> I guess this doesn't support conditions. Currently the conditions are
> specified during declaration and not during definition.
>
> Would it make sense to have
>
> static inline void do_trace_##name(proto)
> {
> __DO_TRACE(name, TP_ARGS(args), TP_CONDITION(cond), 0);
But where is the "cond" passed in from?
I guess in the future if you want to add conditions, you would then just
add:
#define DEFINE_RUST_DO_TRACE_REAL_CONDITION(name, proto, args, cond) \
notrace void rust_do_trace_##name(proto) \
{ \
__DO_TRACE(name, \
TP_ARGS(args), \
cpu_online(raw_smp_processor_id()) && \
TP_CONDITION(cond), 0); \
-- Steve
> }
>
> in `__DECLARE_TRACE` and then simply call it in `rust_do_trace_##name`?
>
> > + }
> > +
> > /*
Powered by blists - more mailing lists