mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gabriele Monaco <gmonaco@redhat.com>
To: wen.yang@linux.dev
Cc: Nam Cao <namcao@linutronix.de>,
	linux-trace-kernel@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/9] rv: Add generic uprobe infrastructure for RV monitors
Date: Thu, 27 Aug 2026 15:45:23 +0200	[thread overview]
Message-ID: <abe07f686da0a2127a9078d55cf5e96c41611eda.camel@redhat.com> (raw)
In-Reply-To: <16b5866f7425a94d42ae370e8e6974911ced9513.1787243842.git.wen.yang@linux.dev>

On Fri, 2026-08-21 at 00:45 +0800, wen.yang@linux.dev wrote:
> From: Wen Yang <wen.yang@linux.dev>
> +/**
> + * struct rv_uprobe - embeddable uprobe handle for RV monitors
> + *
> + * Embed via DECLARE_RV_UPROBE() and pass &name to rv_uprobe_register().
> + * The caller may free the containing struct after rv_uprobe_unregister()
> + * (or rv_uprobe_unregister_nosync() + rv_uprobe_sync()) returns.
> + *
> + * @uc:     embedded uprobe_consumer; set handler/ret_handler before
> registering
> + * @uprobe: registered uprobe pointer (NULL when not registered)
> + * @path:   path of the probed binary, held until unregistration
> + */
> +struct rv_uprobe {
> +	struct uprobe_consumer	uc;
> +	struct uprobe		*uprobe;
> +	struct path		path;
> +};
> +
> +/* Embed a named rv_uprobe inside a caller struct */
> +#define DECLARE_RV_UPROBE(name)		struct rv_uprobe name
> +
> +/**
> + * rv_uprobe_is_registered - test whether an uprobe is currently active
> + * @p: probe to test; may be NULL
> + */

I think kernel-docs for functions should stay with their definitions (in
rv_uprobes.c). This header should have kernel-docs only for what is defined here
(structs or inline functions) and the source should have complete kernel-docs fo
r what's defined there.
Use /** only for complete kernel-docs. You can validate it with
tools/docs/kernel-doc .

> +bool rv_uprobe_is_registered(const struct rv_uprobe *p);
> +
> +/**
> + * rv_uprobe_register - initialise and register an uprobe
> + * @binpath: absolute path to the target binary
> + * @offset:  byte offset within the binary
> + * @p:       caller-provided rv_uprobe (embedded via DECLARE_RV_UPROBE);
> + *           p->uc.handler and/or p->uc.ret_handler must be set before this
> call
> + *
> + * Resolves the path and registers p->uc with the uprobe subsystem.
> + * No heap allocation is performed.
> + *
> + * Returns 0 on success, negative errno on failure.
> + */
> +int rv_uprobe_register(const char *binpath, loff_t offset, struct rv_uprobe
> *p);
...
> +/**
> + * rv_uprobe_unregister_nosync - dequeue an uprobe without waiting
> + */
> +void rv_uprobe_unregister_nosync(struct rv_uprobe *p)
> +{
> +	if (!p || !p->uprobe)
> +		return;
> +
> +	uprobe_unregister_nosync(p->uprobe, &p->uc);
> +	p->uprobe = NULL;
> +	/* path held; caller must call rv_uprobe_sync() then path_put(&p-
> >path) */

This comment isn't necessary here if you have the kernel-doc up-to-date.

> +}
> +EXPORT_SYMBOL_GPL(rv_uprobe_unregister_nosync);

The implementation looks alright, but I still need to test it.

Thanks,
Gabriele


  reply	other threads:[~2026-08-27 13:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20 16:45 [PATCH v6 0/9] rv: Add task latency over budget RV monitor wen.yang
2026-08-20 16:45 ` [PATCH v6 1/9] rv: Introduce DA_MON_ALLOCATION_STRATEGY wen.yang
2026-08-27 11:57   ` Gabriele Monaco
2026-08-20 16:45 ` [PATCH v6 2/9] rv: Add generic uprobe infrastructure for RV monitors wen.yang
2026-08-27 13:45   ` Gabriele Monaco [this message]
2026-08-20 16:45 ` [PATCH v6 3/9] rv: Add tlob model DOT file wen.yang
2026-08-27 10:10   ` Gabriele Monaco
2026-08-20 16:45 ` [PATCH v6 4/9] rv: Fix ha_invariant_passed_ns silent bypass of invariant check wen.yang
2026-08-28 11:15   ` Gabriele Monaco
2026-08-20 16:45 ` [PATCH v6 5/9] rv: Make da_monitor_reset_hook and EVENT_NONE_LBL overridable wen.yang
2026-08-20 16:45 ` [PATCH v6 6/9] rv: Add tlob hybrid automaton monitor wen.yang
2026-08-27 10:05   ` Gabriele Monaco
2026-08-28  9:11   ` Gabriele Monaco
2026-08-20 16:45 ` [PATCH v6 7/9] rv: Add KUnit tests for the tlob monitor wen.yang
2026-08-28  9:34   ` Gabriele Monaco
2026-08-20 16:45 ` [PATCH v6 8/9] selftests/verification: Add tlob selftests wen.yang
2026-08-28  9:49   ` Gabriele Monaco
2026-08-20 16:45 ` [PATCH v6 9/9] selftests/ftrace: Walk up to find test.d/functions when a subdirectory is passed wen.yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abe07f686da0a2127a9078d55cf5e96c41611eda.camel@redhat.com \
    --to=gmonaco@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=namcao@linutronix.de \
    --cc=wen.yang@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®