From patchwork Thu Apr 5 16:19:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 150991 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 1C739B706C for ; Fri, 6 Apr 2012 02:22:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C91EE904E5; Thu, 5 Apr 2012 16:22:12 +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 uV9xMP1mBjum; Thu, 5 Apr 2012 16:21:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 7B6A890881; Thu, 5 Apr 2012 16:21:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 838B58F75B for ; Thu, 5 Apr 2012 16:21:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7F3E02569E for ; Thu, 5 Apr 2012 16:21:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9gQA5nnOJLQE for ; Thu, 5 Apr 2012 16:21:17 +0000 (UTC) Received: from busybox.osuosl.org (busybox.osuosl.org [140.211.167.224]) by silver.osuosl.org (Postfix) with ESMTP id B4F0432187 for ; Thu, 5 Apr 2012 16:21:17 +0000 (UTC) Received: by busybox.osuosl.org (Postfix, from userid 4021) id A9C4B96A0C; Thu, 5 Apr 2012 16:21:17 +0000 (UTC) From: Peter Korsgaard To: buildroot@busybox.net Date: Thu, 5 Apr 2012 18:19:54 +0200 X-Git-Refname: refs/heads/master X-Git-Oldrev: eae71e805c57f2cc30291d0680b396a4e5cb9d33 X-Git-Newrev: 6a996469e270f76e663004c6f448dee08c801ad6 X-Patchwork-Hint: ignore Message-Id: <20120405162117.A9C4B96A0C@busybox.osuosl.org> Subject: [Buildroot] [git commit] valgrind: allow selecting which tools to install 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 commit: http://git.buildroot.net/buildroot/commit/?id=6a996469e270f76e663004c6f448dee08c801ad6 branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master The full valgrind installation takes more than 20 MB, while one typically does not use all of its tools. This patch adds extra config options to select which tools to install. [Peter: Don't default experimental tools to 'y' as suggested by Arnout] Signed-off-by: Thomas De Schampheleire Acked-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Peter Korsgaard --- package/valgrind/Config.in | 66 +++++++++++++++++++++++++++++ package/valgrind/valgrind.mk | 95 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 161 insertions(+), 0 deletions(-) diff --git a/package/valgrind/Config.in b/package/valgrind/Config.in index 0f656dc..dacdd86 100644 --- a/package/valgrind/Config.in +++ b/package/valgrind/Config.in @@ -6,3 +6,69 @@ config BR2_PACKAGE_VALGRIND Tool for debugging and profiling Linux programs. http://valgrind.kde.org/ + +if BR2_PACKAGE_VALGRIND + +config BR2_PACKAGE_VALGRIND_MEMCHECK + bool "Memcheck: a memory error detector" + default y + help + This option allows to install the Memcheck tool + +config BR2_PACKAGE_VALGRIND_CACHEGRIND + bool "Cachegrind: a cache and branch-prediction profiler" + default y + help + This option allows to install the Cachegrind tool + +config BR2_PACKAGE_VALGRIND_CALLGRIND + bool "Callgrind: a call-graph generating cache and branch prediction profiler" + default y + help + This option allows to install the Callgrind tool + +config BR2_PACKAGE_VALGRIND_HELGRIND + bool "Helgrind: a thread error detector" + default y + help + This option allows to install the Helgrind tool + +config BR2_PACKAGE_VALGRIND_DRD + bool "DRD: a thread error detector" + default y + help + This option allows to install the DRD tool + +config BR2_PACKAGE_VALGRIND_MASSIF + bool "Massif: a heap profiler" + default y + help + This option allows to install the Massif tool + +config BR2_PACKAGE_VALGRIND_DHAT + bool "DHAT: a dynamic heap analysis tool" + default y + help + This option allows to install the DHAT tool + +config BR2_PACKAGE_VALGRIND_PTRCHECK + bool "Ptrcheck: an experimental head, stack and global array overrun detector" + help + This option allows to install the Ptrcheck tool + +config BR2_PACKAGE_VALGRIND_BBV + bool "BBV: an experimental basic block vector generation tool" + help + This option allows to install the BBV tool + +config BR2_PACKAGE_VALGRIND_LACKEY + bool "Lackey: an example tool" + help + This option allows to install the Lackey tool + +config BR2_PACKAGE_VALGRIND_NULGRIND + bool "Nulgrind: the minimal Valgrind tool" + help + This option allows to install the Nulgrind tool + +endif diff --git a/package/valgrind/valgrind.mk b/package/valgrind/valgrind.mk index 24523bf..004c1ac 100644 --- a/package/valgrind/valgrind.mk +++ b/package/valgrind/valgrind.mk @@ -25,4 +25,99 @@ endef VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_INSTALL_UCLIBC_SUPP +ifeq ($(BR2_PACKAGE_VALGRIND_MEMCHECK),) +define VALGRIND_REMOVE_MEMCHECK + rm -f $(TARGET_DIR)/usr/lib/valgrind/*memcheck* +endef + +VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_MEMCHECK +endif + +ifeq ($(BR2_PACKAGE_VALGRIND_CACHEGRIND),) +define VALGRIND_REMOVE_CACHEGRIND + rm -f $(TARGET_DIR)/usr/lib/valgrind/*cachegrind* + for i in cg_annotate cg_diff cg_merge; do \ + rm -f $(TARGET_DIR)/usr/bin/$$i ; \ + done +endef + +VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_CACHEGRIND +endif + +ifeq ($(BR2_PACKAGE_VALGRIND_CALLGRIND),) +define VALGRIND_REMOVE_CALLGRIND + rm -f $(TARGET_DIR)/usr/lib/valgrind/*callgrind* + for i in callgrind_annotate callgrind_control ; do \ + rm -f $(TARGET_DIR)/usr/bin/$$i ; \ + done +endef + +VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_CALLGRIND +endif + +ifeq ($(BR2_PACKAGE_VALGRIND_HELGRIND),) +define VALGRIND_REMOVE_HELGRIND + rm -f $(TARGET_DIR)/usr/lib/valgrind/*helgrind* +endef + +VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_HELGRIND +endif + +ifeq ($(BR2_PACKAGE_VALGRIND_DRD),) +define VALGRIND_REMOVE_DRD + rm -f $(TARGET_DIR)/usr/lib/valgrind/*drd* +endef + +VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_DRD +endif + +ifeq ($(BR2_PACKAGE_VALGRIND_MASSIF),) +define VALGRIND_REMOVE_MASSIF + rm -f $(TARGET_DIR)/usr/lib/valgrind/*massif* + rm -f $(TARGET_DIR)/usr/bin/ms_script +endef + +VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_MASSIF +endif + +ifeq ($(BR2_PACKAGE_VALGRIND_DHAT),) +define VALGRIND_REMOVE_DHAT + rm -f $(TARGET_DIR)/usr/lib/valgrind/*dhat* +endef + +VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_DHAT +endif + +ifeq ($(BR2_PACKAGE_VALGRIND_PTRCHECK),) +define VALGRIND_REMOVE_PTRCHECK + rm -f $(TARGET_DIR)/usr/lib/valgrind/*ptrcheck* +endef + +VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_PTRCHECK +endif + +ifeq ($(BR2_PACKAGE_VALGRIND_BBV),) +define VALGRIND_REMOVE_BBV + rm -f $(TARGET_DIR)/usr/lib/valgrind/*bbv* +endef + +VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_BBV +endif + +ifeq ($(BR2_PACKAGE_VALGRIND_LACKEY),) +define VALGRIND_REMOVE_LACKEY + rm -f $(TARGET_DIR)/usr/lib/valgrind/*lackey* +endef + +VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_LACKEY +endif + +ifeq ($(BR2_PACKAGE_VALGRIND_NULGRIND),) +define VALGRIND_REMOVE_NULGRIND + rm -f $(TARGET_DIR)/usr/lib/valgrind/*none* +endef + +VALGRIND_POST_INSTALL_TARGET_HOOKS += VALGRIND_REMOVE_NULGRIND +endif + $(eval $(call AUTOTARGETS))