From patchwork Wed Jun 15 08:45:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 70095 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2454614qgf; Wed, 15 Jun 2016 01:45:29 -0700 (PDT) X-Received: by 10.66.251.2 with SMTP id zg2mr2720299pac.32.1465980329266; Wed, 15 Jun 2016 01:45:29 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zk17si10231842pab.0.2016.06.15.01.45.28; Wed, 15 Jun 2016 01:45:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753463AbcFOIpU (ORCPT + 30 others); Wed, 15 Jun 2016 04:45:20 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:33766 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752574AbcFOIpQ (ORCPT ); Wed, 15 Jun 2016 04:45:16 -0400 Received: by mail-lf0-f49.google.com with SMTP id f6so7924088lfg.0 for ; Wed, 15 Jun 2016 01:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=gUXG0k/WsSi0DjutRBVCp903sXg847ABO8TYksKBqG4=; b=UL4Vu80As4bkc3qadirOie7lC5iSmpqR0pIXJFyi5T/a9MlH1+6eENZ7b+hfJdsU0y YFfmnW/90sxzSjL7wT2pdeF1an51VERITVOy5i/hyLUPbFlWa9qH8S8oJTL1jEa6y6/M GLd3cG6IL3fWP1XOkYis6wuplJrq0j8HO925Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gUXG0k/WsSi0DjutRBVCp903sXg847ABO8TYksKBqG4=; b=HBCAa4fRUrNdTDKnfKq9ihppo9jw/LKABh3QJnV4Vv+Iv9uh13Eet+JdLWuohf4do6 f+/jDrnSKuCr7qtoMADmrOw+uH8jv8AwDKwGtEx0VdF3G98/VByOigvULSlwr6Sr114F i8I/zkWbpMSxUpfHdk0mWquc34DaPwge9kEhbcaJOIFR2cpgRZxRC4Iw/4WiCoa2af9y e8xRx3yMUUDSIHiTg/HV/pUYnte+homJIL4ZZfdX3F7hUlWr9gK3PUkfTwMaSK1wqFxp quap0cJLQZYwdyTR5bB8aqC0xgPol99re/tJA71gawRdStkulCGwpfmnL2YkAES/bac3 ZI9Q== X-Gm-Message-State: ALyK8tIgUEZINHIaCy8WsF+jHFe/nkeK32ta2sbpwHkReqkK2WyVf1NqoJPx75UhzuD1SbUO X-Received: by 10.25.24.207 with SMTP id 76mr2736022lfy.187.1465980314787; Wed, 15 Jun 2016 01:45:14 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id m6sm1282930lbp.38.2016.06.15.01.45.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Jun 2016 01:45:14 -0700 (PDT) From: Riku Voipio To: linux-kernel@vger.kernel.org, Andrew Morton Cc: Riku Voipio , Vineet Gupta , Josh Triplett , Michal Marek Subject: [PATCH] scripts/bloat-o-meter: fix percent on <1% changes Date: Wed, 15 Jun 2016 11:45:11 +0300 Message-Id: <1465980311-23814-1-git-send-email-riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Python divisions are integer divisions unless at least one parameter is a float. The current bloat-o-meter fails to print sub-percentage changes: Total: Before=10515408, After=10604060, chg 0.000000% Force float division by using one float and pretty the print to two significant decimals: Total: Before=10515408, After=10604060, chg +0.84% Signed-off-by: Riku Voipio Cc: Vineet Gupta Cc: Josh Triplett Cc: Michal Marek --- scripts/bloat-o-meter | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.1.4 diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter index 0254f3b..19f5adf 100755 --- a/scripts/bloat-o-meter +++ b/scripts/bloat-o-meter @@ -67,5 +67,5 @@ print("%-40s %7s %7s %+7s" % ("function", "old", "new", "delta")) for d, n in delta: if d: print("%-40s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d)) -print("Total: Before=%d, After=%d, chg %f%%" % \ - (otot, ntot, (ntot - otot)*100/otot)) +print("Total: Before=%d, After=%d, chg %+.2f%%" % \ + (otot, ntot, (ntot - otot)*100.0/otot))