From patchwork Sun Jan 6 15:22:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 209765 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 70B312C0084 for ; Mon, 7 Jan 2013 02:23:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 240C530EAB; Sun, 6 Jan 2013 15:23:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id peIcVe-WVo1y; Sun, 6 Jan 2013 15:23:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id DA56830EB4; Sun, 6 Jan 2013 15:23:23 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id C128A8F753 for ; Sun, 6 Jan 2013 15:23:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AB46E8B28B for ; Sun, 6 Jan 2013 15:23:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9wEDKvTRteN3 for ; Sun, 6 Jan 2013 15:23:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [94.23.32.191]) by whitealder.osuosl.org (Postfix) with ESMTP id 799CD80810 for ; Sun, 6 Jan 2013 15:23:10 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 1148A161; Sun, 6 Jan 2013 16:23:10 +0100 (CET) Received: from localhost (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id 81FC9138 for ; Sun, 6 Jan 2013 16:23:09 +0100 (CET) From: Thomas Petazzoni To: buildroot@busybox.net Date: Sun, 6 Jan 2013 16:22:45 +0100 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Subject: [Buildroot] [PATCH 05/15] perf: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net This patch adds a new package that allows to build the 'perf' userspace tool that comes in the tools/perf directory of the kernel sources. It is an alternative proposal to the one done by Kaiwan Billimoria , in that it creates the package in package/perf/. It therefore properly integrates with the Buildroot package infrastructure. Of course, the package depends on the Linux kernel to be built by Buildroot, in order to get Perf sources matching the version of the kernel that will be executed. Signed-off-by: Thomas Petazzoni --- package/Config.in | 1 + package/perf/Config.in | 22 ++++++++++++++++++++++ package/perf/perf.mk | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 package/perf/Config.in create mode 100644 package/perf/perf.mk diff --git a/package/Config.in b/package/Config.in index 0cf0a2b..0584462 100644 --- a/package/Config.in +++ b/package/Config.in @@ -35,6 +35,7 @@ source "package/ltrace/Config.in" source "package/memstat/Config.in" source "package/netperf/Config.in" source "package/oprofile/Config.in" +source "package/perf/Config.in" source "package/ramspeed/Config.in" source "package/rt-tests/Config.in" source "package/strace/Config.in" diff --git a/package/perf/Config.in b/package/perf/Config.in new file mode 100644 index 0000000..54b24fe --- /dev/null +++ b/package/perf/Config.in @@ -0,0 +1,22 @@ +config BR2_PACKAGE_PERF + bool "perf" + depends on BR2_LINUX_KERNEL + depends on BR2_LARGEFILE + help + perf (sometimes "Perf Events" or perf tools, originally + "Performance Counters for Linux") - is a performance + analyzing tool in Linux, available from kernel version + 2.6.31. User-space controlling utility, called 'perf' has + git-like interface with subcommands. It is capable of + statistical profiling of entire system (both kernel and user + code), single CPU or severals threads. + + This package builds and install the userspace 'perf' + command. It is up to the user to ensure that the kernel + configuration has all suitable options enable to allow a + proper operation of 'perf'. + + https://perf.wiki.kernel.org/ + +comment "perf only available if Linux kernel is enabled, and requires largefile support" + depends on !BR2_LINUX_KERNEL || !BR2_LARGEFILE diff --git a/package/perf/perf.mk b/package/perf/perf.mk new file mode 100644 index 0000000..2aef900 --- /dev/null +++ b/package/perf/perf.mk @@ -0,0 +1,39 @@ +############################################################# +# +# perf +# +############################################################# + +# Source taken from the Linux kernel tree +PERF_SOURCE = +PERF_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION)) + +PERF_DEPENDENCIES = linux + +PERF_MAKE_FLAGS = \ + $(LINUX_MAKE_FLAGS) \ + NO_LIBELF=1 \ + NO_DWARF=1 \ + NO_LIBAUDIT=1 \ + NO_NEWT=1 \ + NO_GTK2=1 \ + NO_LIBPERL=1 \ + NO_LIBPYTHON=1 \ + DESTDIR=$(TARGET_DIR) \ + prefix=/usr \ + WERROR=0 + +define PERF_BUILD_CMDS + $(MAKE) -C $(LINUX_DIR)/tools/perf \ + $(PERF_MAKE_FLAGS) O=$(@D) +endef + +# After installation, we remove the Perl and Python scripts from the +# target. +define PERF_INSTALL_TARGET_CMDS + $(MAKE) -C $(LINUX_DIR)/tools/perf \ + $(PERF_MAKE_FLAGS) O=$(@D) install + $(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/ +endef + +$(eval $(generic-package))