From patchwork Fri Feb 21 08:56:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 11395845 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E579C17F0 for ; Fri, 21 Feb 2020 08:56:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEB6F2071E for ; Fri, 21 Feb 2020 08:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730035AbgBUI4f (ORCPT ); Fri, 21 Feb 2020 03:56:35 -0500 Received: from s3.sipsolutions.net ([144.76.43.62]:54726 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727859AbgBUI4f (ORCPT ); Fri, 21 Feb 2020 03:56:35 -0500 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1j546r-00EncU-5y; Fri, 21 Feb 2020 09:56:33 +0100 From: Johannes Berg To: backports@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 08/15] gentree: add timing info to git debug commit message Date: Fri, 21 Feb 2020 09:56:17 +0100 Message-Id: <20200221095437.1c19e55f2a34.If8a190b493b67963db290f8b6a69c8907f70d9bf@changeid> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200221085624.6213-1-johannes@sipsolutions.net> References: <20200221085624.6213-1-johannes@sipsolutions.net> MIME-Version: 1.0 Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org From: Johannes Berg This is useful to see where we spend most time. Signed-off-by: Johannes Berg --- gentree.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gentree.py b/gentree.py index 3273eedec928..8fdf34c60f7e 100755 --- a/gentree.py +++ b/gentree.py @@ -4,7 +4,7 @@ # import argparse, sys, os, errno, shutil, re, subprocess -import tarfile, gzip +import tarfile, gzip, time # find self source_dir = os.path.abspath(os.path.dirname(__file__)) @@ -305,12 +305,17 @@ def git_debug_init(args): git.commit_all("Copied backport", tree=args.bpid.project_dir) +prevtime = None def git_debug_snapshot(args, name): """ Take a git snapshot for the debugging. """ if not args.gitdebug: return + global prevtime + if prevtime is not None: + name += "\n\n(took %.2f seconds)\n" % (time.time() - prevtime) + prevtime = time.time() git.commit_all(name, tree=args.bpid.project_dir) def get_rel_spec_stable(rel):