From patchwork Wed Dec 16 04:41:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11976373 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42D45C4361B for ; Wed, 16 Dec 2020 04:43:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CE8F23137 for ; Wed, 16 Dec 2020 04:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725730AbgLPEmy (ORCPT ); Tue, 15 Dec 2020 23:42:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:48606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725550AbgLPEmy (ORCPT ); Tue, 15 Dec 2020 23:42:54 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1DB5823130 for ; Wed, 16 Dec 2020 04:42:14 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdh-000qxq-3v for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:13 -0500 Message-ID: <20201216044212.967348881@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:41:51 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 01/12] trace-cmd: Move do_make_pkgconfig_file to utils.mk References: <20201216044150.375001748@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" The macro do_make_pkgconfig_file should be in utils.mk and not in the top Makefile as utils.mk is where other similar macros are located. Signed-off-by: Steven Rostedt (VMware) --- Makefile | 8 -------- scripts/utils.mk | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index ab91ae777b83..595c8443e572 100644 --- a/Makefile +++ b/Makefile @@ -208,14 +208,6 @@ obj := $(objtree) PKG_CONFIG_SOURCE_FILE = libtracecmd.pc PKG_CONFIG_FILE := $(addprefix $(BUILD_OUTPUT)/,$(PKG_CONFIG_SOURCE_FILE)) -define do_make_pkgconfig_file - cp -f $(srctree)/${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE}; \ - sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; \ - sed -i "s|LIB_VERSION|${LIBTRACECMD_VERSION}|g" ${PKG_CONFIG_FILE}; \ - sed -i "s|LIB_DIR|$(libdir)|g" ${PKG_CONFIG_FILE}; \ - sed -i "s|HEADER_DIR|$(includedir)/trace-cmd|g" ${PKG_CONFIG_FILE}; -endef - kshark-dir = $(src)/kernel-shark export prefix bindir src obj kshark-dir diff --git a/scripts/utils.mk b/scripts/utils.mk index 1d090d8ac001..98549af9a774 100644 --- a/scripts/utils.mk +++ b/scripts/utils.mk @@ -142,3 +142,11 @@ define do_install_pkgconfig_file (echo Failed to locate pkg-config directory) 1>&2; \ fi endef + +define do_make_pkgconfig_file + cp -f $(srctree)/${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE}; \ + sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; \ + sed -i "s|LIB_VERSION|${LIBTRACECMD_VERSION}|g" ${PKG_CONFIG_FILE}; \ + sed -i "s|LIB_DIR|$(libdir)|g" ${PKG_CONFIG_FILE}; \ + sed -i "s|HEADER_DIR|$(includedir)/trace-cmd|g" ${PKG_CONFIG_FILE}; +endef From patchwork Wed Dec 16 04:41:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11976379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A79BC0018C for ; Wed, 16 Dec 2020 04:43:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5110D23137 for ; Wed, 16 Dec 2020 04:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725287AbgLPEmy (ORCPT ); Tue, 15 Dec 2020 23:42:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:48618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgLPEmy (ORCPT ); Tue, 15 Dec 2020 23:42:54 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 471C123133 for ; Wed, 16 Dec 2020 04:42:14 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdh-000qyL-Aa for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:13 -0500 Message-ID: <20201216044213.152508008@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:41:52 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 02/12] trace-cmd: Have etcdir always be at the root directory References: <20201216044150.375001748@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" There's a test if prefix == /usr/local and if so, then etcdir is set to "/etc", otherwise it is set to $(prefix)/etc, which is not correct. Always have etcdir = "/etc". Signed-off-by: Steven Rostedt (VMware) --- Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile b/Makefile index 595c8443e572..f8252ba83352 100644 --- a/Makefile +++ b/Makefile @@ -72,11 +72,7 @@ includedir_SQ = '$(subst ','\'',$(includedir))' pkgconfig_dir ?= $(word 1,$(shell $(PKG_CONFIG) \ --variable pc_path pkg-config | tr ":" " ")) -ifeq ($(prefix),/usr/local) etcdir ?= /etc -else -etcdir ?= $(prefix)/etc -endif etcdir_SQ = '$(subst ','\'',$(etcdir))' export man_dir man_dir_SQ html_install html_install_SQ INSTALL From patchwork Wed Dec 16 04:41:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11976377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E4AEC2BBCD for ; Wed, 16 Dec 2020 04:43:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B10523371 for ; Wed, 16 Dec 2020 04:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725710AbgLPEmz (ORCPT ); Tue, 15 Dec 2020 23:42:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:48630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725771AbgLPEmy (ORCPT ); Tue, 15 Dec 2020 23:42:54 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7736523137 for ; Wed, 16 Dec 2020 04:42:14 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdh-000qyp-GJ for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:13 -0500 Message-ID: <20201216044213.357761288@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:41:53 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 03/12] trace-cmd: Remove unused variable LD_SO_CONF_DIR References: <20201216044150.375001748@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" The LD_SO_CONF_DIR variable in the Makefile is not used anywhere. Remove it. Signed-off-by: Steven Rostedt (VMware) --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index f8252ba83352..e956a2e6e8b6 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,6 @@ HELP_DIR_SQ = '$(subst ','\'',$(HELP_DIR))' #' emacs highlighting gets confused by the above escaped quote. BASH_COMPLETE_DIR ?= $(etcdir)/bash_completion.d -LD_SO_CONF_DIR ?= $(etcdir)/ld.so.conf.d export PLUGIN_DIR_TRACEEVENT export PLUGIN_DIR_TRACECMD From patchwork Wed Dec 16 04:41:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11976381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED1C0C4361B for ; Wed, 16 Dec 2020 04:43:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFEC523139 for ; Wed, 16 Dec 2020 04:43:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725796AbgLPEnS (ORCPT ); Tue, 15 Dec 2020 23:43:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:48930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbgLPEnS (ORCPT ); Tue, 15 Dec 2020 23:43:18 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A328823139 for ; Wed, 16 Dec 2020 04:42:14 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdh-000qzJ-MT for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:13 -0500 Message-ID: <20201216044213.537553785@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:41:54 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 04/12] trace-cmd: Use the LIBTRACE{EVENT,FS}_LIBS for building libtracecmd.so References: <20201216044150.375001748@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" Currently the path of the libtraceevent library is hardcoded when building libtracecmd.so, and libtracefs is not even specified. In order to use libtracecmd.so without needing to add -ltraceevent or -ltracefs, use the defined LIBTRACEVENT_LIBS and LIBTRACEFS_LIBS for the LIBS macro to build libtracecmd.so. Signed-off-by: Steven Rostedt (VMware) --- lib/trace-cmd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/trace-cmd/Makefile b/lib/trace-cmd/Makefile index 838a59ddf332..75e4fea4e3e0 100644 --- a/lib/trace-cmd/Makefile +++ b/lib/trace-cmd/Makefile @@ -38,7 +38,7 @@ $(DEPS): | $(bdir) $(LIBTRACECMD_STATIC): $(OBJS) $(Q)$(call do_build_static_lib) -LIBS = -L$(obj)/lib/traceevent -ltraceevent +LIBS = $(LIBTRACEEVENT_LDLAGS) $(LIBTRACEFS_LDLAGS) $(LIBTRACECMD_SHARED_VERSION): $(LIBTRACECMD_SHARED) @ln -sf $( X-Patchwork-Id: 11976383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7017CC2BBCA for ; Wed, 16 Dec 2020 04:43:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4844E2313B for ; Wed, 16 Dec 2020 04:43:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725788AbgLPEnT (ORCPT ); Tue, 15 Dec 2020 23:43:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:48932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725771AbgLPEnS (ORCPT ); Tue, 15 Dec 2020 23:43:18 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D865C2313B for ; Wed, 16 Dec 2020 04:42:14 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdh-000qzn-SV for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:13 -0500 Message-ID: <20201216044213.730082526@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:41:55 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 05/12] libtracecmd: Update ld.so.conf.d/trace.conf if needed References: <20201216044150.375001748@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" If DESTDIR is not defined (building for the current machine) check if after installing libtracecmd, if it is in the ld.so path by building a test program and running it, and making sure that the dynamic linker works, and if not, then update /etc/ld.so.conf.d/trace.conf to include the path to libtracecmd.so. Signed-off-by: Steven Rostedt (VMware) --- Makefile | 6 +++++- lib/trace-cmd/Makefile | 26 ++++++++++++++++++++++++++ lib/trace-cmd/test.c | 7 +++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 lib/trace-cmd/test.c diff --git a/Makefile b/Makefile index e956a2e6e8b6..101820733862 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,10 @@ endef $(call allow-override,CC,$(CROSS_COMPILE)gcc) $(call allow-override,AR,$(CROSS_COMPILE)ar) $(call allow-override,PKG_CONFIG,pkg-config) +$(call allow-override,LD_SO_CONF_PATH,/etc/ld.so.conf.d/) +$(call allow-override,LDCONFIG,ldconfig) + +export LD_SO_CONF_PATH LDCONFIG EXT = -std=gnu99 INSTALL = install @@ -76,7 +80,7 @@ etcdir ?= /etc etcdir_SQ = '$(subst ','\'',$(etcdir))' export man_dir man_dir_SQ html_install html_install_SQ INSTALL -export img_install img_install_SQ libdir_SQ includedir_SQ +export img_install img_install_SQ libdir libdir_SQ includedir_SQ export DESTDIR DESTDIR_SQ ifeq ($(prefix),$(HOME)) diff --git a/lib/trace-cmd/Makefile b/lib/trace-cmd/Makefile index 75e4fea4e3e0..a26b989a2c82 100644 --- a/lib/trace-cmd/Makefile +++ b/lib/trace-cmd/Makefile @@ -3,6 +3,7 @@ include $(src)/scripts/utils.mk bdir:=$(obj)/lib/trace-cmd +ldir:=$(src)/lib/trace-cmd DEFAULT_TARGET = $(LIBTRACECMD_STATIC) @@ -59,11 +60,36 @@ $(DEPS): $(bdir)/.%.d: %.c $(OBJS): $(bdir)/%.o : $(bdir)/.%.d +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. +# If not, add the path to /etc/ld.so.conf.d/trace.conf and run ldconfig again. +define install_ld_config + $(LDCONFIG); \ + if ! grep "^$(libdir)$$" $(LD_SO_CONF_PATH)/* &> /dev/null ; then \ + $(CC) -o $(bdir)/test $(ldir)/test.c -I $(includedir_SQ) \ + -L $(libdir_SQ) -ltracecmd > /dev/null; \ + if ! $(bdir)/test &> /dev/null; then \ + $(call print_install,trace.conf,$(LD_SO_CONF_PATH)) \ + echo $(libdir_SQ) >> $(LD_SO_CONF_PATH)/trace.conf; \ + $(LDCONFIG); \ + fi; \ + $(RM) $(bdir)/test; \ + fi +endef +else +# If installing to a location for another machine or package, do not bother +# with running ldconfig. +define install_ld_config +endef +endif # DESTDIR = "" + install_libs: $(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ)) cp -fpR $(LIBTRACECMD_SHARED_VERSION) $(DESTDIR)$(libdir_SQ) cp -fpR $(LIBTRACECMD_SHARED_SO) $(DESTDIR)$(libdir_SQ) $(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ)/trace-cmd) + $(Q)$(call install_ld_config) dep_includes := $(wildcard $(DEPS)) diff --git a/lib/trace-cmd/test.c b/lib/trace-cmd/test.c new file mode 100644 index 000000000000..5622d79c86c5 --- /dev/null +++ b/lib/trace-cmd/test.c @@ -0,0 +1,7 @@ +#include + +int main() +{ + tracecmd_open_head("trace.dat"); + return 0; +} From patchwork Wed Dec 16 04:41:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11976387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9AE8C2BBD4 for ; Wed, 16 Dec 2020 04:43:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8EE3423159 for ; Wed, 16 Dec 2020 04:43:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725807AbgLPEnf (ORCPT ); Tue, 15 Dec 2020 23:43:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbgLPEne (ORCPT ); Tue, 15 Dec 2020 23:43:34 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0CCD52313C for ; Wed, 16 Dec 2020 04:42:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdi-000r0H-1k for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:14 -0500 Message-ID: <20201216044213.915594804@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:41:56 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 06/12] libtracecmd: Make installing show a nice INSTALL output References: <20201216044150.375001748@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" Currently, when doing "make install_libs" the output looks like: INSTALL /tmp/build/lib/trace-cmd/libtracecmd.so.0.0.1 to /usr/local/lib64 cp -fpR /tmp/build/lib/trace-cmd/libtracecmd.so.0 '/usr/local/lib64' cp -fpR /tmp/build/lib/trace-cmd/libtracecmd.so '/usr/local/lib64' INSTALL /work/git/trace-cmd.git/include/trace-cmd/trace-cmd.h to /usr/local/include/trace-cmd Have it look like: INSTALL /tmp/build/lib/trace-cmd/libtracecmd.so.0.0.1 to /usr/local/lib64 INSTALL /tmp/build/lib/trace-cmd/libtracecmd.so.0 to /usr/local/lib64 INSTALL /tmp/build/lib/trace-cmd/libtracecmd.so to /usr/local/lib64 INSTALL /work/git/trace-cmd.git/include/trace-cmd/trace-cmd.h to /usr/local/include/trace-cmd Signed-off-by: Steven Rostedt (VMware) --- lib/trace-cmd/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/trace-cmd/Makefile b/lib/trace-cmd/Makefile index a26b989a2c82..3b8087f66db5 100644 --- a/lib/trace-cmd/Makefile +++ b/lib/trace-cmd/Makefile @@ -86,8 +86,10 @@ endif # DESTDIR = "" install_libs: $(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ)) - cp -fpR $(LIBTRACECMD_SHARED_VERSION) $(DESTDIR)$(libdir_SQ) - cp -fpR $(LIBTRACECMD_SHARED_SO) $(DESTDIR)$(libdir_SQ) + $(Q)$(call print_install,$(LIBTRACECMD_SHARED_VERSION),$(DESTDIR)$(libdir_SQ)) + $(Q)cp -fpR $(LIBTRACECMD_SHARED_VERSION) $(DESTDIR)$(libdir_SQ) + $(Q)$(call print_install,$(LIBTRACECMD_SHARED_SO),$(DESTDIR)$(libdir_SQ)) + $(Q)cp -fpR $(LIBTRACECMD_SHARED_SO) $(DESTDIR)$(libdir_SQ) $(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ)/trace-cmd) $(Q)$(call install_ld_config) From patchwork Wed Dec 16 04:41:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11976389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDBBCC2BBCD for ; Wed, 16 Dec 2020 04:43:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3F632313C for ; Wed, 16 Dec 2020 04:43:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725806AbgLPEnf (ORCPT ); Tue, 15 Dec 2020 23:43:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725771AbgLPEne (ORCPT ); Tue, 15 Dec 2020 23:43:34 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 42A072313F for ; Wed, 16 Dec 2020 04:42:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdi-000r0l-8X for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:14 -0500 Message-ID: <20201216044214.097981448@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:41:57 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 07/12] libtracecmd: Build libtracecmd.pc when building the library References: <20201216044150.375001748@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 creating libtracecmd.pc when installing, which will likely leave the file owned by root, create it when building the library. Signed-off-by: Steven Rostedt (VMware) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 101820733862..038276b67464 100644 --- a/Makefile +++ b/Makefile @@ -376,7 +376,7 @@ libtracecmd.a: $(LIBTRACECMD_STATIC) libtracecmd.so: $(LIBTRACECMD_SHARED) libtracefs.a: $(LIBTRACEFS_STATIC) -libs: $(LIBTRACECMD_SHARED) $(LIBTRACEEVENT_STATIC_BUILD) $(LIBTRACEFS_STATIC_BUILD) +libs: $(LIBTRACECMD_SHARED) $(LIBTRACEEVENT_STATIC_BUILD) $(LIBTRACEFS_STATIC_BUILD) $(PKG_CONFIG_FILE) test: force $(LIBTRACEEVENT_STATIC_BUILD) $(LIBTRACEFS_STATIC_BUILD) $(LIBTRACECMD_STATIC) ifneq ($(CUNIT_INSTALLED),1) From patchwork Wed Dec 16 04:41:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11976385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA132C2BBCF for ; Wed, 16 Dec 2020 04:43:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68C5B2313C for ; Wed, 16 Dec 2020 04:43:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725815AbgLPEnf (ORCPT ); Tue, 15 Dec 2020 23:43:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725807AbgLPEne (ORCPT ); Tue, 15 Dec 2020 23:43:34 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6E39E23159 for ; Wed, 16 Dec 2020 04:42:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdi-000r1F-EX for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:14 -0500 Message-ID: <20201216044214.305249156@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:41:58 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 08/12] libtracecmd: Show building of libtracecmd.pc References: <20201216044150.375001748@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" Add printing a nice message "BUILD libtracecmd.pc" when it is being created. And also add it to the .gitignore file. Signed-off-by: Steven Rostedt (VMware) --- .gitignore | 1 + scripts/utils.mk | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ca6c9cb68f6f..1e8c1d4f5734 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ cscope* traceevent_plugin_dir trace_python_dir tracecmd_plugin_dir +libtracecmd.pc diff --git a/scripts/utils.mk b/scripts/utils.mk index 98549af9a774..e166c6ae3f9d 100644 --- a/scripts/utils.mk +++ b/scripts/utils.mk @@ -144,7 +144,8 @@ define do_install_pkgconfig_file endef define do_make_pkgconfig_file - cp -f $(srctree)/${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE}; \ + $(print_app_build) + $(Q)cp -f $(srctree)/${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE}; \ sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; \ sed -i "s|LIB_VERSION|${LIBTRACECMD_VERSION}|g" ${PKG_CONFIG_FILE}; \ sed -i "s|LIB_DIR|$(libdir)|g" ${PKG_CONFIG_FILE}; \ From patchwork Wed Dec 16 04:41:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11976395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7162CC3526A for ; Wed, 16 Dec 2020 04:43:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3095323159 for ; Wed, 16 Dec 2020 04:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725804AbgLPEnf (ORCPT ); Tue, 15 Dec 2020 23:43:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725808AbgLPEnf (ORCPT ); Tue, 15 Dec 2020 23:43:35 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A7E4B2332A for ; Wed, 16 Dec 2020 04:42:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdi-000r1j-L1 for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:14 -0500 Message-ID: <20201216044214.498297897@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:41:59 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 09/12] libtracecmd: Install libtracecmd.pc when installing libs References: <20201216044150.375001748@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 installing libtracecmd.pc when doing the install of the executable, install it durin "make install_libs". Also do some clean ups around the building and installin gof libtracecmd.pc. Signed-off-by: Steven Rostedt (VMware) --- Makefile | 8 +++----- lib/trace-cmd/Makefile | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 038276b67464..c1192da4f049 100644 --- a/Makefile +++ b/Makefile @@ -207,6 +207,8 @@ obj := $(objtree) PKG_CONFIG_SOURCE_FILE = libtracecmd.pc PKG_CONFIG_FILE := $(addprefix $(BUILD_OUTPUT)/,$(PKG_CONFIG_SOURCE_FILE)) +export pkgconfig_dir PKG_CONFIG_FILE + kshark-dir = $(src)/kernel-shark export prefix bindir src obj kshark-dir @@ -439,7 +441,7 @@ install_python: force install_bash_completion: force $(Q)$(call do_install_data,$(src)/tracecmd/trace-cmd.bash,$(BASH_COMPLETE_DIR)) -install_cmd: all_cmd install_plugins install_python install_bash_completion install_pkgconfig +install_cmd: all_cmd install_plugins install_python install_bash_completion $(Q)$(call do_install,$(obj)/tracecmd/trace-cmd,$(bindir_SQ)) install: install_cmd @@ -468,10 +470,6 @@ install_doc: install_doc_gui: $(MAKE) -C $(kshark-dir)/Documentation install -install_pkgconfig: $(PKG_CONFIG_FILE) - $(Q)$(call , $(PKG_CONFIG_FILE)) \ - $(call do_install_pkgconfig_file,$(prefix)) - clean: $(RM) *.o *~ *.a *.so .*.d $(RM) tags TAGS cscope* $(PKG_CONFIG_SOURCE_FILE) diff --git a/lib/trace-cmd/Makefile b/lib/trace-cmd/Makefile index 3b8087f66db5..ec6ab29923db 100644 --- a/lib/trace-cmd/Makefile +++ b/lib/trace-cmd/Makefile @@ -84,7 +84,10 @@ define install_ld_config endef endif # DESTDIR = "" -install_libs: +install_pkgconfig: $(PKG_CONFIG_FILE) + $(Q)$(call do_install_pkgconfig_file,$(prefix)) + +install_libs: install_pkgconfig $(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ)) $(Q)$(call print_install,$(LIBTRACECMD_SHARED_VERSION),$(DESTDIR)$(libdir_SQ)) $(Q)cp -fpR $(LIBTRACECMD_SHARED_VERSION) $(DESTDIR)$(libdir_SQ) From patchwork Wed Dec 16 04:42:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11976391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44729C2BBD5 for ; Wed, 16 Dec 2020 04:43:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C27E2313C for ; Wed, 16 Dec 2020 04:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725811AbgLPEnf (ORCPT ); Tue, 15 Dec 2020 23:43:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725804AbgLPEnf (ORCPT ); Tue, 15 Dec 2020 23:43:35 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C775B23331 for ; Wed, 16 Dec 2020 04:42:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdi-000r2D-Qa for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:14 -0500 Message-ID: <20201216044214.680385146@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:42:00 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 10/12] trace-cmd: Add make uninstall References: <20201216044150.375001748@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" Create the logic to remove the files that would normally be installed. Note, this does take the DESTDIR and prefix variables into account. Where the uninstall may only work for an install with the same variables. Signed-off-by: Steven Rostedt (VMware) --- Makefile | 30 ++++++++++++++++++++++++++++++ scripts/utils.mk | 2 ++ 2 files changed, 32 insertions(+) diff --git a/Makefile b/Makefile index c1192da4f049..ddceab3f45e7 100644 --- a/Makefile +++ b/Makefile @@ -484,6 +484,36 @@ clean: if [ -f $(kshark-dir)/build/Makefile ]; then $(MAKE) -C $(kshark-dir)/build clean; fi cd $(kshark-dir)/build; ./cmake_clean.sh +define build_uninstall_script + $(Q)mkdir $(BUILD_OUTPUT)/tmp_build + $(Q)$(MAKE) -C $(src) DESTDIR=$(BUILD_OUTPUT)/tmp_build O=$(BUILD_OUTPUT) $1 > /dev/null + $(Q)find $(BUILD_OUTPUT)/tmp_build ! -type d -printf "%P\n" > $(BUILD_OUTPUT)/build_$2 + $(Q)$(RM) -rf $(BUILD_OUTPUT)/tmp_build +endef + +build_uninstall: + $(call build_uninstall_script,install,uninstall) + +$(BUILD_OUTPUT)/build_uninstall: build_uninstall + +build_libs_uninstall: + $(call build_uninstall_script,install_libs,libs_uninstall) + +$(BUILD_OUTPUT)/build_libs_uninstall: build_libs_uninstall + +define uninstall_file + if [ -f $(DESTDIR)/$1 -o -h $(DESTDIR)/$1 ]; then \ + $(call print_uninstall,$(DESTDIR)/$1)$(RM) $(DESTDIR)/$1; \ + fi; +endef + +uninstall: $(BUILD_OUTPUT)/build_uninstall + @$(foreach file,$(shell cat $(BUILD_OUTPUT)/build_uninstall),$(call uninstall_file,$(file))) + $(Q)$(RM) $< + +uninstall_libs: $(BUILD_OUTPUT)/build_libs_uninstall + @$(foreach file,$(shell cat $(BUILD_OUTPUT)/build_libs_uninstall),$(call uninstall_file,$(file))) + $(Q)$(RM) $< ##### PYTHON STUFF ##### diff --git a/scripts/utils.mk b/scripts/utils.mk index e166c6ae3f9d..c8ef44b3776a 100644 --- a/scripts/utils.mk +++ b/scripts/utils.mk @@ -30,6 +30,7 @@ ifeq ($(findstring 1,$(SILENT)$(VERBOSE)),1) print_plugin_obj_compile = print_plugin_build = print_install = + print_uninstall = print_update = else print_compile = echo ' $(GUI)COMPILE '$(GOBJ); @@ -41,6 +42,7 @@ else print_static_lib_build = echo ' $(GUI)BUILD STATIC LIB '$(GOBJ); print_install = echo ' $(GUI)INSTALL '$(GSPACE)$1' to $(DESTDIR_SQ)$2'; print_update = echo ' $(GUI)UPDATE '$(GOBJ); + print_uninstall = echo ' $(GUI)UNINSTALLING $(DESTDIR_SQ)$1'; endif do_fpic_compile = \ From patchwork Wed Dec 16 04:42:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11976393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11B9CC2D0E4 for ; Wed, 16 Dec 2020 04:43:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D861123159 for ; Wed, 16 Dec 2020 04:43:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725771AbgLPEnf (ORCPT ); Tue, 15 Dec 2020 23:43:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725811AbgLPEnf (ORCPT ); Tue, 15 Dec 2020 23:43:35 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F07AC23332 for ; Wed, 16 Dec 2020 04:42:15 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdj-000r2h-0A for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:15 -0500 Message-ID: <20201216044214.856860622@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:42:01 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 11/12] trace-cmd: Update libtracecmd.pc if prefix is different References: <20201216044150.375001748@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" If a build is done with different DESTDIR and the prefix is changed, the the libtracecmd.pc is not updated with the new prefix, and the one used may not work with the installation being performed. Add a "build_prefix" dependency, that creates a file "build_prefix" that has the last prefix used to build the library. And if a new prefix is used, then that file gets updated and so does libtracecmd.pc. Signed-off-by: Steven Rostedt (VMware) --- .gitignore | 1 + Makefile | 7 ++++++- scripts/utils.mk | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1e8c1d4f5734..9ce25c8e031e 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ traceevent_plugin_dir trace_python_dir tracecmd_plugin_dir libtracecmd.pc +build_prefix diff --git a/Makefile b/Makefile index ddceab3f45e7..396a6795bad1 100644 --- a/Makefile +++ b/Makefile @@ -343,7 +343,12 @@ CMAKE_COMMAND = /usr/bin/cmake # Build with "BUILD_TYPE=Release" to remove cmake debug info BUILD_TYPE ?= RelWithDebInfo -$(PKG_CONFIG_FILE) : ${PKG_CONFIG_SOURCE_FILE}.template +BUILD_PREFIX := $(BUILD_OUTPUT)/build_prefix + +$(BUILD_PREFIX): force + $(Q)$(call build_prefix,$(prefix)) + +$(PKG_CONFIG_FILE) : ${PKG_CONFIG_SOURCE_FILE}.template $(BUILD_PREFIX) $(Q) $(call do_make_pkgconfig_file,$(prefix)) $(kshark-dir)/build/Makefile: $(kshark-dir)/CMakeLists.txt diff --git a/scripts/utils.mk b/scripts/utils.mk index c8ef44b3776a..c06888795ddf 100644 --- a/scripts/utils.mk +++ b/scripts/utils.mk @@ -121,6 +121,16 @@ define update_dir fi); endef +define build_prefix + (echo $1 > $@.tmp; \ + if [ -r $@ ] && cmp -s $@ $@.tmp; then \ + rm -f $@.tmp; \ + else \ + $(print_update) \ + mv -f $@.tmp $@; \ + fi); +endef + define do_install $(print_install) \ if [ ! -d '$(DESTDIR_SQ)$2' ]; then \ From patchwork Wed Dec 16 04:42:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11976397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91B82C3526B for ; Wed, 16 Dec 2020 04:43:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B4212332A for ; Wed, 16 Dec 2020 04:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725816AbgLPEnf (ORCPT ); Tue, 15 Dec 2020 23:43:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:49154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725813AbgLPEnf (ORCPT ); Tue, 15 Dec 2020 23:43:35 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3AC6723333 for ; Wed, 16 Dec 2020 04:42:16 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.94) (envelope-from ) id 1kpOdj-000r3B-75 for linux-trace-devel@vger.kernel.org; Tue, 15 Dec 2020 23:42:15 -0500 Message-ID: <20201216044215.050645958@goodmis.org> User-Agent: quilt/0.66 Date: Tue, 15 Dec 2020 23:42:02 -0500 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 12/12] trace-cmd: Keep build_install files around References: <20201216044150.375001748@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 rebuilding the build_install and build_libs_install files every time the uninstall is created, make it depend on the prefix, as if the prefix is the same, then the uninstall should be the same. Signed-off-by: Steven Rostedt (VMware) --- .gitignore | 2 ++ Makefile | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9ce25c8e031e..af9bf6c09a24 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ trace_python_dir tracecmd_plugin_dir libtracecmd.pc build_prefix +build_install +build_libs_install diff --git a/Makefile b/Makefile index 396a6795bad1..662d24ba288f 100644 --- a/Makefile +++ b/Makefile @@ -496,12 +496,12 @@ define build_uninstall_script $(Q)$(RM) -rf $(BUILD_OUTPUT)/tmp_build endef -build_uninstall: +build_uninstall: $(BUILD_PREFIX) $(call build_uninstall_script,install,uninstall) $(BUILD_OUTPUT)/build_uninstall: build_uninstall -build_libs_uninstall: +build_libs_uninstall: $(BUILD_PREFIX) $(call build_uninstall_script,install_libs,libs_uninstall) $(BUILD_OUTPUT)/build_libs_uninstall: build_libs_uninstall @@ -514,11 +514,9 @@ endef uninstall: $(BUILD_OUTPUT)/build_uninstall @$(foreach file,$(shell cat $(BUILD_OUTPUT)/build_uninstall),$(call uninstall_file,$(file))) - $(Q)$(RM) $< uninstall_libs: $(BUILD_OUTPUT)/build_libs_uninstall @$(foreach file,$(shell cat $(BUILD_OUTPUT)/build_libs_uninstall),$(call uninstall_file,$(file))) - $(Q)$(RM) $< ##### PYTHON STUFF #####