From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B57127380A for ; Wed, 25 Mar 2026 06:43:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774421020; cv=none; b=BB6c+bF9EbfirBGvqwoNojAA3JgztoVbVt6uUNMKw61b7dO2zZRpVOCxxTjioYqAsNTA39tNjnNrHzYCoZ0y/Hp+CNWLDkHK+YwVKsZSTP/+Dk/Fan15sFT0k3NsED85oCLLoQH/omWju+5DTBM2syh+4PfhYn2kdXdS7ODNf7E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774421020; c=relaxed/simple; bh=9cyb6OiBZBRxGGGc8sHy3Km4p8p4taXSQ7mtJeYPa/U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jERBfWbN/FR7TPkCedK5TDCAm64NUCH3qnn+QvL7FaQKLRachR5JDULyYnuCaDGHTKtpA8+PzgosDF62USfIHRjdQUnsZmMGCP6SUHjcf7dCgZpYwqIn6qdxfUJ1A/L1NQxBCrGjhfizWhpMGDCCuxTzazLqbVixuFahv1nlE7I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=X0AX2CzT; arc=none smtp.client-ip=95.215.58.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="X0AX2CzT" Message-ID: <03163163-fae9-4980-8526-a1353cdabcfc@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1774421016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vwhc8PSS+2hKiZYt26VThXfB5guA2AYLd1UkTobn7Lw=; b=X0AX2CzTfTpHTUqbjgE63LGqzCyje8VJv1az6fbjgVRpuymEtR1uoaF1aCRdLCgKEZnxI2 6qalCCqCMd3h2V5MSlM9SdpwShjA/eSKF9czrqllmPEi/Nvi4TmCmMEEPe1BOWSoF0AaSK feWEo6oh1DXj1jVjrm2bz7A1NSxd1Hg= Date: Wed, 25 Mar 2026 14:43:19 +0800 Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCHv4 bpf-next 13/25] bpf: Add support for tracing_multi link fdinfo Content-Language: en-US To: Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , Menglong Dong , Steven Rostedt References: <20260324081846.2334094-1-jolsa@kernel.org> <20260324081846.2334094-14-jolsa@kernel.org> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Leon Hwang In-Reply-To: <20260324081846.2334094-14-jolsa@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 24/3/26 16:18, Jiri Olsa wrote: > Adding tracing_multi link fdinfo support with following output: > > pos: 0 > flags: 02000000 > mnt_id: 19 > ino: 3091 > link_type: tracing_multi > link_id: 382 Would better to add attach_type? attach_type: [fentry,fexit,fsession]_multi Thanks, Leon > prog_tag: 62073a1123f07ef7 > prog_id: 715 > cnt: 10 > cookie BTF-id func > 8 91203 bpf_fentry_test1+0x4/0x10 > 9 91205 bpf_fentry_test2+0x4/0x10 > 7 91206 bpf_fentry_test3+0x4/0x20 > 5 91207 bpf_fentry_test4+0x4/0x20 > 4 91208 bpf_fentry_test5+0x4/0x20 > 2 91209 bpf_fentry_test6+0x4/0x20 > 3 91210 bpf_fentry_test7+0x4/0x10 > 1 91211 bpf_fentry_test8+0x4/0x10 > 10 91212 bpf_fentry_test9+0x4/0x10 > 6 91204 bpf_fentry_test10+0x4/0x10 > > Signed-off-by: Jiri Olsa > --- > kernel/trace/bpf_trace.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c > index 761501ce3a5f..41b691e83dc4 100644 > --- a/kernel/trace/bpf_trace.c > +++ b/kernel/trace/bpf_trace.c > @@ -3618,9 +3618,35 @@ static void bpf_tracing_multi_link_dealloc(struct bpf_link *link) > kvfree(tr_link); > } > > +#ifdef CONFIG_PROC_FS > +static void bpf_tracing_multi_show_fdinfo(const struct bpf_link *link, > + struct seq_file *seq) > +{ > + struct bpf_tracing_multi_link *tr_link = > + container_of(link, struct bpf_tracing_multi_link, link); > + bool has_cookies = !!tr_link->cookies; > + > + seq_printf(seq, "cnt:\t%u\n", tr_link->nodes_cnt); > + > + seq_printf(seq, "%s\t %s\t %s\n", "cookie", "BTF-id", "func"); > + for (int i = 0; i < tr_link->nodes_cnt; i++) { > + struct bpf_tracing_multi_node *mnode = &tr_link->nodes[i]; > + u32 btf_id; > + > + bpf_trampoline_unpack_key(mnode->trampoline->key, NULL, &btf_id); > + seq_printf(seq, "%llu\t %u\t %pS\n", > + has_cookies ? tr_link->cookies[i] : 0, > + btf_id, (void *) mnode->trampoline->ip); > + } > +} > +#endif > + > static const struct bpf_link_ops bpf_tracing_multi_link_lops = { > .release = bpf_tracing_multi_link_release, > .dealloc_deferred = bpf_tracing_multi_link_dealloc, > +#ifdef CONFIG_PROC_FS > + .show_fdinfo = bpf_tracing_multi_show_fdinfo, > +#endif > }; > > int bpf_tracing_multi_attach(struct bpf_prog *prog, const union bpf_attr *attr)