Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4174912rwb; Fri, 30 Sep 2022 14:09:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7n9raXzh1TraCM4aiUFP7DwsRS7uqXdQgBZx5x/1KUZidM/s8spzlO1sGvszSR9gwcF23D X-Received: by 2002:a65:4c85:0:b0:43b:f860:98f9 with SMTP id m5-20020a654c85000000b0043bf86098f9mr9106549pgt.368.1664572165031; Fri, 30 Sep 2022 14:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664572165; cv=none; d=google.com; s=arc-20160816; b=ytIAUJCQhu4g9vB94NYgpKM8X+vzux9bkfGu08EXZ6F4R3XInzNvUn6g+cMjpM7lwu ThldDps6MUQL+8k4I4xthgmYEXvfi2cZSm9yprJVj9OIN+/FZLVUd6ATbGP1gIbRyugZ hDzwzMlgyrjcTDDl/iuZxRjDJB67owFzGfgFML6e511H3RPnBzurMLeeCyCfFwmu5t+A cIRid7QZfZnOC1Al/pSZsYGdf7Ovcr264x0Ik4jdmoea+ltRESeJ7Mj1UlbY8yd/o4Jy D/4WGsFZ0+m4zfXlxsQ9mQafyv0jEfwQUoJTmw4E8D33zOwJEJ2uQMgIRiIHmhOXYX7J Sjzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1K6Q0nQ5Q42g4z04WoQRYtpfm67biYFm2mWxuvCIHOg=; b=XDsV0w1QsS/pEu+YCDkC1kpMSseXC8K5qdntk2ZMmWZWXwVvJrvEgE+nAeice4gSRQ 7UOXvMn2QAsA+ERh/z7j4g1VUtV4utenS8f6TgmVc4JeErq6body+1R2XZctyK6tssOI kLzPDGs6tpIRE2v1lCrrMCGgsIlfoWC7a5ZpqAx6PZ+GXZ5X+jUu5APc4+moFf2WB8Ql 2a9Zr4y28t7hGGDarFceAVWx/4UDBXvX+gevERzGt3uRS/6x9EaXeBnLCFxAXIF3k9pi Hb09XZMstSs0Kmd2WYTf6sXBepk91CfG3B7NRiOkCqboFhULhpH7Fyxzig6H52jj1tOv nnVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SlpVM0+L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r10-20020a63e50a000000b004392e26a2f7si4114471pgh.404.2022.09.30.14.09.13; Fri, 30 Sep 2022 14:09:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SlpVM0+L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232158AbiI3UzZ (ORCPT + 99 others); Fri, 30 Sep 2022 16:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231673AbiI3UzR (ORCPT ); Fri, 30 Sep 2022 16:55:17 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A5CF4F1AC; Fri, 30 Sep 2022 13:55:16 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id m3so7459557eda.12; Fri, 30 Sep 2022 13:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1K6Q0nQ5Q42g4z04WoQRYtpfm67biYFm2mWxuvCIHOg=; b=SlpVM0+LZ62XFANK16bQHLbikjK/JqKERbC2w9AnTEhvLIhcRRxnIsBQtmz9zQX3ob 9h9dhCl6G4vLD8wsvGMaKJwVRoxGsPo5O5RFxmlLOvZKMdrAAWLyTghBzlhUsSKO6Gz2 YWMhzPJTiaVo5I806ggo7ejuMMWpM6txhgt+duAy2Dh5aGpT+ApCh/NWZ8w+hg4PkIAE mWA+kLNtirYohN88y4+G5/LgmrPYAEUq40gG7VYx2xcZYlkx/Cm0hTSrJwcTlOhB0K+z kXeNFUZ1Bj7um2axCBiBEFXA2DfaYQYtu+6rUbZbsO9FziviHfyxIRfGD60/YGY42EVd LoxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=1K6Q0nQ5Q42g4z04WoQRYtpfm67biYFm2mWxuvCIHOg=; b=T4e3kCu+MfWc8E1UWxeQ8SueQaybeO23mnQOMp1MLqdX/VHVeXVqT3r4bhm7i1/FN/ q4/+NpkptL9ZtyvQanQOllebt4XmVeEVLZdI5cVvvZC4NKBmyp9nPePIZVyZm3gODzZ1 2d8F5KHu7uS7/EkeO/H50x61qJku7KuFSX3mZAM/xsQizUGy2D4i9g1RzVzgwyQApqq3 qpzNlLmnt5XUhn8wRIq3pWTekzFiPWAf0h8ITZJiRleI+xu7v9slfJOuIFvNlHfmV3KB Vb0wktgwjGD6QUqYqmzAuBLLlyyCk8i6ktWauGnhkTzrtaxAzESts+j4GTcNpT3ntrOA +6/w== X-Gm-Message-State: ACrzQf1+owx/Saj5fiOPlRxAiT4VS6yTogEVJVLSMLM7yh08CNRjQEvQ QsPPt+2cjL/v8KDoJvwN1QptrMhfJ9eWN69eXR1KzqdJ X-Received: by 2002:a50:eb05:0:b0:457:c6f5:5f65 with SMTP id y5-20020a50eb05000000b00457c6f55f65mr9082580edp.311.1664571314648; Fri, 30 Sep 2022 13:55:14 -0700 (PDT) MIME-Version: 1.0 References: <1664277676-2228-1-git-send-email-wangyufen@huawei.com> In-Reply-To: <1664277676-2228-1-git-send-email-wangyufen@huawei.com> From: Andrii Nakryiko Date: Fri, 30 Sep 2022 13:55:02 -0700 Message-ID: Subject: Re: [bpf-next v7 1/3] bpftool: Add auto_attach for bpf prog load|loadall To: Wang Yufen Cc: quentin@isovalent.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, davem@davemloft.net, kuba@kernel.org, hawk@kernel.org, nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 27, 2022 at 4:00 AM Wang Yufen wrote: > > Add auto_attach optional to support one-step load-attach-pin_link. > > For example, > $ bpftool prog loadall test.o /sys/fs/bpf/test autoattach > > $ bpftool link > 26: tracing name test1 tag f0da7d0058c00236 gpl > loaded_at 2022-09-09T21:39:49+0800 uid 0 > xlated 88B jited 55B memlock 4096B map_ids 3 > btf_id 55 > 28: kprobe name test3 tag 002ef1bef0723833 gpl > loaded_at 2022-09-09T21:39:49+0800 uid 0 > xlated 88B jited 56B memlock 4096B map_ids 3 > btf_id 55 > 57: tracepoint name oncpu tag 7aa55dfbdcb78941 gpl > loaded_at 2022-09-09T21:41:32+0800 uid 0 > xlated 456B jited 265B memlock 4096B map_ids 17,13,14,15 > btf_id 82 > > $ bpftool link > 1: tracing prog 26 > prog_type tracing attach_type trace_fentry > 3: perf_event prog 28 > 10: perf_event prog 57 > > The autoattach optional can support tracepoints, k(ret)probes, > u(ret)probes. > > Signed-off-by: Wei Yongjun > Signed-off-by: Wang Yufen > --- For next revision, please also attach cover letter describing the overall goal of the patch set (and that's where the version log between revisions is put as well). > v6 -> v7: add info msg print and update doc for the skip program > v5 -> v6: skip the programs not supporting auto-attach, > and change optional name from "auto_attach" to "autoattach" > v4 -> v5: some formatting nits of doc > v3 -> v4: rename functions, update doc, bash and do_help() > v2 -> v3: switch to extend prog load command instead of extend perf > v2: https://patchwork.kernel.org/project/netdevbpf/patch/20220824033837.458197-1-weiyongjun1@huawei.com/ > v1: https://patchwork.kernel.org/project/netdevbpf/patch/20220816151725.153343-1-weiyongjun1@huawei.com/ > tools/bpf/bpftool/prog.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 79 insertions(+), 2 deletions(-) > [...]