Re: [PATCH v3 2/2] rust: add tracepoint support

From
Alice Ryhl <aliceryhl@google.com>
Date
2024-06-26 08:48:36
Also in
lkml, rust-for-linux
Reply to
Boqun Feng, 2024-06-25
On Tue, Jun 25, 2024 at 8:11 PM Boqun Feng [off-list ref] wrote:
On Fri, Jun 21, 2024 at 02:52:10PM +0200, Alice Ryhl wrote:
[...]
quoted
Hmm, I tried using the support where I have both events and hooks:

#define CREATE_TRACE_POINTS
#define CREATE_RUST_TRACE_POINTS
#include <trace/hooks/rust_binder.h>
#include <trace/events/rust_binder.h>

But it's not really working. Initially I thought that it's because I
need to undef DEFINE_RUST_DO_TRACE at the end of this file, but even
when I added that, I still get this error:

    error: redefinition of 'str__rust_binder__trace_system_name'

Is the Rust support missing something, or is the answer just that you
can't have two files of the same name like this? Or am I doing
something else wrong?
Because your hooks/rust_binder.h and events/rust_binder.h use the same
TRACE_SYSTEM name? Could you try something like:

        #define TRACE_SYSTEM rust_binder_hook

in your hooks/rust_binder.h?
I was able to get it to work by moving the includes into two different
.c files. I don't think changing TRACE_SYSTEM works because it must
match the filename.

Alice
Thread (11 messages) 11 messages, 3 authors, last reply 2024-06-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help