[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250903104933.GB18799@redhat.com>
Date: Wed, 3 Sep 2025 12:49:33 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Jiri Olsa <jolsa@...nel.org>
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Andrii Nakryiko <andrii@...nel.org>, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
x86@...nel.org, Song Liu <songliubraving@...com>,
Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
Hao Luo <haoluo@...gle.com>, Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH perf/core 01/11] uprobes: Add unique flag to uprobe
consumer
On 09/02, Jiri Olsa wrote:
>
> +static bool consumer_can_add(struct list_head *head, struct uprobe_consumer *uc)
> +{
> + /* Uprobe has no consumer, we can add any. */
> + if (list_empty(head))
> + return true;
> + /* Uprobe has consumer/s, we can't add unique one. */
> + if (uc->is_unique)
> + return false;
> + /*
> + * Uprobe has consumer/s, we can add nother consumer only if the
> + * current consumer is not unique.
> + **/
> + return !list_first_entry(head, struct uprobe_consumer, cons_node)->is_unique;
> +}
Since you are going to send V2 anyway... purely cosmetic and subjective nit,
but somehow I can't resist,
bool consumer_can_add(struct list_head *head, struct uprobe_consumer *new)
{
struct uprobe_consumer *old = list_first_entry_or_null(...);
return !old || (!old->exclusive && !new->exclusive);
}
looks a bit more readable to me. Please ignore if you like your version more.
Oleg.
Powered by blists - more mailing lists