From patchwork Fri Dec 17 00:42:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12683293 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3FDBC433EF for ; Fri, 17 Dec 2021 00:42:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230166AbhLQAmS (ORCPT ); Thu, 16 Dec 2021 19:42:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbhLQAmR (ORCPT ); Thu, 16 Dec 2021 19:42:17 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5463C061574 for ; Thu, 16 Dec 2021 16:42:17 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3D0FF61EDB for ; Fri, 17 Dec 2021 00:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6585C36AE8; Fri, 17 Dec 2021 00:42:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.95) (envelope-from ) id 1my1KB-0004Cu-OV; Thu, 16 Dec 2021 19:42:15 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: "Steven Rostedt (VMware)" Subject: [PATCH 1/9] libtracefs: Remove unused "bindir" from Makefile Date: Thu, 16 Dec 2021 19:42:06 -0500 Message-Id: <20211217004214.16074-2-rostedt@goodmis.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org> References: <20211217004214.16074-1-rostedt@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" It appears the the bindir variables are not used to build or install the library. Remove them from the Makefile as they just add unnecessary noise. Signed-off-by: Steven Rostedt (VMware) --- Makefile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 85b3c39a867c..8ee80097d77f 100644 --- a/Makefile +++ b/Makefile @@ -52,8 +52,6 @@ endif libdir_relative ?= $(libdir_relative_temp) prefix ?= /usr/local -bindir_relative = bin -bindir = $(prefix)/$(bindir_relative) man_dir = $(prefix)/share/man man_dir_SQ = '$(subst ','\'',$(man_dir))' libdir = $(prefix)/$(libdir_relative) @@ -82,10 +80,6 @@ export man_dir man_dir_SQ html_install html_install_SQ INSTALL export img_install img_install_SQ export DESTDIR DESTDIR_SQ -# Shell quotes -bindir_SQ = $(subst ','\'',$(bindir)) -bindir_relative_SQ = $(subst ','\'',$(bindir_relative)) - pound := \# HELP_DIR = -DHELP_DIR=$(html_install) @@ -130,7 +124,7 @@ src := $(srctree) obj := $(objtree) bdir := $(obj)/lib/tracefs -export prefix bindir src obj bdir +export prefix src obj bdir LIBTRACEFS_STATIC = $(bdir)/libtracefs.a LIBTRACEFS_SHARED = $(bdir)/libtracefs.so.$(TRACEFS_VERSION) From patchwork Fri Dec 17 00:42:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12683289 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56EA6C433F5 for ; Fri, 17 Dec 2021 00:42:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230143AbhLQAmR (ORCPT ); Thu, 16 Dec 2021 19:42:17 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:55910 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbhLQAmR (ORCPT ); Thu, 16 Dec 2021 19:42:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4693961FE0 for ; Fri, 17 Dec 2021 00:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2AA2C36AEA; Fri, 17 Dec 2021 00:42:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.95) (envelope-from ) id 1my1KB-0004Cx-P8; Thu, 16 Dec 2021 19:42:15 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: "Steven Rostedt (VMware)" Subject: [PATCH 2/9] libtracefs: Remove unneeded blkflags from Makefile Date: Thu, 16 Dec 2021 19:42:07 -0500 Message-Id: <20211217004214.16074-3-rostedt@goodmis.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org> References: <20211217004214.16074-1-rostedt@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" The blkflags were leftover from copying from trace-cmd for handling the blk tracer. They are not needed for the libtracefs library. Remove them. Signed-off-by: Steven Rostedt (VMware) --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index 8ee80097d77f..096f35d2c4a1 100644 --- a/Makefile +++ b/Makefile @@ -104,9 +104,6 @@ SILENT := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),1) test-build = $(if $(shell sh -c 'echo "$(1)" | \ $(CC) -o /dev/null -c -x c - > /dev/null 2>&1 && echo y'), $2) -# have flush/fua block layer instead of barriers? -blk-flags := $(call test-build,$(BLK_TC_FLUSH_SOURCE),-DHAVE_BLK_TC_FLUSH) - ifeq ("$(origin O)", "command line") saved-output := $(O) From patchwork Fri Dec 17 00:42:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12683295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10005C4332F for ; Fri, 17 Dec 2021 00:42:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbhLQAmS (ORCPT ); Thu, 16 Dec 2021 19:42:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229863AbhLQAmR (ORCPT ); Thu, 16 Dec 2021 19:42:17 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5736C06173F for ; Thu, 16 Dec 2021 16:42:17 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 43EB661FDD for ; Fri, 17 Dec 2021 00:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD6D6C36AE5; Fri, 17 Dec 2021 00:42:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.95) (envelope-from ) id 1my1KB-0004D0-Pl; Thu, 16 Dec 2021 19:42:15 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: "Steven Rostedt (VMware)" Subject: [PATCH 3/9] libtracefs: Fix sample intermediate build targets Date: Thu, 16 Dec 2021 19:42:08 -0500 Message-Id: <20211217004214.16074-4-rostedt@goodmis.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org> References: <20211217004214.16074-1-rostedt@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" The target for compiling from *.c to *.o in the samples directory had: $(bdir)/%.o: %.c But since the *.c files were extracted, they already included the $(bdir) in the name, so the above was really matching: $(bdir)/$(bdir)/*.c and not being used. Remove the extra $(bdir) from the target. This also exposed a bug that $(CFLAGS) was not included, and the stream.c failed to build because of the lacking -D_GNU_SOURCE. Signed-off-by: Steven Rostedt (VMware) --- samples/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/Makefile b/samples/Makefile index 6ee57fecacbd..2d0d2397c5b4 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -60,10 +60,10 @@ $(EXAMPLES): $(patsubst %,$(bdir)/%,$(TARGETS)) ## name, and the file will not be discarded by make. # # $(bdir)/XX.o: $(bdir)/XX.c -# $(CC) -g -Wall -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES) +# $(CC) -g -Wall $(CFLAGS) -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES) -$(bdir)/%.o: %.c - $(CC) -g -Wall -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES) +%.o: %.c + $(CC) -g -Wall $(CFLAGS) -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES) clean: $(RM) $(bdir)/* From patchwork Fri Dec 17 00:42:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12683301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 710BEC43219 for ; Fri, 17 Dec 2021 00:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbhLQAmV (ORCPT ); Thu, 16 Dec 2021 19:42:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230199AbhLQAmU (ORCPT ); Thu, 16 Dec 2021 19:42:20 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5733FC061574 for ; Thu, 16 Dec 2021 16:42:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CC7AFB8264B for ; Fri, 17 Dec 2021 00:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8133C36AE9; Fri, 17 Dec 2021 00:42:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.95) (envelope-from ) id 1my1KB-0004D3-QS; Thu, 16 Dec 2021 19:42:15 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: "Steven Rostedt (VMware)" Subject: [PATCH 4/9] libtracefs: Add "DESCEND" output when descending into directories during build Date: Thu, 16 Dec 2021 19:42:09 -0500 Message-Id: <20211217004214.16074-5-rostedt@goodmis.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org> References: <20211217004214.16074-1-rostedt@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" Copy from the Linux kernel a "DESCEND" output when descending into a directory during the build. This makes the output of the build a little more informative knowing what directory the build is currently in. Also add the target and not just the directory, as the build will descend into the src directory twice with different targets, and just showing that it goes into the src directory twice looks weird. Signed-off-by: Steven Rostedt (VMware) --- Makefile | 16 ++++++++-------- scripts/utils.mk | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 096f35d2c4a1..7ef85288abf1 100644 --- a/Makefile +++ b/Makefile @@ -182,7 +182,7 @@ test: force $(LIBTRACEFS_STATIC) ifneq ($(CUNIT_INSTALLED),1) $(error CUnit framework not installed, cannot build unit tests)) endif - $(Q)$(MAKE) -C $(src)/$(UTEST_DIR) $@ + $(Q)$(call descend,$(src)/$(UTEST_DIR),$@) test_mem: test ifeq (, $(VALGRIND)) @@ -271,13 +271,13 @@ install_pkgconfig: $(PKG_CONFIG_FILE) $(call do_install_pkgconfig_file,$(prefix)) doc: - $(MAKE) -C $(src)/Documentation all + $(Q)$(call descend,$(src)/Documentation,all) doc_clean: - $(MAKE) -C $(src)/Documentation clean + $(Q)$(call descend,$(src)/Documentation,clean) install_doc: - $(MAKE) -C $(src)/Documentation install + $(Q)$(call descend,$(src)/Documentation,install) define build_uninstall_script $(Q)mkdir $(BUILD_OUTPUT)/tmp_build @@ -350,19 +350,19 @@ $(VERSION_FILE): force $(LIBTRACEFS_STATIC): force $(Q)mkdir -p $(bdir) - $(Q)$(MAKE) -C $(src)/src $@ + $(Q)$(call descend,$(src)/src,$@) $(bdir)/libtracefs.so.$(TRACEFS_VERSION): force $(Q)mkdir -p $(bdir) - $(Q)$(MAKE) -C $(src)/src libtracefs.so + $(Q)$(call descend,$(src)/src,libtracefs.so) samples/sqlhist: $(LIBTRACEFS_STATIC) - $(Q)$(MAKE) -C $(src)/samples sqlhist + $(Q)$(call descend,$(src)/samples,sqlhist) sqlhist: samples/sqlhist samples: $(LIBTRACEFS_STATIC) force - $(Q)$(MAKE) -C $(src)/samples all + $(Q)$(call descend,$(src)/samples,all) clean: $(MAKE) -C $(src)/utest clean diff --git a/scripts/utils.mk b/scripts/utils.mk index 0b3c0675b714..404b929a2b5f 100644 --- a/scripts/utils.mk +++ b/scripts/utils.mk @@ -3,6 +3,8 @@ # Utils GOBJ = $(notdir $(strip $@)) + BASE1 = $(notdir $(strip $1)) + BASE2 = $(notdir $(strip $2)) ifeq ($(VERBOSE),1) @@ -24,6 +26,7 @@ ifeq ($(findstring 1,$(SILENT)$(VERBOSE)),1) print_install = print_uninstall = print_update = + print_descend = else print_compile = echo ' COMPILE '$(GOBJ); print_app_build = echo ' BUILD '$(GOBJ); @@ -35,6 +38,7 @@ else print_install = echo ' INSTALL '$1' to $(DESTDIR_SQ)$2'; print_uninstall = echo ' UNINSTALL $(DESTDIR_SQ)$1'; print_update = echo ' UPDATE '$(GOBJ); + print_descend = echo ' DESCEND '$(BASE1) $(BASE2); endif do_fpic_compile = \ @@ -74,6 +78,22 @@ do_python_plugin_build = \ ($(print_plugin_build) \ $(CC) $< -shared $(LDFLAGS) $(PYTHON_LDFLAGS) -o $@) +ifneq ($(findstring $(MAKEFLAGS), w),w) +PRINT_DIR = --no-print-directory +else +NO_SUBDIR = : +endif + +# +# Define a callable command for descending to a new directory +# +# Call by doing: $(call descend,directory[,target]) +# +descend = \ + ($(print_descend) \ + $(MAKE) $(PRINT_DIR) -C $(1) $(2)) + + define make_version.h (echo '/* This file is automatically generated. Do not modify. */'; \ echo \#define VERSION_CODE $(shell \ From patchwork Fri Dec 17 00:42:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12683297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A53A4C433F5 for ; Fri, 17 Dec 2021 00:42:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230292AbhLQAmU (ORCPT ); Thu, 16 Dec 2021 19:42:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbhLQAmS (ORCPT ); Thu, 16 Dec 2021 19:42:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30F89C061574 for ; Thu, 16 Dec 2021 16:42:18 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C505861FE2 for ; Fri, 17 Dec 2021 00:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5005C36AEB; Fri, 17 Dec 2021 00:42:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.95) (envelope-from ) id 1my1KB-0004D6-R8; Thu, 16 Dec 2021 19:42:15 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: "Steven Rostedt (VMware)" Subject: [PATCH 5/9] libtracefs: Have make clean output cleaner Date: Thu, 16 Dec 2021 19:42:10 -0500 Message-Id: <20211217004214.16074-6-rostedt@goodmis.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org> References: <20211217004214.16074-1-rostedt@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" Instead of showing the files being removed by make clean, just output a command stating what directory the clean is happening in. Signed-off-by: Steven Rostedt (VMware) --- Makefile | 13 +++++++------ samples/Makefile | 2 +- scripts/utils.mk | 8 ++++++++ src/Makefile | 2 +- utest/Makefile | 2 +- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 7ef85288abf1..58b4219e7b62 100644 --- a/Makefile +++ b/Makefile @@ -365,11 +365,12 @@ samples: $(LIBTRACEFS_STATIC) force $(Q)$(call descend,$(src)/samples,all) clean: - $(MAKE) -C $(src)/utest clean - $(MAKE) -C $(src)/src clean - $(MAKE) -C $(src)/samples clean - $(RM) $(TARGETS) $(bdir)/*.a $(bdir)/*.so $(bdir)/*.so.* $(bdir)/*.o $(bdir)/.*.d - $(RM) $(PKG_CONFIG_FILE) - $(RM) $(VERSION_FILE) + $(Q)$(MAKE) -C $(src)/utest clean + $(Q)$(MAKE) -C $(src)/src clean + $(Q)$(MAKE) -C $(src)/samples clean + $(Q)$(call do_clean, \ + $(TARGETS) $(bdir)/*.a $(bdir)/*.so $(bdir)/*.so.* $(bdir)/*.o $(bdir)/.*.d \ + $(PKG_CONFIG_FILE) \ + $(VERSION_FILE)) .PHONY: clean diff --git a/samples/Makefile b/samples/Makefile index 2d0d2397c5b4..8e2b53bbdfae 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -66,4 +66,4 @@ $(EXAMPLES): $(patsubst %,$(bdir)/%,$(TARGETS)) $(CC) -g -Wall $(CFLAGS) -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES) clean: - $(RM) $(bdir)/* + $(Q)$(call do_clean,$(bdir)/*) diff --git a/scripts/utils.mk b/scripts/utils.mk index 404b929a2b5f..c9b908f1c5d9 100644 --- a/scripts/utils.mk +++ b/scripts/utils.mk @@ -2,9 +2,11 @@ # Utils + PWD := $(shell /bin/pwd) GOBJ = $(notdir $(strip $@)) BASE1 = $(notdir $(strip $1)) BASE2 = $(notdir $(strip $2)) + BASEPWD = $(notdir $(strip $(PWD))) ifeq ($(VERBOSE),1) @@ -27,6 +29,7 @@ ifeq ($(findstring 1,$(SILENT)$(VERBOSE)),1) print_uninstall = print_update = print_descend = + print_clean = else print_compile = echo ' COMPILE '$(GOBJ); print_app_build = echo ' BUILD '$(GOBJ); @@ -39,6 +42,7 @@ else print_uninstall = echo ' UNINSTALL $(DESTDIR_SQ)$1'; print_update = echo ' UPDATE '$(GOBJ); print_descend = echo ' DESCEND '$(BASE1) $(BASE2); + print_clean = echo ' CLEAN '$(BASEPWD); endif do_fpic_compile = \ @@ -78,6 +82,10 @@ do_python_plugin_build = \ ($(print_plugin_build) \ $(CC) $< -shared $(LDFLAGS) $(PYTHON_LDFLAGS) -o $@) +do_clean = \ + ($(print_clean) \ + $(RM) $1) + ifneq ($(findstring $(MAKEFLAGS), w),w) PRINT_DIR = --no-print-directory else diff --git a/src/Makefile b/src/Makefile index cda0a0cda6e3..8f258a218f97 100644 --- a/src/Makefile +++ b/src/Makefile @@ -61,7 +61,7 @@ $(OBJS): | $(bdir) $(DEPS): | $(bdir) clean: - $(RM) $(OBJS) + $(Q)$(call do_clean,$(OBJS)) dep_includes := $(wildcard $(DEPS)) diff --git a/utest/Makefile b/utest/Makefile index 48993650660c..d168b01a328c 100644 --- a/utest/Makefile +++ b/utest/Makefile @@ -40,4 +40,4 @@ dep_includes := $(wildcard $(DEPS)) test: $(TARGETS) clean: - $(RM) $(TARGETS) $(bdir)/*.o $(bdir)/.*.d + $(Q)$(call do_clean,$(TARGETS) $(bdir)/*.o $(bdir)/.*.d) From patchwork Fri Dec 17 00:42:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12683305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AE52C4332F for ; Fri, 17 Dec 2021 00:42:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230199AbhLQAmW (ORCPT ); Thu, 16 Dec 2021 19:42:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230244AbhLQAmU (ORCPT ); Thu, 16 Dec 2021 19:42:20 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97B6EC06173E for ; Thu, 16 Dec 2021 16:42:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 60729B82674 for ; Fri, 17 Dec 2021 00:42:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B87A6C36AEC; Fri, 17 Dec 2021 00:42:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.95) (envelope-from ) id 1my1KB-0004DE-Rk; Thu, 16 Dec 2021 19:42:15 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: "Steven Rostedt (VMware)" Subject: [PATCH 6/9] libtracefs: Quiet mv: cannot stat message for libtracefs.a Date: Thu, 16 Dec 2021 19:42:11 -0500 Message-Id: <20211217004214.16074-7-rostedt@goodmis.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org> References: <20211217004214.16074-1-rostedt@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" The following shows up on a normal make: mv: cannot stat '/work/git/libtracefs.git/lib/tracefs/libtracefs.a': No such file or directory In order to help with a multithreaded make, the moving of the libtracefs.a before removing it appears to fix some issues. But now we get a message if it doesn't already exist. Only move it and remove it if it already exists. Fixes: 550d8358 ("libtracefs: make the libtracefs.a gen more robust") Signed-off-by: Steven Rostedt (VMware) --- scripts/utils.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/utils.mk b/scripts/utils.mk index c9b908f1c5d9..af0f14fcbfa7 100644 --- a/scripts/utils.mk +++ b/scripts/utils.mk @@ -60,7 +60,10 @@ do_app_build = \ do_build_static_lib = \ ($(print_static_lib_build) \ - mv $@ $@.rm; $(RM) $@.rm; $(AR) rcs $@ $^) + if [ -f $@ ]; then \ + mv $@ $@.rm; $(RM) $@.rm; \ + fi; \ + $(AR) rcs $@ $^) do_compile_shared_library = \ ($(print_shared_lib_compile) \ From patchwork Fri Dec 17 00:42:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12683303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C444EC433FE for ; Fri, 17 Dec 2021 00:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229863AbhLQAmW (ORCPT ); Thu, 16 Dec 2021 19:42:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230250AbhLQAmU (ORCPT ); Thu, 16 Dec 2021 19:42:20 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DE02C06173F for ; Thu, 16 Dec 2021 16:42:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6635FB8268C for ; Fri, 17 Dec 2021 00:42:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDA54C36AED; Fri, 17 Dec 2021 00:42:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.95) (envelope-from ) id 1my1KB-0004DI-SO; Thu, 16 Dec 2021 19:42:15 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: "Steven Rostedt (VMware)" Subject: [PATCH 7/9] libtracefs: Quiet "Nothing to be done for" messages Date: Thu, 16 Dec 2021 19:42:12 -0500 Message-Id: <20211217004214.16074-8-rostedt@goodmis.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org> References: <20211217004214.16074-1-rostedt@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" When doing a make after everything is already built, we have "Nothing to be done" messages that are rather annoying. $ make DESCEND src libtracefs.so make[1]: Nothing to be done for 'libtracefs.so'. DESCEND src libtracefs.a make[1]: '/work/git/libtracefs.git/lib/tracefs/libtracefs.a' is up to date. This is because the target in the src directory for these are already done, so it reports there is nothing to be done, as that's what make does if you specify a target (and the descent into he directory specifies the target that is displayed). By marking the target as .PHONY will suppress that message. Because "libtracefs.so" depends on $(LIBTRACEFS_SHARED_SO), the latter needs to be part of the .PHONY and not the former. Signed-off-by: Steven Rostedt (VMware) --- src/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Makefile b/src/Makefile index 8f258a218f97..f284c70a640a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -70,3 +70,5 @@ ifneq ($(dep_includes),) endif $(bdir)/tracefs-sqlhist.o tracefs-sqlhist.o: sqlhist.tab.h + +.PHONY: $(LIBTRACEFS_SHARED_SO) $(LIBTRACEFS_STATIC) From patchwork Fri Dec 17 00:42:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12683307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4EF7C4321E for ; Fri, 17 Dec 2021 00:42:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230244AbhLQAmX (ORCPT ); Thu, 16 Dec 2021 19:42:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230317AbhLQAmV (ORCPT ); Thu, 16 Dec 2021 19:42:21 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCCECC061746 for ; Thu, 16 Dec 2021 16:42:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 72D7BB8268F for ; Fri, 17 Dec 2021 00:42:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6FC8C36AF0; Fri, 17 Dec 2021 00:42:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.95) (envelope-from ) id 1my1KB-0004DM-T1; Thu, 16 Dec 2021 19:42:15 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: "Steven Rostedt (VMware)" Subject: [PATCH 8/9] libtracefs: Have sample build look cleaner Date: Thu, 16 Dec 2021 19:42:13 -0500 Message-Id: <20211217004214.16074-9-rostedt@goodmis.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org> References: <20211217004214.16074-1-rostedt@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" The build of the samples directory just showed the raw commands. This is inconsistent with the rest of the build system. Make it cleaner by showing EXTRACT, COMPILE SAMPLE OBJ and COMPILE SAMPLE for the samples being extracted and built. Signed-off-by: Steven Rostedt (VMware) --- samples/Makefile | 9 +++++---- scripts/utils.mk | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/samples/Makefile b/samples/Makefile index 8e2b53bbdfae..8b2267482fbf 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -28,8 +28,9 @@ bdir := $(obj)/bin all: $(TARGETS) -extract_example = \ - cat $1 | sed -ne '/^EXAMPLE/,/FILES/ { /EXAMPLE/,+2d ; /^FILES/d ; /^--/d ; p}' > $2 +ifeq ($(findstring 1,$(SILENT)$(VERBOSE)),1) +else +endif $(bdir)/sqlhist.c: ../Documentation/libtracefs-sql.txt $(call extract_example,$<,$@) @@ -50,7 +51,7 @@ $(TARGETS): $(bdir) sqlhist: $(bdir)/sqlhist $(bdir)/%: $(bdir)/%.o - $(CC) -o $@ $^ $(LIBTRACEFS_STATIC) $(LIBTRACEEVENT_LIBS) + $(call do_sample_build,$@,$^) $(EXAMPLES): $(patsubst %,$(bdir)/%,$(TARGETS)) @@ -63,7 +64,7 @@ $(EXAMPLES): $(patsubst %,$(bdir)/%,$(TARGETS)) # $(CC) -g -Wall $(CFLAGS) -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES) %.o: %.c - $(CC) -g -Wall $(CFLAGS) -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES) + $(call do_sample_obj,$@,$^) clean: $(Q)$(call do_clean,$(bdir)/*) diff --git a/scripts/utils.mk b/scripts/utils.mk index af0f14fcbfa7..41b996008a73 100644 --- a/scripts/utils.mk +++ b/scripts/utils.mk @@ -30,6 +30,9 @@ ifeq ($(findstring 1,$(SILENT)$(VERBOSE)),1) print_update = print_descend = print_clean = + print_extract = + print_sample_build = + print_sample_obj = else print_compile = echo ' COMPILE '$(GOBJ); print_app_build = echo ' BUILD '$(GOBJ); @@ -43,6 +46,9 @@ else print_update = echo ' UPDATE '$(GOBJ); print_descend = echo ' DESCEND '$(BASE1) $(BASE2); print_clean = echo ' CLEAN '$(BASEPWD); + print_extract = echo ' EXTRACT '$(GOBJ); + print_sample_build = echo ' COMPILE SAMPLE '$(GOBJ); + print_sample_obj = echo ' COMPILE SAMPLE OBJ '$(GOBJ); endif do_fpic_compile = \ @@ -89,6 +95,18 @@ do_clean = \ ($(print_clean) \ $(RM) $1) +extract_example = \ + $(Q)($(print_extract) \ + cat $1 | sed -ne '/^EXAMPLE/,/FILES/ { /EXAMPLE/,+2d ; /^FILES/d ; /^--/d ; p}' > $2) + +do_sample_build = \ + $(Q)($(print_sample_build) \ + $(CC) -o $1 $2 $(LIBTRACEFS_STATIC) $(LIBTRACEEVENT_LIBS)) + +do_sample_obj = \ + $(Q)($(print_sample_obj) \ + $(CC) -g -Wall $(CFLAGS) -c -o $1 $2 -I../include/ $(LIBTRACEEVENT_INCLUDES)) + ifneq ($(findstring $(MAKEFLAGS), w),w) PRINT_DIR = --no-print-directory else From patchwork Fri Dec 17 00:42:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12683299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 204F8C43217 for ; Fri, 17 Dec 2021 00:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230324AbhLQAmV (ORCPT ); Thu, 16 Dec 2021 19:42:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbhLQAmS (ORCPT ); Thu, 16 Dec 2021 19:42:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 423E0C06173E for ; Thu, 16 Dec 2021 16:42:18 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D2F5D61F67 for ; Fri, 17 Dec 2021 00:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6B91C36AEE; Fri, 17 Dec 2021 00:42:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.95) (envelope-from ) id 1my1KB-0004DQ-Te; Thu, 16 Dec 2021 19:42:15 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Cc: "Steven Rostedt (VMware)" Subject: [PATCH 9/9] libtracefs: Have make tags and TAGS honor O= build directory Date: Thu, 16 Dec 2021 19:42:14 -0500 Message-Id: <20211217004214.16074-10-rostedt@goodmis.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org> References: <20211217004214.16074-1-rostedt@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" Currently if one does a "make O=/tmp/build tags" the tags are still built in the source directory. Although this is uncommon to do, the tags (and TAGS) target should still honor the build directory. Signed-off-by: Steven Rostedt (VMware) --- Makefile | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 58b4219e7b62..bf085bfdb800 100644 --- a/Makefile +++ b/Makefile @@ -198,7 +198,7 @@ endif $(src)/$(UTEST_DIR)/$(UTEST_BINARY) define find_tag_files - find . -name '\.pc' -prune -o -name '*\.[ch]' -print -o -name '*\.[ch]pp' \ + find $(src) -name '\.pc' -prune -o -name '*\.[ch]' -print -o -name '*\.[ch]pp' \ ! -name '\.#' -print endef @@ -221,18 +221,26 @@ $(BUILD_PREFIX): force $(PKG_CONFIG_FILE) : ${PKG_CONFIG_SOURCE_FILE}.template $(BUILD_PREFIX) $(VERSION_FILE) $(Q) $(call do_make_pkgconfig_file,$(prefix)) -tags: force - $(RM) tags - $(call find_tag_files) | xargs ctags --extra=+f --c-kinds=+px +VIM_TAGS = $(obj)/tags +EMACS_TAGS = $(obj)/TAGS +CSCOPE_TAGS = $(obj)/cscope -TAGS: force - $(RM) TAGS - $(call find_tag_files) | xargs etags +$(VIM_TAGS): force + $(RM) $@ + $(call find_tag_files) | (cd $(obj) && xargs ctags --extra=+f --c-kinds=+px) -cscope: force - $(RM) cscope* +$(EMACS_TAGS): force + $(RM) $@ + $(call find_tag_files) | (cd $(obj) && xargs etags) + +$(CSCOPE_TAGS): force + $(RM) $(obj)/cscope* $(call find_tag_files) | cscope -b -q +tags: $(VIM_TAGS) +TAGS: $(EMACS_TAGS) +cscope: $(CSCOPE_TAGS) + ifeq ("$(DESTDIR)", "") # If DESTDIR is not defined, then test if after installing the library # and running ldconfig, if the library is visible by ld.so.