From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (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 6D7D3364EBF for ; Mon, 29 Jun 2026 10:55:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782730542; cv=none; b=rhWkQF9Az9HGoR06pLRAWMku8ifxnZMmF0/TVqSyM9UhLvRVmck9FVUfPiFIFRUgAdwdx2+A2eEdyCD64zYEFcqptdM+oeJ6LG6oVBhTARoFAq/Ahwqxx5+t4p7vYV5RTJwoX1uUXGre9UbDECIczrW3luwtf7Z1pgKea09PCYg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782730542; c=relaxed/simple; bh=imTjA+0O2e6HQVFcIonBts3XhcrtKnuS8mtXFp20zik=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Z5DGs2Tck1xmEG1xMor8JzkKTk4B1X2bAFq/4MggPBG/6W2O+4XPx+r4NH2k4P9o0ahNFyoalH3utpTJ1c+cFz1pKm3pHkqwiXCDzwzbGowVwBpEs7CRSWoFiEu2OJRGsJ4vp7dlL5w5vO1ZyXNFKSKGfBIg6EGxOEI5cEOpWVM= 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=Hog9A6Yw; arc=none smtp.client-ip=95.215.58.180 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="Hog9A6Yw" Message-ID: <4f30012f-778b-4c7d-b610-2e18cf01abdd@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1782730539; 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=mKHjzvlntcGT6k+3BIWnKFMiFZceKFoemKxv/3R/xQY=; b=Hog9A6Ywk551pSQKQZ3mlgkE6vuPXrJMM2Bpjvo5zIIqMGVRmf+xZYSYvREkuftUw4ytUq VLQMNiw4yUYeKlXvSXEDDIK996aWh9XCnghDZJLE3+DwAw7KrWJSXCbcC3W0CIbixgd6f9 NPuXC77d+JvihbARenpAZ3+eTvKERBs= Date: Mon, 29 Jun 2026 18:55:28 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [RFC PATCH bpf-next 00/12] bpf: Introduce static-defined tracing probe for BPF Content-Language: en-US To: Xu Kuohai , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Yonghong Song , Jiri Olsa , KP Singh , Anton Protopopov , Amery Hung , Eyal Birger , Rong Tao References: <855e44f3-d22c-47e5-8bd1-c5d9f7014a75@linux.dev> <55499fcf-d552-4366-9016-21ede7f687ac@huaweicloud.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Leon Hwang In-Reply-To: <55499fcf-d552-4366-9016-21ede7f687ac@huaweicloud.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 29/6/26 15:51, Xu Kuohai wrote: >> >> With the elimination, the callsite of 'subprog' has been eliminated. >> >> However, as you mentioned above, the argument preparation insns are kept. >> > > I see, the CALL insntruction is removed, not patched to NOP. > > So the call site is either a call to subprog, or totally removed. The > fentry > tracing only works when the CALL instruction and the subprog are not > eliminated. > This is exactly what SDT tries to solve. > So, why not add a macro for the stub following the subprog+fentry idea? #define DEFINE_TRACING_STUB(__stub, ...) \ static __noinline void __stub(...) \ { \ ... \ } DEFINE_TRACING_STUB(my_trace, int, len, int, ret); SEC("xdp") int xdp_prog(struct xdp_md *ctx) { ... my_trace(len, ret); ... } Then, add a libbpf API bpf_program__remove_stub(prog, my_stub) to drop the stub by the way like my demo. Thanks, Leon