Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2121287rdb; Tue, 20 Feb 2024 19:06:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV5bGSORyyZ5nM+pOyAzYD8GYRuAJHQD4Bw6oXTRVosRGF80tqz7JaZQklDC9baGqss/AXDoAzyknYPa1Bexj8sRCQmsl0UjexnwvJuhw== X-Google-Smtp-Source: AGHT+IFwjpFCAzKCDSl6rzUsMyZXrOuQFxHBMclzViIjLE4UQIaZJS6chtikcpLDYnoD0rcpaPcP X-Received: by 2002:a92:c6cc:0:b0:364:fffe:44c5 with SMTP id v12-20020a92c6cc000000b00364fffe44c5mr16896623ilm.1.1708484801034; Tue, 20 Feb 2024 19:06:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708484801; cv=pass; d=google.com; s=arc-20160816; b=j3vxzlFP1UTc9SG3asciIvCuf8NtVtYi1GkE6PtdYmmVyCDHwWQSnZJ+zSlfT+odLr SWI5b/+VNvoJl4Tvo1DgVCHC6f9JrjbRErYGNEv1ALa3JpOW3yFLvy545yVpBG4wCTD8 yNdeoH/yJZ4wBvxlhIDqp1wExt7zdOduO5Y8RFvv6iJTvz1jz5olmWRxnDgjLKXK2/qJ Cjf7bphFlPPt1i1kzeUDwrGedJEO9e8ImGu7XDMCYC1sTE2grY+GYXaXfib8ac/G6cbE y4BcToBcI6rXtbFpX4c6CBbEYCdC9Yszzm6kP2HgUk0XtDvCJu0w2ub3E1WoM77qB6TF mYGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=7Qyykz5fB4a0+o7/sN39zAOQibndEWz+FsTBhS+hLSs=; fh=pDSgs4yssN+2Y9CJTtE4sF7cLE0IqzmD8si8bVo7cIs=; b=Fqkdu+YxHS+UJi1EB/PvzVLakprrPuaMyeQdWMExWDZ+pvi6bz0kfKO0aPwx0K1RA6 8Y+RfrYhPVixmW/gSmQ1UYQ4hrD+pyH+nmS/Q+E44g3SXHozT00veVvvAz9sIaDbtOqu CAuLqNZ0qzioZjmp0h151LLX2hXtERQiCw+ITeoxWSDz5jCTcwzJ1qtaumq1KwoAYoQf rauWzqBhB71weXV4XkUJ78sBqE/lb2N1i5+cGMwBczYxETfyo+xzkHP4vdaxoEn6BV1Z Fg1IkXeAqfqnpDxAhcDZ+/ttozw5uVVrgIwtjC71ZpMopXU3JvauEgpRJpnmKA74rvVf TACw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=P9ZEzL06; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-73990-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e19-20020a63ee13000000b005d8c5595ddbsi7066966pgi.271.2024.02.20.19.06.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 19:06:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73990-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=P9ZEzL06; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-73990-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AFCA32855A8 for ; Wed, 21 Feb 2024 03:06:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8F1C2B9D7; Wed, 21 Feb 2024 03:06:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="P9ZEzL06" Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8186E2F36 for ; Wed, 21 Feb 2024 03:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708484792; cv=none; b=OxGgVJAIzXnMU839nSfU1JdvN63MIfEgpgq6kGjQBR10859+fQqDm7m3Ct3IPJ17uXI2VBXJySAVaGWL6BGjG3030OTVpTt1U49FOGKo6/3OQUVX51/PCBtzlveBAGnNHFQE4Sw3XNX1y5oPc1zKc/ynUdPR/QBOtbMRXLptKrw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708484792; c=relaxed/simple; bh=7Qyykz5fB4a0+o7/sN39zAOQibndEWz+FsTBhS+hLSs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=b6ld7Umhi2+9exVmeGfKL3Hp8iPk0Vi3r6LT76Yd3SZA4X0hApjG+3HmqHc8nrvtIOrHwj2M0B9otq0+2FCwm/HttnoWUKiFy2AgPZcPEU5JtNIQoCdJXt01ZQ5fUgyKVew7Du0fmtc9p8L+sQC/8XRquHW5r8v5fA+qRjile0s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=P9ZEzL06; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-299846d6ccfso1764214a91.0 for ; Tue, 20 Feb 2024 19:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1708484791; x=1709089591; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7Qyykz5fB4a0+o7/sN39zAOQibndEWz+FsTBhS+hLSs=; b=P9ZEzL06fOZFwiwCAvAXlrsctbsf+MGECVUWo6H8SLp53IAzSgnXUtLeKsL9e2O00r lhJZMvFDQAUJ6LSo139PnadTxM7b3GZTrQiYCZ5+F5V4ILwDV4Wq1SKGNyMbYG1fsvpR NTFNKDsvXqhdpuKblV/7VxGGMzCS+WkBlydlMuJmRlLmYpDabOzlvk5jQv5GSlydaDlI btNoHiVH2sGECweU9ZhVxPOXbDtWHzoHEM7EkZIN6A9njOnhZKstzGJaQOcFHNJxdNq0 RlsmIy419HOd+EztIYYCN/8yDtUH54sb+kOxPBW/XoYaQf8xvMJl/4VlJdCraWw/QuiP ddyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708484791; x=1709089591; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7Qyykz5fB4a0+o7/sN39zAOQibndEWz+FsTBhS+hLSs=; b=GdHPucFfVDtvJbRuWQLapd0L4YYEd33Ri11VbcEWXRUQ7OdefFso8GKM3H+kdbO1P0 3twg3bDJSMXsX+2U3kc7w9sDZOtAPpT+CoYahKMFa4fSi/11AIaCCC3VWHv8TuSlbS/D npTFHF6/uZ8kC0jFSOLK5X+g1JQQUw7Lqw7/aLsBgwh49F6r30vdTmHfUkNoNehbKVPv hZMVKazL25vVYvC/W8YXfn5lIQOPtceAVUEU+gu9YYDDTDqOVKUXRXploavUhcDmFeCG 1YC2AgtmzxCg9iYnYQmvqFBVHbX4XwmzMV+agVlixgyRIjcPclyXHmmN9O2+mzTsY4Op Kl7A== X-Forwarded-Encrypted: i=1; AJvYcCUupx/bBbie3R09eM8HsnTkzgpaPJeIYo6PjHGDWU+j/LBGd6ahXuqVJb6jmbD6/6dVrUtbboKwzhMlop4zTbGE3ciBxDRcwk1bd4RH X-Gm-Message-State: AOJu0YyeK0X1yUMkBepAJXyvpKyovruxLr1BVRxCkmM6diZAlgBT+kot 9/M5qflPTdddBz2bHE4SyMyQ5FlGsTeQuczUKDcVbj5dE5gj9JDHysVb9G/MKCFx0TGi40FPQwe H/EqqkfSPug9lO8bEa+PAQyvNG98/bKV35jO2kg== X-Received: by 2002:a17:90a:9a94:b0:299:1777:134c with SMTP id e20-20020a17090a9a9400b002991777134cmr12773740pjp.33.1708484790860; Tue, 20 Feb 2024 19:06:30 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240220035105.34626-1-dongmenglong.8@bytedance.com> In-Reply-To: From: =?UTF-8?B?5qKm6b6Z6JGj?= Date: Wed, 21 Feb 2024 11:06:20 +0800 Message-ID: Subject: Re: [External] Re: [PATCH bpf-next 0/5] bpf: make tracing program support multi-attach To: Alexei Starovoitov Cc: Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Eddy Z , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, Kui-Feng Lee , Feng Zhou , Dave Marchevsky , Daniel Xu , LKML , bpf , "open list:KERNEL SELFTEST FRAMEWORK" , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 21, 2024 at 11:02=E2=80=AFAM Alexei Starovoitov wrote: > > On Tue, Feb 20, 2024 at 6:45=E2=80=AFPM =E6=A2=A6=E9=BE=99=E8=91=A3 wrote: > > > > On Wed, Feb 21, 2024 at 10:35=E2=80=AFAM =E6=A2=A6=E9=BE=99=E8=91=A3 wrote: > > > > > > Hello, > > > > > > On Wed, Feb 21, 2024 at 9:24=E2=80=AFAM Alexei Starovoitov > > > wrote: > > > > > > > > On Mon, Feb 19, 2024 at 7:51=E2=80=AFPM Menglong Dong > > > > wrote: > > > > > > > > > > For now, the BPF program of type BPF_PROG_TYPE_TRACING is not all= owed to > > > > > be attached to multiple hooks, and we have to create a BPF progra= m for > > > > > each kernel function, for which we want to trace, even through al= l the > > > > > program have the same (or similar) logic. This can consume extra = memory, > > > > > and make the program loading slow if we have plenty of kernel fun= ction to > > > > > trace. > > > > > > > > Should this be combined with multi link ? > > > > (As was recently done for kprobe_multi and uprobe_multi). > > > > Loading fentry prog once and attaching it through many bpf_links > > > > to multiple places is a nice addition, > > > > but we should probably add a multi link right away too. > > > > > > I was planning to implement the multi link for tracing after this > > > series in another series. I can do it together with this series > > > if you prefer. > > > > > > > Should I introduce the multi link for tracing first, then this series? > > (Furthermore, this series seems not necessary.) > > What do you mean "not necessary" ? > Don't you want to still check that bpf prog access only N args > and BTF for these args matches across all attach points ? No, I means that if we should keep the "Loading fentry prog once and attaching it through many bpf_links to multiple places" and only keep the multi link. Both methods need to check the accessed args of the target.