On Tue, 19 Nov 2024 17:16:56 +0100
Alice Ryhl <[email protected]> wrote:

> Mostly because of the merge window, though also because waiting would
> let me use things landing in 6.13 through other maintainer trees; this
> would let me have the sample declare a miscdevice. But what I can
> submit now is this: create a Rust file that exposes a function which
> just triggers a tracepoint, and then I can call that function from C
> somewhere in the ftrace selftests, and then afterwards the C code
> could assert that the tracepoint got triggered. Is there an existing
> ftrace test that I can look at to base my work on?

You can look at samples/trace_events/trace-events-sample.c which actually
creates a thread that runs periodically and triggers trace events.

And the test:

  tools/testing/selftests/ftrace/test.d/dynevent/add_remove_tprobe_module.tc

Also the module:

  samples/trace_printk/trace-printk.c

and the test:

  tools/testing/selftests/ftrace/test.d/event/trace_printk.tc

-- Steve

Reply via email to