Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp405284pxa; Thu, 27 Aug 2020 05:51:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw/qLF53LENHYvrTj80L4y/bPA1lREh9eiv60rClCgTtfpPtLQXoAeYmwBL6XkWndqhV5f X-Received: by 2002:a17:906:4c97:: with SMTP id q23mr21607757eju.11.1598532663825; Thu, 27 Aug 2020 05:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598532663; cv=none; d=google.com; s=arc-20160816; b=FpExg/kv6lbjLTqcSWCJ7EqsxfxMlRDzpqf4KfHtAbp8kGm1AJxsj4gUpzn4ofpYO2 vg0VARzCmucWsY0DKQHb8qmP2ozzBXwi93UkQKQUke4240nj+8q2Fcb9y9Bsmi5Jxmkl /kdturVsvLqWg6zX9Y/2l+Ey7yB7Blfcsc0gej/Bm/EZspnn8KW50K5ImKUSnAZADJWp vzf3CilaXLCoWIAlQQDMRkvMu8w+yTAIUEP0gfgz6ZgQv18DCRVpxQfBW3hICxzog2cS WvYIfCRAfAOYySKCo0Q+Mdepp1FkUGcc+YUfzF8OSmFqk+fFKcORcZPWFCE6gtTWqQwR CD9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=vr70ALb4ZjXi9RcX6VvF0ywgFtWFCx5BiJCk7jKQduQ=; b=PkfIQDbsd0RzlHLU3ua25nhfcGU2wyKXc2ocPYeKAXtDa4ZU4V4ibBmE4eCeJohgHd d5hWA+aWoTonHskxH62Q8dT+B37/sT1oclY96htU4Dl4r0PsKaPZMNvn3DaPJkr9D1k8 M/BENS/VZhK8f6dbuCWAaTsBAj/1e+v/6ZkfYTOhFIbGTimsND20p/hwuGwtffSyO6pk B/7/3LhJwUStY3nxnaFMKZOG3oScd0UsPP/vQkyTNPMIYnCXlFdhSHI9T7jTqV1VBsy9 CdVjd8ltFZhBsxJdOqMvwx4pZVM5mHfm0zbGIoIXVfmv3O0FEUtuQti9iWJLso99UDP7 GVeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SyCN2jiY; 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 z1si1308444eji.189.2020.08.27.05.50.40; Thu, 27 Aug 2020 05:51:03 -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=SyCN2jiY; 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 S1729196AbgH0MtS (ORCPT + 99 others); Thu, 27 Aug 2020 08:49:18 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52201 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729081AbgH0MpT (ORCPT ); Thu, 27 Aug 2020 08:45:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598532298; 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: in-reply-to:in-reply-to:references:references; bh=vr70ALb4ZjXi9RcX6VvF0ywgFtWFCx5BiJCk7jKQduQ=; b=SyCN2jiY0B1vdI+qj67hIl5j3rii7pyAww9u2dXqQmmwmbMtd+skZYQj94iRfvIIqzOB7M NYgc5QYU7afzUbR1Hsq5Ye7R4SLRAXCOMXlklJ53jLwdn6xQWvwctOVJv8PLWSX9MFoB3C TgHd6bYJj13H7/7rhZenGiWYuBK7D0w= 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-106-rgIfL0zhNvOAoxeX1uhPyQ-1; Thu, 27 Aug 2020 08:44:54 -0400 X-MC-Unique: rgIfL0zhNvOAoxeX1uhPyQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 02A7C420E7; Thu, 27 Aug 2020 12:44:53 +0000 (UTC) Received: from krava (unknown [10.40.195.119]) by smtp.corp.redhat.com (Postfix) with SMTP id 94EEB19936; Thu, 27 Aug 2020 12:44:48 +0000 (UTC) Date: Thu, 27 Aug 2020 14:44:47 +0200 From: Jiri Olsa To: Jesper Dangaard Brouer Cc: Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Jiri Olsa , bpf@vger.kernel.org Subject: Re: [PATCH] tools build feature: cleanup feature files on make clean Message-ID: <20200827124447.GA77089@krava> References: <159851841661.1072907.13770213104521805592.stgit@firesoul> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <159851841661.1072907.13770213104521805592.stgit@firesoul> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 10:53:36AM +0200, Jesper Dangaard Brouer wrote: > 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/ sry, I forgot about this one.. the change looks good to me Acked-by: Jiri Olsa thanks, jirka > > 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) \ > >