From patchwork Wed Mar 11 22:30:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 449218 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 1E7481400D5 for ; Thu, 12 Mar 2015 09:30:33 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=DeZ48AUh; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6059A920F5; Wed, 11 Mar 2015 22:30:32 +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 9x5AQX2XlXXL; Wed, 11 Mar 2015 22:30:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id DA32E920ED; Wed, 11 Mar 2015 22:30:30 +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 302211C1EF7 for ; Wed, 11 Mar 2015 22:30:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 09C93920F4 for ; Wed, 11 Mar 2015 22:30:29 +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 2MDqaUEKmdGU for ; Wed, 11 Mar 2015 22:30:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1125E92106 for ; Wed, 11 Mar 2015 22:30:27 +0000 (UTC) Received: by wiwh11 with SMTP id h11so15592745wiw.5 for ; Wed, 11 Mar 2015 15:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=KYiebajHKa/NnLLULU6dwa+tguj2K3q5hv18ZmCNsEE=; b=DeZ48AUhZRPbDkb9Ux/g1VD+jM7xNPNlxbxEC9KdntT6ZU8t0jYaM/QCqmv1yK/oTD 4LXThN9vK5ezO+IIisoxanv6UhXj5SfcBHja7RCvvrLWWB5v5iCl6ymJIqBQ0mW0yD/d ZtmEkT3ifNHlLztJ2Ym89HkXXQboUi+KaCZa+2zYALmCABBNcoMH7AO1SjCHNadujpfN HzgChxQGuXI7HiAO4WXarWZYhmNipyhcYX/irnmXwnxgsx6LnU8OktShB1MGuI3RDgZJ pM9JpDtY6AhRHhnNQbwhnnTlGBn1C0FN0xQqDU75BAx7+QN92uZ+PEm4qIYEtdevVTXw ErfQ== X-Received: by 10.194.94.164 with SMTP id dd4mr83516504wjb.56.1426113025803; Wed, 11 Mar 2015 15:30:25 -0700 (PDT) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by mx.google.com with ESMTPSA id b4sm26678464wic.2.2015.03.11.15.30.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Mar 2015 15:30:25 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Wed, 11 Mar 2015 23:30:16 +0100 Message-Id: <81a97adbcd73d9ddc9a232d59f8751996148889b.1426112628.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH 1/7] package infra: print the name of the package being parsed X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 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" Currently, our start-up time is far from being null. This is because we have 1500 packages that may each define or amend north of 60 variables (either directly in their .mk, as well as through the package macros). This is very harsh on make, which handles variables in hash tables. So, our startup time can be up to a few seconds, and there is not much we can do about that. What's even not very encouraging, is that there is no feedback to the user that we are actually doing something. Just print a message for each package we scan, so the user is aware something is going on. From a clean, out-of-tree directory, prepare with: make $(pwd)/build/buildroot-config/{,m}conf to have the configurators not impact the measurements. Then run in sequence: before after make help 0.201 0.202 make defconfig 0.260 0.263 make help 2.976 0.984 make oldconfig 0.260 0.271 (rough average of ~4 runs each) For the first 'make help', there's no .config, and hence we do not scan the packages' .mk, and we are 'fast'. For the second 'make help', there is a .config file, and we scann all packages' .mk file, and we are 'slow'. This patch has no virtually impact on the time it takes to process the packages' .mk files. Signed-off-by: "Yann E. MORIN" --- Makefile | 6 ++++++ package/pkg-generic.mk | 3 +++ package/pkg-utils.mk | 3 +++ 3 files changed, 12 insertions(+) diff --git a/Makefile b/Makefile index af043a3..e816b26 100644 --- a/Makefile +++ b/Makefile @@ -372,6 +372,9 @@ ifneq ($(BR2_DEPRECATED),y) include Makefile.legacy endif +# Just print one line, as scanning packages rewinds one line back +$(info .) + include package/Makefile.in include support/dependencies/dependencies.mk @@ -397,6 +400,9 @@ include fs/common.mk include $(BR2_EXTERNAL)/external.mk +# Clear last "Scanning package foo" line +$(info $(TERM_UP_KILL)Done scanning packages.) + TARGETS_SOURCE := $(patsubst %,%-source,$(TARGETS)) TARGETS_DIRCLEAN := $(patsubst %,%-dirclean,$(TARGETS)) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index c1b379b..ad4831b 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -305,6 +305,9 @@ endef define inner-generic-package +# Inform user something is happening... +$$(info $(TERM_UP_KILL)Scanning package $(1)) + # Define default values for various package-related variables, if not # already defined. For some variables (version, source, site and # subdir), if they are undefined, we try to see if a variable without diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index 7eddc47..bee314b 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -81,6 +81,9 @@ MESSAGE = echo "$(TERM_BOLD)>>> $($(PKG)_NAME) $($(PKG)_VERSION) $(call qstrip,$ TERM_BOLD := $(shell tput smso) TERM_RESET := $(shell tput rmso) +# Cursor one line up, start of line, erase line +TERM_UP_KILL := $(shell printf "\033[1A\r\033[K") + # Utility functions for 'find' # findfileclauses(filelist) => -name 'X' -o -name 'Y' findfileclauses = $(call notfirstword,$(patsubst %,-o -name '%',$(1)))