Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2085412rdb; Tue, 20 Feb 2024 17:24:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWmcifm4j/+zMwpqSa1ciPokrvArTKR8GIbzdKd/MQB6KzmbBfRha7PEKf9Xg6auwEPy0ozYq9LEf+ndQt8N3N9gxAkE7tcdT653gm4fQ== X-Google-Smtp-Source: AGHT+IEDGvwIR8dXlvTrOa2mFcG9Q5yj95p2PgCSVcuUWmKCHiL3eKCB23hTy0Wmq95tzeIUElNW X-Received: by 2002:a17:902:ecc1:b0:1dc:673:1932 with SMTP id a1-20020a170902ecc100b001dc06731932mr6842709plh.38.1708478678562; Tue, 20 Feb 2024 17:24:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708478678; cv=pass; d=google.com; s=arc-20160816; b=DCO6tCU6wfAV5dnr9QRjeCYCaHc+CihpNc22cVUMZiAgJPZIFFfp/YHmiYak1fWbNo TPcUlWE0p/4dBtoamO9BMSXbIGGVq3UvPuXx6/IehuFIS+vTnk6U3FGCXPG1MXKQhK1h HthklA/hRx28N8pHnpuGrvhAA9VsRgptPzk9ZkY74BZKQGTw2tv0KU28JCvhNGpwXsYg KgCGaTGRLCkHzlVu4uaD7fXDLJhQIL2pgIJ/WAwBhmpbnAK4s0gmhT2d/qWco/6+hbUn SOCHBav4kahPl2mguJXOkjgOgg8OoblXWsjvNSXDFBTxRQZ5U6Y/z6soDq2U+3eFA0PA Umzg== 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=QZojfwT+RxAPcmdQGaQgA+F8ssXlbPridr3vJSQMHT4=; fh=2IFTjmA+UmAb0nNbcBzgsWBjfPbrY7gbUIOiEs45iAU=; b=CpGTZ/w+XSSaaDN3E41etOK7LLeD4pmbfnF8ySK2yvZPSW56tbRE/eWL79YtqFiDEh iJDan6X5M7e5tFKnkB5jRxGhW+dmoXu7ntWqhMdxATd1mxg3FR4h5aE+noq9qxgUVgIB iNtm8SmP+FVxw5a830gjj8/762nzOMDMGN1SgYu2AUJf2Kk+X45M4la/GTduSLlP2ES+ BD4o2tpe0Z222wtLMJAJGS+0bUeLpd92zdCZtSL56yyCBFmeDcm9ZL8ku5KUK9vtZsbn 7HxSUXR8f8FS6n30DkzSQBLFftsGeFSeT7P2aigljLu6HyQAWJ9mYHlxgmATvUUnaDgh qrLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OWrAeSWf; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-73903-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e8-20020a170903240800b001dbe837407esi5069931plo.34.2024.02.20.17.24.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 17:24:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73903-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=@gmail.com header.s=20230601 header.b=OWrAeSWf; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-73903-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 492E2284E64 for ; Wed, 21 Feb 2024 01:24:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 947CD4694; Wed, 21 Feb 2024 01:24:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OWrAeSWf" Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 381791FBF; Wed, 21 Feb 2024 01:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708478670; cv=none; b=VESWiLEzZr4/QjpG7ru6bfrcSPjp0X8O2Il+54aPVSEypRojLPqTgsUlcUjqNM1xWjOKR2AKsRxx+5Yl1BZn5HEfW41JryO3dlJN9l5cVxYQxguufo/PAwQOUNDv5yATdga+F4wOuRLG98bew6d0xfyWF8WxE2HanvEXOJswU4E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708478670; c=relaxed/simple; bh=QZojfwT+RxAPcmdQGaQgA+F8ssXlbPridr3vJSQMHT4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=GRldLuwejUA2QQ2q/90ioEu2BGGZcnHmYHK+vCy14XoHr+fPT4+YgdEFnuvfdJGMqJvEosoGKZSrPM3/9WpBVH3YWOT8Vivdc4Dacb+rJCfrfc6xjPA34SCqLipLYKTR7+pm/oRKwCZTfalMRc0m5ZI8m1uPgVpXfQrpDZLfvb4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OWrAeSWf; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-33d754746c3so261294f8f.1; Tue, 20 Feb 2024 17:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708478667; x=1709083467; 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=QZojfwT+RxAPcmdQGaQgA+F8ssXlbPridr3vJSQMHT4=; b=OWrAeSWfUGL36cZTld8OYlai5rafUEyLQ8TlkZaY6AhUOjumMc4P9k8F612tzCww8S HztGjYC72SK1gsDcvM/j0KHGuFcPg2VqFZBtM+wbS8Im+RbTjPsKsOyF/iB1JipdkWFC avQeS9MVsrHwe1Jhyi7Rzz3+ShggxJG0FwOxJS2gBJxLfDLUJIZqFRhZBHsWzL4TKQhz qAXnDSKMGjGVW5XX/8irw1ReKYr79Z+qFXO46KuhIz6RB1L3jmX9JFJpa5Dcb8zrUTeF P/xWE/Z0/FyYVLhjkz16HD0wRw/rTtKJiFhkVqy83onyFHEus1xmsrbNWd6vzVts7FdF gf6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708478667; x=1709083467; 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=QZojfwT+RxAPcmdQGaQgA+F8ssXlbPridr3vJSQMHT4=; b=dw/ZLIjppozkgWHcx+QS0SObeLcu63LnzBYlCRUvG8O/Te2bvbEZGYY2EEPDZmfBGz fkq+U97j4AR1yaLV0pOlCvSJeNhXB2c/D44pJk2nrp9cuvnv+wqYy0dZ3ZFnv/HJd4+y k5I/Dj3+hrZp6yssJjvZBfom4wgDmzWTVhjQuShR5T3bWrwpx4Bqz1cPj83Ww45oGxta Te8hHDWcoyRmZl1vbd5E93Qbc0BPv42DFX+7MJ8jd63L3KCZBklX2qDtU1qSW+aD252J mFq+OlAUL9c98tcheo+nyyHezJVsoVJNV5vGVptCv57lR0BE3eO5cDLTmN9Lh9HehPrz VEkA== X-Forwarded-Encrypted: i=1; AJvYcCVW6GZKh+2dZ1W4ScGEQh2Axi/iThsI/BiIbmVi7U2urW1O96SqxyDLSmga9ExsSEGHmHL71zwZjQN09j5QFV4jrG1pHOo2yzBYRhN+s5dT4IeZNjW+tT+ykLMcUwicpT2xEkKRpP07yCcQqAayqU255yLFd/HizYdWX7Qm0TIy1jxC X-Gm-Message-State: AOJu0Yz4ExHCzImanBCBaWVUAUaarJpA+zOLdwDh2P256GopdeZgpz5/ gXb5A8IsCgodtVTB55oNC7acdxPRDcc7AphlbkcnT2fb7O4SHposV30/1yTf7svm+m7EWnicI+Q 46YXjl5Ol+dyOKTbvqug69bWNlD8= X-Received: by 2002:a05:6000:1e86:b0:33d:34a9:902f with SMTP id dd6-20020a0560001e8600b0033d34a9902fmr7166848wrb.36.1708478667438; Tue, 20 Feb 2024 17:24:27 -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: <20240220035105.34626-1-dongmenglong.8@bytedance.com> From: Alexei Starovoitov Date: Tue, 20 Feb 2024 17:24:16 -0800 Message-ID: Subject: Re: [PATCH bpf-next 0/5] bpf: make tracing program support multi-attach To: Menglong Dong 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 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 program for > each kernel function, for which we want to trace, even through all 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 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_links to multiple places is a nice addition, but we should probably add a multi link right away too.