Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2136833rdb; Tue, 20 Feb 2024 19:58:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWlaQR9WZHMb+xY2uPw5XVmRPf5c7QXdNnKlqL6vQsrLi94Vqw1aK1ozF0a76xsnoX9BIlqR6ut5lvh+R8Mz8flDCaWYjlSEcWmJj+LMg== X-Google-Smtp-Source: AGHT+IGJT/UaANnceyT32gyaR7oEI4ZQP266Y3cdJ/YmR1DS/16AadpfHjmzPV6wUF6eOceH97uE X-Received: by 2002:a17:902:db01:b0:1db:f952:eebf with SMTP id m1-20020a170902db0100b001dbf952eebfmr7595811plx.44.1708487900522; Tue, 20 Feb 2024 19:58:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708487900; cv=pass; d=google.com; s=arc-20160816; b=a0hyCKy/cWQV5YLxTFPltiMBq/MU3H1bqL9XmrlNVJMTjPwb4xgKw5qxy1UZWVZOEG uMSKy+VhgAaRBqkgnS5jRthKcYL6LgIEQ4PoghRIunEg9pJas4xzDi6TALxg5IUAq61R qcbQo1P/hSC35O5zuJtLnj+Z16dwlJRxFXTpIFH6E4ETFCRtv7G21MWIXiR+I+4Webn9 ZaS+kHWQ1hGSn5ElstKPBlh6KemTlP7hjI+yJpM2VJ50dGCkHSVDSdCcw+TO5LJr3IPZ U+gud5jTP5Lo6hUnG95Qn47RpJJjF5uT+cOeHV7gvkUgIhueEzOqaolIRKKvvF+A4FVa 9ULA== 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=jquv4CpaBSqhtiqh7lJvpOasNrgo49Zb1h9viA+rxj4=; fh=9fEywIW1FyPgF9qNUmsAm5FV3YdNScGRKtVzeiusZZc=; b=U8XfU6A9VTAy/kHv4m2wSu5xK04baWguQGEGfzjEPb75Ib0CXHm8D8JYc4baXGL2UU Z/2YQXkYJjWZuUKvqR3N7PUOSjSSxLms2XupJuwpEdCpYBXpKp5+Lb9ohYVEpBIL0CWu QAtNBGCloJ1CopWNhR6rMzIJ3eLeBOZCoBUceZR3x9EqmRbIW8D0YHqFr1gqshVdd87D DsRA7xOpn5snWLyMPEW54tm3DvP8Wzgw3illyK9S33oiVHmMO6iA8otrmybekve/G+fs JUIVNYPIp+mV+bKiPIBdvgkn1II3NeswPu0Q/fWjIs/POM95xjX3rDxplt5BlXxqiKmh tstA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=h4YroqIt; 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-74041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74041-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j6-20020a17090276c600b001da18419bb9si7313810plt.55.2024.02.20.19.58.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 19:58:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=h4YroqIt; 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-74041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74041-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 37397283B08 for ; Wed, 21 Feb 2024 03:58:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83C5938FA7; Wed, 21 Feb 2024 03:58:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="h4YroqIt" Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 1811E1851 for ; Wed, 21 Feb 2024 03:58:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708487891; cv=none; b=Dz9gWfqlKHxO6JgyZA0xuCU0Bp0PqrIDV+gc8ngXVmwAc8WlCDQ9RktWzxU61EBDeuN5lv2QaK+wfnrudbLnRHDzvLGvWp9W1JwAcw90Ucl02vlMs0ykhChRQki1kT48mpDrAgKPlfKZ/HAY+3GanKK7M2CTXE8U4HTmXak+ul0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708487891; c=relaxed/simple; bh=jquv4CpaBSqhtiqh7lJvpOasNrgo49Zb1h9viA+rxj4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=RBNXAUvAPVW+ExgD6C6Q50cJKqotBg4/qXhZUMIs5eM3ouCnKfo3IW+qyJ4MlKzh3ofYi8JtF8tGZ8ih7b0QHmawyaBobMYDp9z5UPX2cprU3EBmZLcbG/gV5CR01EGR5kc3RYOFsyOePvCLvDu34hQt5wKyQykb7gTa+H66fII= 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=h4YroqIt; arc=none smtp.client-ip=209.85.210.182 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-pf1-f182.google.com with SMTP id d2e1a72fcca58-6e09143c7bdso3379850b3a.3 for ; Tue, 20 Feb 2024 19:58:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1708487889; x=1709092689; 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=jquv4CpaBSqhtiqh7lJvpOasNrgo49Zb1h9viA+rxj4=; b=h4YroqIt5P77JejHMWjSsaMAKdFmGgF4PT1GYzOEpSOoielziWlNBY+ssvhLJWt9Is 7/2Rb5ZfEw7TQqU70aPIz2PYRWRa7cEYyQ8B/g9Y+Z8JQxJ7bwUoFO7Ycw/yF0qUSZFP tbb7v1xDmAXLwQbJHM52skxZGq/oJJhNSpLdRic2CIlO529A7DE8hyrYtQUqKnnkPV93 6vBj6t42bHc1vdLZGDCYaxYIlHBW4G7EW3D6Gvjpcw2e4DMMmfiCnDhjYyqZfM1LRb/N FDBU2R3Gf+Ts65ay+rFdrRXOdcvWRpK9X/ICdfnskuvgIuvyEMD3m8gcunUr7xFXGgai SB8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708487889; x=1709092689; 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=jquv4CpaBSqhtiqh7lJvpOasNrgo49Zb1h9viA+rxj4=; b=GtWH7fhItGQgLnFxSM8iQ1F0hotMSCuCTK089HMhlD3mOqVbXBqW34FiAOdyGFfjBL kDFnlx+2bkCeD8KkI9p4GmZPcmXaOJmXcNDv6yNIonbBvQ/kzV5Y7mJ3X6xGCYZ2LB1a AX9LBt9RenTGMOhHL6T/JZKGlo7aBdyRXPPtsQQVwcJ1kVfKD82QW05rXAFJOLcrH/os 64+0zioFyh/+ncgbkBaMQn98GFrglzdyQU3YKXX486JU/cr+3cKje0hHSF3WNbWV5NiF mZaU5XOvl1ZiFMWmxNkVedWcib28s3uX8JgPr/otDrEZz/gjPy2JiNpMkBVZ7i1UIfJW 0pgQ== X-Forwarded-Encrypted: i=1; AJvYcCUO7ruO33TIhay7ofLM5dnqnAil+AVEQgJGZsjnGZKKxA0fwEpkXwR5mBuJaNqHBbQvmSwuGl8xpYa/o3BansKIv2u+qc9yHmkpz4mE X-Gm-Message-State: AOJu0YxznzYYyC7fdZTTvERqI5qnme6S1hDATYbrYl35gt/2fyASRQZ4 dEtlohzaUNXpcElVfqWjvu7UN/ugSaIHMG+Gk1r6kKBBEShuZlWFAcvWXgVDYIbKEJ0iGzoQiKs 1uhTkAX2SMSZa1C3j1sRfZuRp3C1/52UjmUorAA== X-Received: by 2002:a05:6a20:d38f:b0:19e:a353:81b0 with SMTP id iq15-20020a056a20d38f00b0019ea35381b0mr17920299pzb.11.1708487889551; Tue, 20 Feb 2024 19:58:09 -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:57:58 +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:18=E2=80=AFAM Alexei Starovoitov wrote: > > On Tue, Feb 20, 2024 at 7:06=E2=80=AFPM =E6=A2=A6=E9=BE=99=E8=91=A3 wrote: > > > > 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 <= dongmenglong.8@bytedance.com> 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= allowed to > > > > > > > be attached to multiple hooks, and we have to create a BPF pr= ogram for > > > > > > > each kernel function, for which we want to trace, even throug= h all the > > > > > > > program have the same (or similar) logic. This can consume ex= tra memory, > > > > > > > and make the program loading slow if we have plenty of kernel= function 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_link= s > > > > > > 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 seri= es? > > > > (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. > > I suspect supporting multi link only is better, > since the amount of kernel code to maintain will be less. Okay!