From patchwork Sat Mar 31 04:22:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Champetier X-Patchwork-Id: 893684 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="j/ibeHvM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UEvXSB4I"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Cljv2gL4z9s1S for ; Sat, 31 Mar 2018 15:23:56 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=p8oAbTasXcGj27gBMMWJBp86cvx4+uqxeDKHawstsJE=; b=j/ibeHvMmtSEAN AoM9KFDwJpxvA+YuH/QjJV/ESeA6b/ULvfcA5u95kjcgd+EdBljEgJUrtfq59s8iWy4dZQAIBXMNc kBYWh+W654Q87Et3t8WevfcUJ2khSfLBOCtUBl9vSLOhgLYKSk0az/aE608rgFZGPyEyrCnDeB9nD Wqph2+tP4cjdqGi5LnPZ9s2dNRg+r7NXjbBi7oh79wEiKnJpqTGfKgbRDxUZdsqF2czSVR7eqynwD dCYFDtkmDYQo1ChT3gxQKSYf1kdQHEBvtDT2fIjjSSWnJKi8TJP6AsjdgpLoX04fYVxY4UBNp64vU XL+jITffwUogxlLoC/9g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f283A-000567-Gu; Sat, 31 Mar 2018 04:23:32 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f2837-00053k-Dq for lede-dev@lists.infradead.org; Sat, 31 Mar 2018 04:23:30 +0000 Received: by mail-pf0-x241.google.com with SMTP id g14so6568083pfh.3 for ; Fri, 30 Mar 2018 21:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=OQ1q0B/qQEAlhrN53CxwyCPSbMdMRuSEuonAh1bqGPY=; b=UEvXSB4IiuqevuxWq7BdjiBbaqh44oxP+RouEy6Pyq8O4eJkQQ0A9FSGPcgWnPfkAc IZ+g9s3ERw1M2SaOLBWAvwI6VQNXGhVUSHG51lOExgBTZuqud6191GGXGgxDfoe3XkvP Ag5cNYaFyZQ0H5aq9UCL3h8xrLQ3s7+MUwSBUymZCPFs+IF6/CpFgJ2+7r/MV4xk+9G0 RPAFSCXntG0RC4k2wkNAn6Eb5oGAFTx9ybh0vrEeUGNXXOQE75sZcqDbzki0Xvr118qz 01/W+2w7c6fe5Dj3EX8dadnpet43U6yG3sK92Oxs1sgO4B0TBry0sCNUlun6TuFoiXar RbwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OQ1q0B/qQEAlhrN53CxwyCPSbMdMRuSEuonAh1bqGPY=; b=cs+/+GoKZmz2HknHDzMBza8bXRijD5naM2HngiZWKtn21UMN+nQCbaHjnZChkcxde5 PPEeYs10gekZpWJibbq1yhobN2dg9vbGqjd1yIelvdWNZ2iP7UndqCHcTOBSrT4dFSgl FVb6J87g+MVTpFDkqPNOzCjoVjT1BAISxIukSn9QVfC32cgfTdbvdrTxKynmCjpVlzyf 9cMnd6Ycux4HEl7k5xvIT9RIpWHljAsD25c0EszvLZ4IsroqEdMUV8HbwEDJ1KCIwnxE fEqfaP51GrOq5dZBOUOFcMHdLuKk/hfuPaTeL5V1Z2dd+uDgWI9o5iuCfl4Ch3WPbl2G qNZA== X-Gm-Message-State: AElRT7GrStUnhfk7sk5v9ex3kAMtuN+4awOR2NgbGJM9p7elmJofjaeE 9gUaN+Rz///uaC75j870aIqPEjcc X-Google-Smtp-Source: AIpwx496ls8idCUgtkiRXHj2tYanlRIvnndaRAiJVokxVhm6JrAkrvu/+HiVOpin23MHeaUJxM1jCw== X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr1730885plb.2.1522470197255; Fri, 30 Mar 2018 21:23:17 -0700 (PDT) Received: from echampetier.lab1.anevia.com ([2601:646:8382:42c3:7c5c:baa2:b8f7:ae45]) by smtp.gmail.com with ESMTPSA id l26sm22405384pfj.70.2018.03.30.21.23.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Mar 2018 21:23:16 -0700 (PDT) From: Etienne Champetier To: LEDE Development List Date: Fri, 30 Mar 2018 21:22:28 -0700 Message-Id: <20180331042228.7432-1-champetier.etienne@gmail.com> X-Mailer: git-send-email 2.14.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180330_212329_496774_2EAC402F X-CRM114-Status: GOOD ( 11.15 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c00:0:0:0:241 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (champetier.etienne[at]gmail.com) -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [LEDE-DEV] [PATCH] build: log time taken by each packages/steps X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Etienne Champetier MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The idea is to easily get the list of packages taking the most time to build, and see if we can improve them Use SetupHostCommand as recommended by John Signed-off-by: Etienne Champetier --- include/prereq-build.mk | 5 +++++ include/subdir.mk | 1 + 2 files changed, 6 insertions(+) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 6a423d2c7d..7d5b2f2b45 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -139,6 +139,11 @@ $(eval $(call SetupHostCommand,bzip2,Please install 'bzip2', \ $(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \ wget --version | grep GNU)) +$(eval $(call SetupHostCommand,gtime,Please install GNU 'time', \ + gtime --version 2>&1 | grep GNU, \ + /usr/bin/time --version 2>&1 | grep GNU, \ + time --version 2>&1 | grep GNU)) + $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ perl --version | grep "perl.*v5")) diff --git a/include/subdir.mk b/include/subdir.mk index 79a80528ae..546ed57ae6 100644 --- a/include/subdir.mk +++ b/include/subdir.mk @@ -43,6 +43,7 @@ log_make = \ $(if $(BUILD_LOG), \ set -o pipefail; \ mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \ + gtime -f "time:$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)\#%U\#%S\#%e" -- \ $$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \ $(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt)