Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1555875imm; Wed, 13 Jun 2018 23:24:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKIUDqIEJhmnauO+pGHSPP0OZ98OMwcfv/yowygJxvCwsWV9sBBTVpWm2AkOgp+3rUZ3Isc X-Received: by 2002:a63:89c2:: with SMTP id v185-v6mr1133513pgd.196.1528957463814; Wed, 13 Jun 2018 23:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528957463; cv=none; d=google.com; s=arc-20160816; b=HdUtkWJkA9b+fBX4YJQMb7BhI3V76hBwMPTq9UgOy3wwjK3wgwSYk+L79mhFUnRpOU OliXFG+4qKVW/MoMYU6PZ855taMkpfSn+8mD+hNgVqN1upPlAlzdXHIIklqr7xp6X/MC hnIsTdGNnLLlD2nSb5j8TtGAQd8koXqBRz+ainMdZ2NGE0bmvtOg7sbfrM0uX673+YZV 4PhCx4ZpYbIiBXV1/Z33efzdNcGGimhFL4OHceyj8HEoyRZWVRBH6VFs1sbg2HfYnYh9 26r+kr1iY1weJ4/oHOtHbaZEJL4hXhZnkRl+/j0dgYKgFoZEVuX1cHYA9Rx1EeFBBuNh Pljw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=m2SUDmPqavf3cpYLtQNzJFxIoagFS+hptqvQGlmjcrM=; b=mYOvTp3WC87eqnfKa7w2pqodL8s+jEgZ6eEbnvbKe9LLJ2HfzsTiaupYY/uwahH3g1 SMPNnQcAfq+yA1tdwVY/oNVCELpIDIJPWYJV4vGP3k8HAga6Dl4zab2wywee90dhLmUM sKdEU0PbXusOqDcJVNVtD2E3SSuFBxtfBCrc18N33YTL0Vcf1nx7WC8YVHd9FQVUmHxw eEoQGS0slMabsFy45ZHAIa/oZw87cfISvISUV07k1Sd1pRZNlJ+rmS31prTdexV2b3Yh 3NCHt9nqRD+Mtlem/WP1cB8pkLjs3DMTobBUlltTrJy33FH/YYBN2APDqK5d0qc50Gug OvMQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 133-v6si5102559pfc.21.2018.06.13.23.24.09; Wed, 13 Jun 2018 23:24:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753132AbeFNGW4 (ORCPT + 99 others); Thu, 14 Jun 2018 02:22:56 -0400 Received: from terminus.zytor.com ([198.137.202.136]:51493 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752766AbeFNGWy (ORCPT ); Thu, 14 Jun 2018 02:22:54 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w5E6MGk8763769 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 13 Jun 2018 23:22:16 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w5E6MGun763766; Wed, 13 Jun 2018 23:22:16 -0700 Date: Wed, 13 Jun 2018 23:22:16 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jiri Olsa Message-ID: Cc: linux-kernel@vger.kernel.org, milian.wolff@kdab.com, jolsa@kernel.org, peterz@infradead.org, eranian@google.com, alexander.shishkin@linux.intel.com, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, frederic@kernel.org, namhyung@kernel.org, andi@firstfloor.org, acme@redhat.com, dsahern@gmail.com Reply-To: dsahern@gmail.com, acme@redhat.com, andi@firstfloor.org, namhyung@kernel.org, frederic@kernel.org, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com, alexander.shishkin@linux.intel.com, eranian@google.com, peterz@infradead.org, jolsa@kernel.org, milian.wolff@kdab.com, linux-kernel@vger.kernel.org In-Reply-To: <20180606221513.11302-5-jolsa@kernel.org> References: <20180606221513.11302-5-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf stat: Use only color_fprintf call in print_metric_only Git-Commit-ID: b37d33edbf41b532ddd156707c037c6f4784e40b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,BAYES_00, FREEMAIL_FORGED_REPLYTO,T_DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b37d33edbf41b532ddd156707c037c6f4784e40b Gitweb: https://git.kernel.org/tip/b37d33edbf41b532ddd156707c037c6f4784e40b Author: Jiri Olsa AuthorDate: Thu, 7 Jun 2018 00:15:07 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 7 Jun 2018 15:58:13 -0300 perf stat: Use only color_fprintf call in print_metric_only We can call color_fprintf also for non color case, it's handled properly. This change simplifies following patch. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Frederic Weisbecker Cc: Milian Wolff Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180606221513.11302-5-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-stat.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index f1532e3ac7d7..9e7b6f108956 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1008,10 +1008,7 @@ static void print_metric_only(void *ctx, const char *color, const char *fmt, if (!valid_only_metric(unit)) return; unit = fixunit(buf, os->evsel, unit); - if (color) - n = color_fprintf(out, color, fmt, val); - else - n = fprintf(out, fmt, val); + n = color_fprintf(out, color ?: "", fmt, val); if (n > METRIC_ONLY_LEN) n = METRIC_ONLY_LEN; if (mlen < strlen(unit))