Skip to content

Rust Binder tracepoints #1226

Open
Open

Description

@Darksonn

C Binder has many tracepoints. Here is one:

TRACE_EVENT(binder_ioctl,
TP_PROTO(unsigned int cmd, unsigned long arg),
TP_ARGS(cmd, arg),
TP_STRUCT__entry(
__field(unsigned int, cmd)
__field(unsigned long, arg)
),
TP_fast_assign(
__entry->cmd = cmd;
__entry->arg = arg;
),
TP_printk("cmd=0x%x arg=0x%lx", __entry->cmd, __entry->arg)
);

Rust Binder implements an equivalent one here:

TRACE_EVENT(rust_binder_ioctl,
TP_PROTO(unsigned int cmd, unsigned long arg),
TP_ARGS(cmd, arg),
TP_STRUCT__entry(
__field(unsigned int, cmd)
__field(unsigned long, arg)
),
TP_fast_assign(
__entry->cmd = cmd;
__entry->arg = arg;
),
TP_printk("cmd=0x%x arg=0x%lx", __entry->cmd, __entry->arg)
);

together with:

#[inline]
pub(crate) fn trace_ioctl(cmd: u32, arg: usize) {
// SAFETY: Always safe to call.
unsafe { rust_binder_ioctl(cmd, arg as c_ulong) }
}

However, many tracepoints are missing. To work on this issue, pick one of them and submit a patch adding it. Please compare with the implementation found here in Android's fork, but it may need adjustments when upstreamed.

Oh, also, the current tracepoints are called rust_binder_*, but the rust_ prefix should be removed because the name is part of the uapi, and userspace expects tracepoints to have the old names.

Activity

  1. added
    easyExpected to be an easy issue to resolve.
    mediumExpected to be an issue of medium difficulty to resolve.
    on Mar 5, 2026
  2. ojeda commented on Mar 5, 2026

    @ojeda
    Member

    This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a Suggested-by: tag, and a Link: tag to this issue. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.

  3. added
    • driversRelated to the example drivers in `drivers/`.
    on Mar 5, 2026
  4. mqqz commented on Mar 7, 2026

    @mqqz
  5. PlierShounen36 commented on Aug 14, 2026

    @PlierShounen36

    hey I am a beginner to systems programming. Can I take this up and contribute?

  6. mqqz commented on Aug 16, 2026

    @mqqz

    @PlierShounen36

    hey I am a beginner to systems programming. Can I take this up and contribute?

    keep in mind most of the relevant tracepoints have been already added and merged upstream 8f34810

    but anyone is welcome to contribute just make sure you follow the guidelines (see @ojeda's comment above).

  7. PlierShounen36 commented on Aug 16, 2026

    @PlierShounen36

    Should I take up some other issue then?

  8. mqqz commented on Aug 16, 2026

    @mqqz

    Should I take up some other issue then?

    up to you, you don't need my permission or anyone else's to work on anything (although it's helpful to know no one else is). IIRC not all tracepoints were added (on purpose). If you think you can make a useful contribution here then by all means go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    easyExpected to be an easy issue to resolve.good first issueGood for newcomersmediumExpected to be an issue of medium difficulty to resolve.• driversRelated to the example drivers in `drivers/`.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions