Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp12051329rwb; Sat, 26 Nov 2022 03:48:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf6dEOuEi/pW7CHtZKmFtwRniWRams1rYZ0QBgBDIwinl/84t1ArMYddujKFfizPj0jVpsBn X-Received: by 2002:aa7:8d5a:0:b0:562:7f16:7407 with SMTP id s26-20020aa78d5a000000b005627f167407mr45297645pfe.15.1669463282538; Sat, 26 Nov 2022 03:48:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669463282; cv=none; d=google.com; s=arc-20160816; b=SeuQ1FrJnAIoGu/51bvSsCFvK4KH0CkwVFCa5GT9sgDk5Wa0fUQiIPwyyxG6P2qqlZ ET/bC6RLXInAxx3ZtjfQO0pYlKDcNYw1CN9sPovuzqVrwceUAnOecqOehuLIXI4zNvxW ETPnktC7UohUrDjDdInObyHyKm6LmidKKPLgE10Zkgi7xl1DmIR36JZDXPbc/bzy723f DZQjUEhrul2I/11feiX13SEAtlq/P9h5ElGyKHybQ0D11d1sKCPtPTEW1+Di8kw+lrGe 3/kXXgEbSp7PJCYzS8P5uxZ5/BzOvtLq0cF45Y5JuwgsVbWA/0PZLUXVfyJtM+V2bwgi rxdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7wXxHwlliB9k9y/zRVSVfdaJjEK9h41TVLmU74Ql4mM=; b=N7P005BkQN6eV5l7DPOggXiSwI3qINs8YWzYrFjej8jmRhfmyN/ScymB0JKwk6+mmj dYUCYtYR2kQ+c3lSuThMewHSXnxeyTqHlRr/Tjqjhn3wbPDcaghlqquKzH7U1oVtNEFL 1sys3SFy/Ackfnuxlqtfy6gFQcJ0Feven2BGnyRG+yCeLQdKwomHWrqnBKVl4KV01V9v GaRAQiqrMK1X5s+ZyvBuNP9VpcC6Oh+f6IQ5PTSpL/nJ1d4oZoiw+syP6qlYiX3o+i6W desh3zhcbnFq/AsxVzBRwc9HVB/oO4xadB0YdKZACZsLVj8TO/5GwRyKibkoNw94aY5F qdkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Az5eaU6y; 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 pj3-20020a17090b4f4300b001ed40b70436si7072336pjb.155.2022.11.26.03.47.51; Sat, 26 Nov 2022 03:48:02 -0800 (PST) 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=Az5eaU6y; 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 S229475AbiKZLOF (ORCPT + 84 others); Sat, 26 Nov 2022 06:14:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbiKZLNr (ORCPT ); Sat, 26 Nov 2022 06:13:47 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 029291B1DA; Sat, 26 Nov 2022 03:13:46 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id mv18so5591802pjb.0; Sat, 26 Nov 2022 03:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7wXxHwlliB9k9y/zRVSVfdaJjEK9h41TVLmU74Ql4mM=; b=Az5eaU6yt/A/9EC16A5mgH5D+UhNxILaYesE0vaILZ41HUY0H0EcrKI190CwWnHlva EXRB9mqds4P/vTNnGQg7YIWQHGxxy4rLja4l7HFjLh+xPTQmDug3UqLnYCBSwRb4OnFR td+HpnkaCwdIwsKLWuIDT/+/983Dja5Dnkjcwn7l69ufK4v3lQ9eRyxXcBvE+vG0o2ZU B7pUk+wC4UHYJrw71hTnsZKRWdr/UfG0sCH8mKtMm9i41WM05y5xUGmMbxlMFniZrXQn 82gU94ss0lWMN2ElU1tahDVhU4fILxrUBPUEiuptI3nsv+xUeD4LabOjkE9mzsmXxY+4 CnLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7wXxHwlliB9k9y/zRVSVfdaJjEK9h41TVLmU74Ql4mM=; b=ETisHak7yZaVwnFqdzUePVIlflzx4x7UMke0HbXSVogI1L2KtdZQT6FHME3FHS4uRo 3TZreymeCJ4zmjd+GOGfCcdFWuGLP600fvY0enFlzmOcB7vJu4KNExUu5rxXzj7E/uWv mXgqQNhp9amsbcMBf0OmqO2p+4Sr49BKZavHiuXFCv99oTOSVFOHDBx5bvqnFj4u3Z58 43rV4l+gCYL9me8LUr+OJrNN1ZJaIsgHqh28LH21AGGs5c8WLuILS1qGHbN5QFFmVv+J rl8PDf1AuNOpADIdpHt2YL01Mn8wTi5seiuNxKMhhx/dN7Of9m3MMwDaziG9FRoyonhl JJUg== X-Gm-Message-State: ANoB5pm2juBX3egqsvGAvH4o1lKdCEXE9vcfCD/vQTirfPEMKs4C6OWa ropDKkJh8Z2x+sUfLGxjDTo= X-Received: by 2002:a17:902:e807:b0:186:fb90:5774 with SMTP id u7-20020a170902e80700b00186fb905774mr23432978plg.137.1669461225418; Sat, 26 Nov 2022 03:13:45 -0800 (PST) Received: from WRT-WX9.. ([103.135.102.183]) by smtp.gmail.com with ESMTPSA id c194-20020a621ccb000000b0056a93838606sm4555639pfc.58.2022.11.26.03.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Nov 2022 03:13:44 -0800 (PST) From: Changbin Du To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Quentin Monnet , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Shuah Khan Cc: Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , Alexander Shishkin , Namhyung Kim , Mykola Lysenko , linux-perf-users@vger.kernel.org, linux-kselftest@vger.kernel.org, Changbin Du Subject: [PATCH 2/2] makefiles: do not generate empty vmlinux.h Date: Sat, 26 Nov 2022 19:11:47 +0800 Message-Id: <20221126111147.199366-3-changbin.du@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221126111147.199366-1-changbin.du@gmail.com> References: <20221126111147.199366-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 Remove the empty vmlinux.h if bpftool failed to dump btf info. The emptry vmlinux.h can hide real error when reading output of make. Signed-off-by: Changbin Du --- samples/bpf/Makefile | 2 +- tools/bpf/bpftool/Makefile | 2 +- tools/bpf/runqslower/Makefile | 2 +- tools/perf/Makefile.perf | 2 +- tools/testing/selftests/bpf/Makefile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 727da3c5879b..ab4788b4883e 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -362,7 +362,7 @@ ifeq ($(VMLINUX_BTF),) $(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)",\ build the kernel or set VMLINUX_BTF or VMLINUX_H variable) endif - $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@ + $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@ || { rm $@; exit 1; } else $(Q)cp "$(VMLINUX_H)" $@ endif diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 4a95c017ad4c..d9d6f890884c 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -177,7 +177,7 @@ BUILD_BPF_SKELS := 1 $(OUTPUT)vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL_BOOTSTRAP) ifeq ($(VMLINUX_H),) - $(QUIET_GEN)$(BPFTOOL_BOOTSTRAP) btf dump file $< format c > $@ + $(QUIET_GEN)$(BPFTOOL_BOOTSTRAP) btf dump file $< format c > $@ || { rm $@; exit 1; } else $(Q)cp "$(VMLINUX_H)" $@ endif diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile index 8b3d87b82b7a..2d7911f4666b 100644 --- a/tools/bpf/runqslower/Makefile +++ b/tools/bpf/runqslower/Makefile @@ -77,7 +77,7 @@ ifeq ($(VMLINUX_H),) "specify its location." >&2; \ exit 1;\ fi - $(QUIET_GEN)$(BPFTOOL) btf dump file $(VMLINUX_BTF_PATH) format c > $@ + $(QUIET_GEN)$(BPFTOOL) btf dump file $(VMLINUX_BTF_PATH) format c > $@ || { rm $@; exit 1; } else $(Q)cp "$(VMLINUX_H)" $@ endif diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index a432e59afc42..0546d408aa4e 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -1064,7 +1064,7 @@ VMLINUX_BTF ?= $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS)))) $(SKEL_OUT)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) ifeq ($(VMLINUX_H),) - $(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@ + $(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@ || { rm $@; exit 1; } else $(Q)cp "$(VMLINUX_H)" $@ endif diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index e6cf21fad69f..9aa2475b4ac6 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -284,7 +284,7 @@ endif $(INCLUDE_DIR)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) | $(INCLUDE_DIR) ifeq ($(VMLINUX_H),) $(call msg,GEN,,$@) - $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@ + $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@ || { rm $@; exit 1; } else $(call msg,CP,,$@) $(Q)cp "$(VMLINUX_H)" $@ -- 2.37.2