Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1003955imw; Wed, 13 Jul 2022 11:59:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uyeAlen4KpRj8JCScWnGYnoCcidDddQs2ZBJpv2xyg+NKbQ1+XHqM79tG1X4E1vSXnM0ZF X-Received: by 2002:a17:90b:3b43:b0:1ef:d89b:3454 with SMTP id ot3-20020a17090b3b4300b001efd89b3454mr11634151pjb.87.1657738788978; Wed, 13 Jul 2022 11:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657738788; cv=none; d=google.com; s=arc-20160816; b=BlqxLHoIinA0vB6XhWQnTykqPlAJj1DNI9thUKDsuenYYyW32wFUYgEVHu3Gy4CFcx SZfGLStkZgsv+4tdaskDps7tYyoGu80PyCgCrmczMdDEd/uiCxl7/J+Bvp88ag8+52wi DqGS39SN7c2nLvAymcc9QsIok63sez/3j2WVK4AxoHGBXMp+U58pm6fDCplLL2w4pme5 keVdycvk8O2rKZhg5nZemGQIwVSEsYuzdWcxUXdZ2zrc3KYj7K9JZt5gWCBCISfK7qA/ R4M8JdFkKay6MtWCgVWrevvv4d7aQzhTKNYpGCxK9bAdagHvm9cimsACcAVXvR6HnUVb Xo/A== 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=0bgHp5GltHRu7x3p+LHbRBECphkMhi0jBJngyJToasY=; b=AjhDT596cX8OHUv2fw02w7rqsNq8RkT2f6Jrr6zWRnDrYPSO/XghFwPPoYVRdEFh6z 7dDUompIaFnHUEtE3kbyHpizOoQQpHS9269m62FwBTQjbITjI6lxKq+sf6PuLyeV1Rnc gC7npixNrxLYaM4snO4bnXwPMTae+lkil0gANWONXrZpYK+XJ+C2RojBm3R20hxbdNrC J5iKR8gyoHxbtd7InkwJwnVEHMK3QLznrUSUJHtBViaAwEL/GOGL0uoHFODVYxtDIzBP EgLd0mfrmHKyOHtGXJrBmfE7QXMYAqpwRxEwaBkhjr3x36URgR38ubAGS1kwMaPPXv/L YBhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ggeRot3B; 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 k3-20020a056a00134300b0052ac34848fesi16980127pfu.246.2022.07.13.11.59.33; Wed, 13 Jul 2022 11:59:48 -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=ggeRot3B; 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 S236437AbiGMSw7 (ORCPT + 99 others); Wed, 13 Jul 2022 14:52:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbiGMSw6 (ORCPT ); Wed, 13 Jul 2022 14:52:58 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 659942F3A0; Wed, 13 Jul 2022 11:52:57 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id t1so5705661ejd.12; Wed, 13 Jul 2022 11:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0bgHp5GltHRu7x3p+LHbRBECphkMhi0jBJngyJToasY=; b=ggeRot3BOwOSl6Mix3mhgE0RWM1j+eok5TQUCCvO2pl1qahgQfGis8fK7xZfEaTeDH Zs5nP1MYEVbRDq8lGMoPyePwI0NAbgiJrzdg6JIcl/HEA48Iy8wrD5QwdwXPu7WRi12R 0/OKJn5Ljk3YKjjRHvfbPFqSR588dpz/rALG/feCNsxYN9bbFaWY/ijwNh4jBvbh3Uv8 APUJr68H6KEPp5i6kWGkJfg8RxaxXsZ5L8wt/QffrHhLoVvWx/3dVpgieAsYNRxpdCL1 sKrgjs54Rq5GOLXGlEioSuFlL4iDL3Oh3DyfQnrLsfq2Cjl9dotmGw/8aGEIZRL8jzCX Q6Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0bgHp5GltHRu7x3p+LHbRBECphkMhi0jBJngyJToasY=; b=w1sIrMBPGYOUVX4rOpdPZybzulYQty8cb5Wx+sV8T1iZ7QQb7bt/NHtdoGv7HvdoUW mhMKQ7QsG9S1FGdfoOANzJ4iF/9Eeb+45T8n3FfzSkwso8yfh5oRP8sVoOZ0Eu6mY6Xw zs9PKGbe0cINhxRaaPtrCYcI/NZAnoBi7oHfxJ0Y7JQZWywqJngmLp8dcSWSGyjycyz/ +tONMRDwSzAr3h+U6s2iOQ3d/5d2dZH1+1dKWTyD68Kiiplg1wFOVrKzdw5GCbqPJVQb WGWYyQ1Bc+5p4T4UZIB6rm5V2z9sqmUFGlPib4fKPXiXzol9yZYpgiIxkGZpBiC/nfAa 90GQ== X-Gm-Message-State: AJIora+4No9VWWHOCB8SdA/qN69z0gMM2EyfnWmb6Id5su0X/wqeQaAn kqy718NSbxyWx0xPwAyYugf/wOo6tYCflZMXkvQ= X-Received: by 2002:a17:906:cc0c:b0:72b:68df:8aff with SMTP id ml12-20020a170906cc0c00b0072b68df8affmr4921265ejb.226.1657738376004; Wed, 13 Jul 2022 11:52:56 -0700 (PDT) MIME-Version: 1.0 References: <20220712030813.865410-1-pulehui@huawei.com> <20220712030813.865410-3-pulehui@huawei.com> In-Reply-To: <20220712030813.865410-3-pulehui@huawei.com> From: Andrii Nakryiko Date: Wed, 13 Jul 2022 11:52:44 -0700 Message-ID: Subject: Re: [PATCH bpf-next 2/3] tools: runqslower: build and use lightweight bootstrap version of bpftool To: Pu Lehui Cc: bpf , Networking , open list , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Quentin Monnet , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Jean-Philippe Brucker 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,T_SCC_BODY_TEXT_LINE 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 Mon, Jul 11, 2022 at 7:37 PM Pu Lehui wrote: > > tools/runqslower use bpftool for vmlinux.h, skeleton, and static linking > only. So we can use lightweight bootstrap version of bpftool to handle > these, and it will be faster. > > Signed-off-by: Pu Lehui > Suggested-by: Andrii Nakryiko > --- > tools/bpf/runqslower/Makefile | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile > index da6de16a3dfb..8900c74f29e2 100644 > --- a/tools/bpf/runqslower/Makefile > +++ b/tools/bpf/runqslower/Makefile > @@ -4,7 +4,7 @@ include ../../scripts/Makefile.include > OUTPUT ?= $(abspath .output)/ > > BPFTOOL_OUTPUT := $(OUTPUT)bpftool/ > -DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)bpftool > +DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)bootstrap/bpftool > BPFTOOL ?= $(DEFAULT_BPFTOOL) > LIBBPF_SRC := $(abspath ../../lib/bpf) > BPFOBJ_OUTPUT := $(OUTPUT)libbpf/ > @@ -86,6 +86,12 @@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(BPFOBJ_OU > $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(BPFOBJ_OUTPUT) \ > DESTDIR=$(BPFOBJ_OUTPUT) prefix= $(abspath $@) install_headers > > +ifeq ($(CROSS_COMPILE),) > $(DEFAULT_BPFTOOL): $(BPFOBJ) | $(BPFTOOL_OUTPUT) > $(Q)$(MAKE) $(submake_extras) -C ../bpftool OUTPUT=$(BPFTOOL_OUTPUT) \ > - ARCH= CROSS_COMPILE= CC=$(HOSTCC) LD=$(HOSTLD) > + LIBBPF_BOOTSTRAP_OUTPUT=$(BPFOBJ_OUTPUT) \ > + LIBBPF_BOOTSTRAP_DESTDIR=$(BPF_DESTDIR) bootstrap > +else > +$(DEFAULT_BPFTOOL): | $(BPFTOOL_OUTPUT) > + $(Q)$(MAKE) $(submake_extras) -C ../bpftool OUTPUT=$(BPFTOOL_OUTPUT) bootstrap > +endif Same comment as on the other patch, this CROSS_COMPILE if/else seems a bit fragile, let's keep only the second cleaner part, maybe? > -- > 2.25.1 >