From patchwork Sat Jul 20 03:03:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick McLean X-Patchwork-Id: 11050753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AE0C31510 for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AC02289C5 for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EFDD289B4; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25786289B4 for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390433AbfGTDD4 (ORCPT ); Fri, 19 Jul 2019 23:03:56 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:39660 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390400AbfGTDD4 (ORCPT ); Fri, 19 Jul 2019 23:03:56 -0400 Received: from chiana.gaikai.org (unknown [100.42.98.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: chutzpah) by smtp.gentoo.org (Postfix) with ESMTPSA id 2D0B8348128 for ; Sat, 20 Jul 2019 03:03:56 +0000 (UTC) From: Patrick McLean To: linux-trace-devel@vger.kernel.org Subject: [PATCH 1/4] trace-cmd: Allow overriding of python installation directory Date: Fri, 19 Jul 2019 20:03:41 -0700 Message-Id: <20190720030344.1991393-2-chutzpah@gentoo.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190720030344.1991393-1-chutzpah@gentoo.org> References: <20190720030344.1991393-1-chutzpah@gentoo.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Patrick McLean The current Makefile hardcodes the python module install directory, so packages can't put them in their distro's perferred location. This allows the directory to be overriden on the command line. Signed-off-by: Patrick McLean --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ad74a96..3579f27 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ python_dir = $(HOME)/.trace-cmd/python var_dir = $(HOME)/.trace-cmd/ else plugin_dir = $(libdir)/trace-cmd/plugins -python_dir = $(libdir)/trace-cmd/python +python_dir ?= $(libdir)/trace-cmd/python PLUGIN_DIR = -DPLUGIN_DIR="$(plugin_dir)" PYTHON_DIR = -DPYTHON_DIR="$(python_dir)" PLUGIN_DIR_SQ = '$(subst ','\'',$(PLUGIN_DIR))' From patchwork Sat Jul 20 03:03:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick McLean X-Patchwork-Id: 11050755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C8BB813A4 for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B60C2289B4 for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A24FA289BF; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46604289BF for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390435AbfGTDD5 (ORCPT ); Fri, 19 Jul 2019 23:03:57 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:39662 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390431AbfGTDD4 (ORCPT ); Fri, 19 Jul 2019 23:03:56 -0400 Received: from chiana.gaikai.org (unknown [100.42.98.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: chutzpah) by smtp.gentoo.org (Postfix) with ESMTPSA id 57A79348129 for ; Sat, 20 Jul 2019 03:03:56 +0000 (UTC) From: Patrick McLean To: linux-trace-devel@vger.kernel.org Subject: [PATCH 2/4] trace-cmd: No automagic dependency on udis86 Date: Fri, 19 Jul 2019 20:03:42 -0700 Message-Id: <20190720030344.1991393-3-chutzpah@gentoo.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190720030344.1991393-1-chutzpah@gentoo.org> References: <20190720030344.1991393-1-chutzpah@gentoo.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Patrick McLean Currently if udis86 is detected on the system, trace-cmd automatically uses it. This is generally a problem for packagers since if the build machine happens to have udis86, now there is a dependency on it that may or may not be tracked. This adds a NO_UDIS86 variable that can be set by the packager to disable using udis86 completely. Signed-off-by: Patrick McLean Signed-off-by: Patrick McLean --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3579f27..6b85e21 100644 --- a/Makefile +++ b/Makefile @@ -136,8 +136,13 @@ export NO_PYTHON test-build = $(if $(shell sh -c 'echo "$(1)" | \ $(CC) -o /dev/null -c -x c - > /dev/null 2>&1 && echo y'), $2) +ifndef NO_UDIS86 # have udis86 disassembler library? -udis86-flags := $(call test-build,\#include ,-DHAVE_UDIS86 -ludis86) +udis86-flags := -DHAVE_UDIS86 +udis86-ldflags := -ludis86 +else +udis86-flags := -UHAVE_UDIS86 +endif # NO_UDIS86 define BLK_TC_FLUSH_SOURCE #include @@ -237,6 +242,7 @@ endif # Append required CFLAGS override CFLAGS += $(INCLUDES) $(PLUGIN_DIR_SQ) $(VAR_DIR) override CFLAGS += $(udis86-flags) $(blk-flags) +override LDFLAGS += $(udis86-ldflags) CMD_TARGETS = trace-cmd $(BUILD_PYTHON) From patchwork Sat Jul 20 03:03:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick McLean X-Patchwork-Id: 11050757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D69881823 for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6EA4289AB for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C55C7289CD; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FE35289AB for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390431AbfGTDD5 (ORCPT ); Fri, 19 Jul 2019 23:03:57 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:39664 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728058AbfGTDD5 (ORCPT ); Fri, 19 Jul 2019 23:03:57 -0400 Received: from chiana.gaikai.org (unknown [100.42.98.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: chutzpah) by smtp.gentoo.org (Postfix) with ESMTPSA id 81B6F34812A for ; Sat, 20 Jul 2019 03:03:56 +0000 (UTC) From: Patrick McLean To: linux-trace-devel@vger.kernel.org Subject: [PATCH 3/4] trace-cmd: Install all headers needed by kernelshark to proper paths Date: Fri, 19 Jul 2019 20:03:43 -0700 Message-Id: <20190720030344.1991393-4-chutzpah@gentoo.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190720030344.1991393-1-chutzpah@gentoo.org> References: <20190720030344.1991393-1-chutzpah@gentoo.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Patrick McLean The trace-cmd build system installs headers for building kernelshark, but it is missing trace-seq.h and trace-filter-hash.h. It additionally installs event-parse.h to the toplevel "trace-cmd" include directory, but the generated header includes it as "traceevent/event-parse.h" so the kernelshark build fails. This patch installs all the headers needed to build kernelshark to the appropiate directories. Signed-off-by: Patrick McLean --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6b85e21..3bab851 100644 --- a/Makefile +++ b/Makefile @@ -345,8 +345,10 @@ install_gui: install_cmd gui install_libs: libs $(Q)$(call do_install,$(LIBTRACECMD_SHARED),$(libdir_SQ)) $(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ)) - $(Q)$(call do_install,$(src)/include/traceevent/event-parse.h,$(includedir_SQ)) + $(Q)$(call do_install,$(src)/include/traceevent/event-parse.h,$(includedir_SQ)/traceevent) + $(Q)$(call do_install,$(src)/include/traceevent/trace-seq.h,$(includedir_SQ)/traceevent) $(Q)$(call do_install,$(src)/include/trace-cmd/trace-cmd.h,$(includedir_SQ)) + $(Q)$(call do_install,$(src)/include/trace-cmd/trace-filter-hash.h,$(includedir_SQ)) doc: $(MAKE) -C $(src)/Documentation all From patchwork Sat Jul 20 03:03:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick McLean X-Patchwork-Id: 11050759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 226CF138D for ; Sat, 20 Jul 2019 03:03:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11886289AB for ; Sat, 20 Jul 2019 03:03:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F22BC289B4; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A9CA289BE for ; Sat, 20 Jul 2019 03:03:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728058AbfGTDD5 (ORCPT ); Fri, 19 Jul 2019 23:03:57 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:39666 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390400AbfGTDD5 (ORCPT ); Fri, 19 Jul 2019 23:03:57 -0400 Received: from chiana.gaikai.org (unknown [100.42.98.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: chutzpah) by smtp.gentoo.org (Postfix) with ESMTPSA id AFED4348118 for ; Sat, 20 Jul 2019 03:03:56 +0000 (UTC) From: Patrick McLean To: linux-trace-devel@vger.kernel.org Subject: [PATCH 4/4] trace-cmd: Set SONAME on shared libraries Date: Fri, 19 Jul 2019 20:03:44 -0700 Message-Id: <20190720030344.1991393-5-chutzpah@gentoo.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190720030344.1991393-1-chutzpah@gentoo.org> References: <20190720030344.1991393-1-chutzpah@gentoo.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Patrick McLean Currently trace-cmd installs some shared libraries, but does not set a SONAME on these. This often violates distro policies, so it should at least set something. This patch sets it to the name of the file, which is somewhat naieve, but works for many libraries. Generally it should be set to have an ABI version as the extension, so when the developer breaks ABI, they can change the soname. Signed-off-by: Patrick McLean --- scripts/utils.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils.mk b/scripts/utils.mk index 260023a..9eb127d 100644 --- a/scripts/utils.mk +++ b/scripts/utils.mk @@ -54,7 +54,7 @@ do_build_static_lib = \ do_compile_shared_library = \ ($(print_shared_lib_compile) \ - $(CC) --shared $^ -o $@) + $(CC) --shared $^ -Wl,-soname,$@ -o $@) do_compile_plugin_obj = \ ($(print_plugin_obj_compile) \