From patchwork Mon Apr 2 14:02:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 894206 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=metanate.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=metanate.com header.i=@metanate.com header.b="Xpajb3At"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40FDT4308Fz9ryG for ; Tue, 3 Apr 2018 00:03:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EC3CB8011C; Mon, 2 Apr 2018 14:02:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v62ZiVmIrgQ5; Mon, 2 Apr 2018 14:02:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6B4E0805AE; Mon, 2 Apr 2018 14:02:58 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 57BDB1C0359 for ; Mon, 2 Apr 2018 14:02:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 507818958C for ; Mon, 2 Apr 2018 14:02:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HNS9uFGjqqkz for ; Mon, 2 Apr 2018 14:02:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from metanate.com (dougal.metanate.com [90.155.101.14]) by whitealder.osuosl.org (Postfix) with ESMTPS id 4F5D18959B for ; Mon, 2 Apr 2018 14:02:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References :In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8k2P0yUWE56gSy2gm0W8Th45LxdNp9rFnGzqI5WQyp8=; b=Xpajb3At6M05/hVR8CIVHs9BpV 6c/cRKhQUBT8BmdNQkm4wcuuz1pWFYtWUTvivlpTZ2m5NySv7yF2mFfw8L0w81XslN091on9uSa7L q2J1Dw+Ug2kFXuOqh21GUvfaG1TPSNPfuPuiPBWtERCcj2ekwUSSb1naE9hgDyUW8dD2Py0GyGPVa 8Gms1mJDcVoyERZFepQ5OMDgTvdIBwsfnRG0sZ6/Fq2MbI3mGw8SEUsoo+qoUeKCawTuVg7aL77uk p2LDaIv625WF1ACV50zcwo/vWREUds4yzE7evcZyOpwGShmMXP8dBNd3CxGdI01OxgGKQS4sj5wjG STrvr7Sg==; Received: from johnkeeping.plus.com ([81.174.171.191] helo=localhost.localdomain) by shrek.metanate.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1f302v-0001qs-43; Mon, 02 Apr 2018 15:02:53 +0100 Date: Mon, 2 Apr 2018 15:02:49 +0100 From: John Keeping To: "Yann E. MORIN" Message-ID: <20180402150249.7f4e70f1.john@metanate.com> In-Reply-To: <20180402130716.GM3625@scaer> References: <20180402125145.13431-1-john@metanate.com> <20180402130716.GM3625@scaer> Organization: Metanate Ltd X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2] linux-tool-perf: permit TUI build X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: buildroot@buildroot.org Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Since Linux 3.10, perf's NO_NEWT configuration option simply sets NO_SLANG=1 and there is no dependency on libnewt. We already handle NO_SLANG correctly based on whether or not BR2_PACKAGE_SLANG is selected, so all we accomplish by setting NO_NEWT=1 is disabling perf's TUI when all of the dependencies are available. To simplify all of this, introduce a new config option to enable the perf TUI which depends on slang and add a check to prevent building the TUI on versions which are too old. The check for NO_SLANG is equivalent to checking if NO_NEWT is required as NO_SLANG was added in the same commit that removed the libnewt dependency and deprecated NO_NEWT (6692c262df4f, "perf tools: Remove dependency on libnewt", 2013-03-28). Signed-off-by: John Keeping --- On Mon, 2 Apr 2018 15:07:16 +0200, Yann E. MORIN wrote: > On 2018-04-02 13:51 +0100, John Keeping spake thusly: > > Since Linux 3.10, perf's NO_NEWT configuration option simply sets > > NO_SLANG=1 and there is no dependency on libnewt. > > > > We already handle NO_SLANG correctly based on whether or not > > BR2_PACKAGE_SLANG is selected, so all we accomplish by setting NO_NEWT=1 > > is disabling perf's TUI when all of the dependencies are available. > > > > Linux 3.10 is almost 5 years old now, so there doesn't seem to be any > > point in jumping through additional hoops to make perf from older kernel > > versions build when the newt package is not available. > > But we still support kernels back to 3.0... > > I would instead suggest you add an option in > package/linux-tools/Config.in: > > config BR2_PACKAGE_LINUX_TOOLS_PERF_TUI > > And do a check in package/linux-tools/linux-tool-perf.mk.in whether it > is valid o not, if needed. Something like this? I can't see a neater way of checking the version dependency and this matches the existing handling of the elfutils dependency. package/linux-tools/Config.in | 12 ++++++++++++ package/linux-tools/linux-tool-perf.mk.in | 12 +++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in index e3ccd850f9..1d31ce84f1 100644 --- a/package/linux-tools/Config.in +++ b/package/linux-tools/Config.in @@ -54,6 +54,18 @@ config BR2_PACKAGE_LINUX_TOOLS_PERF https://perf.wiki.kernel.org/ +if BR2_PACKAGE_LINUX_TOOLS_PERF + +config BR2_PACKAGE_LINUX_TOOLS_PERF_TUI + bool "enable perf TUI" + select BR2_PACKAGE_SLANG + help + Enable the TUI interface for perf which requires a TTY and + enables zooming into DSOs and threads as well as other + features. + +endif + config BR2_PACKAGE_LINUX_TOOLS_SELFTESTS bool"selftests" depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # bash diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in index 69492ba8da..80e00c3c56 100644 --- a/package/linux-tools/linux-tool-perf.mk.in +++ b/package/linux-tools/linux-tool-perf.mk.in @@ -22,7 +22,6 @@ PERF_MAKE_FLAGS = \ prefix=/usr \ WERROR=0 \ NO_LIBAUDIT=1 \ - NO_NEWT=1 \ NO_GTK2=1 \ NO_LIBPERL=1 \ NO_LIBPYTHON=1 \ @@ -59,10 +58,10 @@ ifeq ($(BR2_arc),y) PERF_MAKE_FLAGS += NO_BACKTRACE=1 endif -ifeq ($(BR2_PACKAGE_SLANG),y) +ifeq ($(BR2_PACKAGE_LINUX_TOOLS_PERF_TUI),y) PERF_DEPENDENCIES += slang else -PERF_MAKE_FLAGS += NO_SLANG=1 +PERF_MAKE_FLAGS += NO_NEWT=1 NO_SLANG=1 endif ifeq ($(BR2_PACKAGE_LIBUNWIND),y) @@ -128,6 +127,13 @@ define PERF_BUILD_CMDS fi \ fi \ fi + $(Q)if test "$(BR2_PACKAGE_LINUX_TOOLS_PERF_TUI)" = "y" ; then \ + if ! grep -q NO_SLANG $(LINUX_DIR)/tools/perf/Makefile* ; then \ + echo "The perf tool in your kernel cannot be build with the TUI." ; \ + echo "Either upgrade your kernel to >= 3.10, or disable the TUI." ; \ + exit 1 ; \ + fi \ + fi $(TARGET_MAKE_ENV) $(MAKE1) $(PERF_MAKE_FLAGS) \ -C $(LINUX_DIR)/tools/perf O=$(LINUX_DIR)/tools/perf/ endef