Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp278759pxa; Thu, 27 Aug 2020 01:56:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymZpWhV3tnNpPVmu87THI6lAFnm7qZlLgyy/1ehgoi8FaLfB00KMKnSNN+y1eysLjUj6rp X-Received: by 2002:a50:eb99:: with SMTP id y25mr18348410edr.250.1598518615282; Thu, 27 Aug 2020 01:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598518615; cv=none; d=google.com; s=arc-20160816; b=dfpFBTCrEGzKgvjk2HrT43if9cYI7yNvlR3lXYX7BNo8oqfYQrumox+lppuPLbbQD3 h0eprK4uK7x2oGb1jiBzE3AHmlqa8+4OtF0aMhWSsu3Uy4tIif3VD4j8MLwN5n4rEpwX S/hj7KWtwSZcOFspyw5oyQjGlOkHz7gUcv8kVvN6VkVP2pF65hNT0Aw0ZRTemr0/PLNe 2aIKoH2Tgq8TGEQn2mvb/44EWytOsGUWzoPtG91kV+3TwqU/Z17y6MVpUxOoREiIR6gW mlKRiRHPKSG11XzgoXk71shHkoaNOMeNbEMoLIg7XDyZv+AdBS5xD4X+A8OdapxJdfCu YeAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=RrMwwJkiIN6IE4DKC1Do1r49qx7TdOB11Zk1v1eRJzw=; b=FlMDtNElfIxB3E6bAeqByGhbsmVOpfod0A+LLmt/zn5tJ2S+t8AgMkLkhrlGMe3VIC iK31/YVyMINmvK69OGrovVqsIe9up6brCTBewV99JTh+vnMQFvCTf/OYC//NgGvzoUAp LQEJHucTK6EFqP617qXn4YaugBWKuEH+2py3Ce6Y2SJr43DP/hXVN/TJU+3Z4TSJcH0r IXLqaFY1A4+m4eSvcrun8Tyweac55v1ybKLtwH5WwCO748vHvwIsF/mGDpP50hlZp9aR tHQQoSWSrJt0bBpmTq+Yt6PG08x7ZENdt9T3nuBl/fdWicSy3gEoKP4LENlGMmjN+y2i NrhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ROARXQDZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx20si892587ejb.132.2020.08.27.01.56.32; Thu, 27 Aug 2020 01:56:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ROARXQDZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727970AbgH0Ixs (ORCPT + 99 others); Thu, 27 Aug 2020 04:53:48 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:44711 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726851AbgH0Ixp (ORCPT ); Thu, 27 Aug 2020 04:53:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598518423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RrMwwJkiIN6IE4DKC1Do1r49qx7TdOB11Zk1v1eRJzw=; b=ROARXQDZLVEYPhCBxvnfBjuzwFO6A0J3B4DJjbOvE6hzdSH0Ao9rqcEV09llnNO/VNLOjd gedk2pXdFWOxoM/44nb8hfDUd/HGlGeCT6bjYaqZOSWMxTDeJZmZmEan1L0PFCGlRB9slY 7OlYa5joLdm4Nyi73hvwbDVbL2zpSf0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-541-k-L04AzZPEukU3yiqK1pgg-1; Thu, 27 Aug 2020 04:53:41 -0400 X-MC-Unique: k-L04AzZPEukU3yiqK1pgg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF0AF185FD6C; Thu, 27 Aug 2020 08:53:40 +0000 (UTC) Received: from firesoul.localdomain (unknown [10.40.208.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4C347B9F2; Thu, 27 Aug 2020 08:53:37 +0000 (UTC) Received: from [192.168.42.3] (localhost [IPv6:::1]) by firesoul.localdomain (Postfix) with ESMTP id B205C30736C8B; Thu, 27 Aug 2020 10:53:36 +0200 (CEST) Subject: [PATCH] tools build feature: cleanup feature files on make clean From: Jesper Dangaard Brouer To: Jesper Dangaard Brouer , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org Cc: Jiri Olsa , bpf@vger.kernel.org Date: Thu, 27 Aug 2020 10:53:36 +0200 Message-ID: <159851841661.1072907.13770213104521805592.stgit@firesoul> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The system for "Auto-detecting system features" located under tools/build/ are (currently) used by perf, libbpf and bpftool. It can contain stalled feature detection files, which are not cleaned up by libbpf and bpftool on make clean (side-note: perf tool is correct). Fix this by making the users invoke the make clean target. Some details about the changes. The libbpf Makefile already had a clean-config target (which seems to be copy-pasted from perf), but this target was not "connected" (a make dependency) to clean target. Choose not to rename target as someone might be using it. Did change the output from "CLEAN config" to "CLEAN feature-detect", to make it more clear what happens. This is related to the complaint and troubleshooting in link: Link: https://lore.kernel.org/lkml/20200818122007.2d1cfe2d@carbon/ Signed-off-by: Jesper Dangaard Brouer --- tools/build/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile index 8462690a039b..02c99bc95c69 100644 --- a/tools/bpf/bpftool/Makefile +++ b/tools/bpf/bpftool/Makefile @@ -176,7 +176,11 @@ $(OUTPUT)bpftool: $(OBJS) $(LIBBPF) $(OUTPUT)%.o: %.c $(QUIET_CC)$(CC) $(CFLAGS) -c -MMD -o $@ $< -clean: $(LIBBPF)-clean +feature-detect-clean: + $(call QUIET_CLEAN, feature-detect) + $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null + +clean: $(LIBBPF)-clean feature-detect-clean $(call QUIET_CLEAN, bpftool) $(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d $(Q)$(RM) -- $(BPFTOOL_BOOTSTRAP) $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h diff --git a/tools/build/Makefile b/tools/build/Makefile index 727050c40f09..722f1700d96a 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -38,6 +38,8 @@ clean: $(call QUIET_CLEAN, fixdep) $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete $(Q)rm -f $(OUTPUT)fixdep + $(call QUIET_CLEAN, feature-detect) + $(Q)$(MAKE) -C feature/ clean >/dev/null $(OUTPUT)fixdep-in.o: FORCE $(Q)$(MAKE) $(build)=fixdep diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index bf8ed134cb8a..bbb89551468a 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -269,10 +269,10 @@ install: install_lib install_pkgconfig install_headers ### Cleaning rules config-clean: - $(call QUIET_CLEAN, config) + $(call QUIET_CLEAN, feature-detect) $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null -clean: +clean: config-clean $(call QUIET_CLEAN, libbpf) $(RM) -rf $(CMD_TARGETS) \ *~ .*.d .*.cmd LIBBPF-CFLAGS $(BPF_HELPER_DEFS) \ $(SHARED_OBJDIR) $(STATIC_OBJDIR) \