From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 075D917B50F for ; Mon, 23 Jun 2025 02:32:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750645981; cv=none; b=nPBJK3Mqi5g4s+zAEU7uAjg7ybOPTrSiuSWnPe4vXyyMOO8OYKNeZiHi/uvTV7gGIa/Flyy6nU5AlIL20Hbne6PdhaY3xdmsmgFWXbjKYMLAbvkhEvmlUqx+D7LOTpkzsfkDfvXvgIMyWtg+DaiziTbJwnroVsfDlFAMzxIzZsM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750645981; c=relaxed/simple; bh=8hluwjVTmXXog4aTRxgoRd/tz2EcAslNixaPAR1dtNM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mymI3B132YKZMm5ZuN+HZVQwkbkiZeABGqJZ2syUbQQSIEgmvcj5cCEQLWpVL4gj9v04fQTFJ2FOl9BM8/pk6SNoJH2SsXnoudjkII8IsGYFP01gHEeGxGmxlZRBf1YiLJKOYO7bVGGW116fgDgzVnB4yfeVRYNFqEMFC+Ts8JY= 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=sl30Inp7; arc=none smtp.client-ip=95.215.58.188 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="sl30Inp7" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1750645968; 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=voS/IXxDZSgvXt/HTZvb06bjDBsLY8G70iK7t5CzXcc=; b=sl30Inp7L/uRJ9KlWfg7mh20YwAu/RTNbG+JqwALSU3CmnMZgQP4CJaIZcn9BdGjhz6dn0 0TCN/xTkJNH1YjvfJHIKGd1ChZV6jrNs1v2+IKrc4aSuY+GhejGCRtf2HG1fWJCHUgR4Fl 9afyH2U6vEpvvI63s7aftIqRAeawro8= Date: Mon, 23 Jun 2025 10:32:28 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v4 2/2] bpf: Add show_fdinfo for kprobe_multi To: Alexei Starovoitov Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Matt Bobrowski , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , bpf , LKML , linux-trace-kernel References: <20250619034257.70520-1-chen.dylane@linux.dev> <20250619034257.70520-2-chen.dylane@linux.dev> <9eedd830-9222-4ac0-8ccd-72499fb85b13@linux.dev> <77b09f48-01d9-46f1-8a31-a1824c0eef8d@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Tao Chen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 在 2025/6/21 02:25, Alexei Starovoitov 写道: > On Thu, Jun 19, 2025 at 8:31 PM Tao Chen wrote: >> >> 在 2025/6/20 10:59, Alexei Starovoitov 写道: >>> On Thu, Jun 19, 2025 at 7:46 PM Tao Chen wrote: >>>> >>>> 在 2025/6/20 01:17, Alexei Starovoitov 写道: >>>>> On Wed, Jun 18, 2025 at 8:44 PM Tao Chen wrote: >>>>>> >>>>>> Show kprobe_multi link info with fdinfo, the info as follows: >>>>>> >>>>>> link_type: kprobe_multi >>>>>> link_id: 1 >>>>>> prog_tag: a15b7646cb7f3322 >>>>>> prog_id: 21 >>>>>> type: kprobe_multi >>>>> >>>>> .. >>>>> >>>>>> + seq_printf(seq, >>>>>> + "type:\t%s\n" >>>>>> + "kprobe_cnt:\t%u\n" >>>>>> + "missed:\t%lu\n", >>>>>> + kmulti_link->flags == BPF_F_KPROBE_MULTI_RETURN ? "kretprobe_multi" : >>>>>> + "kprobe_multi", >>>>> >>>>> why print the same info twice ? >>>>> seq_printf(m, "link_type:\t%s\n", bpf_link_type_strs[type]); >>>>> in bpf_link_show_fdinfo() already did it in a cleaner way. >>>>> >>>> >>>> link_type only shows 'kprobe_multi', maybe we can show the format like: >>> >>> Ohh. Especially so. It would be wrong and confusing to display: >>> link_type: kprobe_multi >>> type: kretprobe_multi >>> >>> Let's fix 'link_type' to display it properly. >> >> What do you think show like this: >> >> link_type: kprobe_multi >> link_id: 1 >> prog_tag: 33be53a4fd673e1d >> prog_id: 21 >> retprobe: false > > It leaks implementation details. > For the kernel the link type is BPF_LINK_TYPE_KPROBE_MULTI for retprobe too, > but show_fdinfo is for humans. > 'link_type:' field can be more precise and differentiate > what's effectively a subtype of the link. Well, i will fix it in v5. Thanks. -- Best Regards Tao Chen