Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp784397lql; Mon, 11 Mar 2024 18:44:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcStuR892n6uzyKS6nVqf3XV30fJ+HQPLqgJg0eMMfMJnfrb3J+V+Ybs1i3+NFZUHi3WfiJwRafK+yBjRQ+IFs+0ccrkNMd73TR3pp8g== X-Google-Smtp-Source: AGHT+IEL9NQLnktqlm0sRfA5JGlS/XndxCdh8I2nXgKIqdFQOFDQTxcIVkuawQNeHSZqYm1MFY/A X-Received: by 2002:ad4:58c5:0:b0:690:af2f:6da2 with SMTP id dh5-20020ad458c5000000b00690af2f6da2mr7429381qvb.7.1710207858785; Mon, 11 Mar 2024 18:44:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710207858; cv=pass; d=google.com; s=arc-20160816; b=ZHU2cn3GLdy19QcOJZqMxoRIAMgGcuighD62bCwK9HDNxmphE9FIx0R2H3OmYrEeXJ gafoTbB/JqSNJ5Z23rBdcte75n0OwfU8ag70aR5sKNFk/64m41XrJlfSWnnmw3nn9gl5 DYTy40XMXtOXyTyZWLtzhZiKjUOOZbFsYQ7z3MQ/ubTvgcrz6wvFeQLs7+rSzGJjOuh3 4WM61GsvoDvH4YyRadn23C0KLdgkGCN/Ckwx/JuHYlC+26ca24Cyg8tkw7h7ul6X497e +7IDxLjb5v8pMOzuRZXfiAwYgYEGTap9qARIDvlK61WfzWSzLB6oFH4R+NIfAAb6mT4T UB/g== 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=labtf93chunomZqW/vUnTTFsyT2Ay36RYxUH/Np39t8=; fh=rlEzKdHjy47r8bD2fNyrrHU3in14WPpo/3oNJKmZ40g=; b=YHjabqX0cdYOqTbCSkdnPtEx9HwZv2GaPFYUUBeZTD7tj1s2HL7HFZx+6YEP3zTKNT 732u9dEU+1MvS0hemKVgs2cKsHs9xkByqzCsMzaACHVTaupjcwnPikunG3kACS/xALBB 6CrbK9TrDtv4Dh1g0Y1w+X5FyqMG8RxuN9owaelciTS3hi5ctKbjezWctzrXYyZ/zgOP rkQbHygXeEfE/J4hlXLlo5wROXHXTT1TKCdCt6xB0YZbnS8q0aegpjL5LlFkWVcS/L1S E0eLp5GZ1f5ueX7tjpNH0U1G/AEdcSU2xKILI4/AMHN+/y62YffqXrznMM2nTVF89X8K aAaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=H+DBPEeS; 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-99741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99741-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o6-20020a0562140e4600b0068f13165047si6612176qvc.0.2024.03.11.18.44.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 18:44:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=H+DBPEeS; 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-99741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99741-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3D1E71C213D2 for ; Tue, 12 Mar 2024 01:44:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BAD8120E6; Tue, 12 Mar 2024 01:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="H+DBPEeS" Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.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 676E3111AC for ; Tue, 12 Mar 2024 01:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710207847; cv=none; b=eInafHzlbpI3Kc+koAvaA0YNNSZqhtclKBg2POWNPyp0LE9KKihCWpxkogYvBq68uNx5uUoV0lcr3LnsMH/BuB/goL2xwg0ndMJ7HHowgrs+jxSsvg9Y3/9CRKfU3QUF1tXq5QStCcb3Cl1UrLK7uL14ZeM0EBQxvNXBU4Woqsc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710207847; c=relaxed/simple; bh=uFfJuhQfHN1jJpmCHkndoERuZP2CwvzUJu70xuEeI4g=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=g54d+bjXeXcbccXlN5VbfE19zUUirav9ZP/GvbjGglZQdn3an6T2aG8DmJW2aBvGo0O5otEZDBhvGXlbHxAFrsUr98KwiNqJuzdEDUbAeqJYsdb+TpgL4KAWGeJ7XZww/YN8jfPRQX80cJQYF5w/pLMBjIFIexnVEr/WHijrYy8= 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=H+DBPEeS; arc=none smtp.client-ip=209.85.216.42 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-f42.google.com with SMTP id 98e67ed59e1d1-29954bb87b4so2217441a91.2 for ; Mon, 11 Mar 2024 18:44:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1710207845; x=1710812645; 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=labtf93chunomZqW/vUnTTFsyT2Ay36RYxUH/Np39t8=; b=H+DBPEeS8Lo4eGaJw42yL0NKrh5JZqnsWD3PJpXg2WdV4On3zuOHa2pbKkEgp8KgwM E2gP8b13VIWjQYcoCeuhArpvokd5JPO5fsNtVwnB/qaxDMFcreS226XksmTrSa7JTv6E RPJWY/AtdnRcVYO86O+5aSQgsaFXt8B+isQzQ5Kg1o32qIEg8JYYvZ3TAG/7rYPTab1/ 5mqMlB9JV0TRkzsuiFWkAk9F+Lej9LlqyFzG6wJDAHCrsuroI4IN2wTKEI+oiiyU4JDN XgH4iScQ5bjCUuvNDlESAh3oT+EP13BKSPPpBl72W+mokQpqrdCAkiKQ68bb6nOnmir8 O0nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710207845; x=1710812645; 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=labtf93chunomZqW/vUnTTFsyT2Ay36RYxUH/Np39t8=; b=XF9HlNdSgdTY3CqlgX7EyPxQuOf++YGTQyK/1wysbSHuFsXUUXiEykVNiBFKPA/9WM FAaAKh86VX0u/C2mOXMoV5/77LfqpJBI3KX0nYQbHxvnyM4igluPmtR3oOOeaOMOsnas 2LzsP7PHmqkUGC3d/sIDJR0SU4TaiXg4Xau/YcRdjkNxbdFw+pDmF49efJUUinjh2LGc Ip4hZRNdey1OnFEcFPn7YqSxzHj8jJTlN5dT3v0PRMpDwKqQAGnk4f3APm1JGvBIKRlL 1ceIiJ6ffsJRQMxoziDqT1kdtiTcCncw9I2BHuj5jwaCAPXtQrigj9MntJWXn8CE3Wwn JEoA== X-Forwarded-Encrypted: i=1; AJvYcCUOUJ9BS+xUTuGqnwCYVgcck8czNfdeO/KaNeGCQQa9GntXkdo+IKaVSmd0zAb2R2T+eUrAcT8rjhYP0JW3lGwt/pbXiUMNbdBclp6H X-Gm-Message-State: AOJu0Yzwicb6VU13uSaS06cDob3Q4RUAlQ9c7c/elvL2orXFxJqldK8h OtAE/S0zoCAUStkQJw534kbHFIgrp25pYjnmH83YlGGhTQ178odqLK+7sF///xskz0R4MYLML+v yJLANdjYQBUh4v4oV/3PsyfEKvSs0+XljvSlq9g== X-Received: by 2002:a17:90a:8991:b0:29b:aee2:cc8f with SMTP id v17-20020a17090a899100b0029baee2cc8fmr6097802pjn.9.1710207845560; Mon, 11 Mar 2024 18:44:05 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240311093526.1010158-1-dongmenglong.8@bytedance.com> <20240311093526.1010158-9-dongmenglong.8@bytedance.com> In-Reply-To: From: =?UTF-8?B?5qKm6b6Z6JGj?= Date: Tue, 12 Mar 2024 09:43:54 +0800 Message-ID: Subject: Re: [External] Re: [PATCH bpf-next v2 8/9] libbpf: add support for the multi-link of tracing To: Quentin Monnet Cc: andrii@kernel.org, ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, davem@davemloft.net, dsahern@kernel.org, dave.hansen@linux.intel.com, x86@kernel.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 11, 2024 at 11:29=E2=80=AFPM Quentin Monnet wrote: > > 2024-03-11 09:35 UTC+0000 ~ Menglong Dong > > Add support for the attach types of: > > > > BPF_TRACE_FENTRY_MULTI > > BPF_TRACE_FEXIT_MULTI > > BPF_MODIFY_RETURN_MULTI > > > > Signed-off-by: Menglong Dong > > --- > > tools/bpf/bpftool/common.c | 3 + > > tools/lib/bpf/bpf.c | 10 +++ > > tools/lib/bpf/bpf.h | 6 ++ > > tools/lib/bpf/libbpf.c | 168 ++++++++++++++++++++++++++++++++++++- > > tools/lib/bpf/libbpf.h | 14 ++++ > > tools/lib/bpf/libbpf.map | 1 + > > 6 files changed, 199 insertions(+), 3 deletions(-) > > > > diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c > > index cc6e6aae2447..ffc85256671d 100644 > > --- a/tools/bpf/bpftool/common.c > > +++ b/tools/bpf/bpftool/common.c > > @@ -1089,6 +1089,9 @@ const char *bpf_attach_type_input_str(enum bpf_at= tach_type t) > > case BPF_TRACE_FENTRY: return "fentry"; > > case BPF_TRACE_FEXIT: return "fexit"; > > case BPF_MODIFY_RETURN: return "mod_ret"; > > + case BPF_TRACE_FENTRY_MULTI: return "fentry_multi"; > > + case BPF_TRACE_FEXIT_MULTI: return "fexit_multi"; > > + case BPF_MODIFY_RETURN_MULTI: return "mod_ret_multi"; > > case BPF_SK_REUSEPORT_SELECT: return "sk_skb_reuseport_= select"; > > case BPF_SK_REUSEPORT_SELECT_OR_MIGRATE: return "sk_skb_re= useport_select_or_migrate"; > > default: return libbpf_bpf_attach_type_str(t); > > Hi, please drop this part in bpftool. > > bpf_attach_type_input_str() is used for legacy attach type names that > were used before bpftool switched to libbpf_bpf_attach_type_str(), and > that are still supported today. The names for new attach types should > just be retrieved with libbpf_bpf_attach_type_str(). And function > bpf_attach_type_input_str() is also only used for attaching > cgroup-related programs with "bpftool cgroup (at|de)tach". Okay! I was confused about this function, which has reduplicated information about the attach type name, and I understand it now. Thanks! Menglong Dong > > Thanks, > Quentin >