Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1391926imm; Wed, 6 Jun 2018 15:29:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK6Hcv7ov1uI0zDPOxKnUrY7M8Aw9D+j9quprOeggGhTiG3wYubswTH18g23V5SXzCpXGND X-Received: by 2002:a17:902:341:: with SMTP id 59-v6mr4906194pld.349.1528324154312; Wed, 06 Jun 2018 15:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528324154; cv=none; d=google.com; s=arc-20160816; b=Ouh+by8+uq/GKXzEB+5NEc/afcTK6ePoM1lo1u+HjAXNjhPLh0VUNpcY3lSubWVaIE 6L/ycR9k2/WlO7SQgaX14AY+Pmrx5JaglzHfU4WQCnGAAf34fHEKgWL2QTeDMrxQETez vDCLNUjXB5gS8WFK1UWJS/MZLH0MT75GprIH9D0AsKXg5pYY7NZdwsiAdJannDnI5nqL 2v0/xPOZ+Hcm1aZPRqtVOw6/y3SiFZg6buQy8huBLgPV/0URqkYchgKZYGviLWjxPJcL Rloy1jAqnuJLUkZoPurV6oNftIdxR2QCoUV4TRvIO1OUoIQ7wvrFEe16WiaZKYpZzldx 3/YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=w+Q640wHU3RCusULSwi1AUfYiXbIy9bKt9w5GmHzo8Q=; b=yhO5PB8tz+yHe+XHOAUHna8Bms1qJDmLyMbu9LxDZfJBPrk8vzD6ZgK+FHnZl5KGYk +wOPTizTckbWkgK60aC3tY6UoKCNYYVW+uvQyH6f1vDNht2GH5u25aAAcyyoliwU23bv iPR5m6BLSaDyE4mzCYlDmg2rfJ7SZkVt0oC4+OALhHBP/Gi8eTDONIyrLqQPooA1IIxb Fid9U8RJEj42vRHIzT6qoy/EhkkdyBAe32ZpH/TsspIWkvysyEf/kRoPFIws1AalI2ar e7lNdOtm6lsYwF84vzFAPTLdE0bGcYCOLcCIFp4p9HUaVc0ut/SMV1jItHwdR0v6XdND 5BDQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 75-v6si16500169pfw.130.2018.06.06.15.28.59; Wed, 06 Jun 2018 15:29:14 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752873AbeFFWPn (ORCPT + 99 others); Wed, 6 Jun 2018 18:15:43 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33590 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752336AbeFFWPb (ORCPT ); Wed, 6 Jun 2018 18:15:31 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8DDF1401EF1A; Wed, 6 Jun 2018 22:15:30 +0000 (UTC) Received: from krava.redhat.com (ovpn-204-89.brq.redhat.com [10.40.204.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0820F2026DEF; Wed, 6 Jun 2018 22:15:27 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo , Peter Zijlstra Cc: lkml , Ingo Molnar , Namhyung Kim , David Ahern , Alexander Shishkin , Stephane Eranian , Milian Wolff , Andi Kleen , Frederic Weisbecker Subject: [PATCH 04/10] perf stat: Use only color_fprintf call in print_metric_only Date: Thu, 7 Jun 2018 00:15:07 +0200 Message-Id: <20180606221513.11302-5-jolsa@kernel.org> In-Reply-To: <20180606221513.11302-1-jolsa@kernel.org> References: <20180606221513.11302-1-jolsa@kernel.org> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 06 Jun 2018 22:15:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 06 Jun 2018 22:15:30 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@kernel.org' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We can call color_fprintf also for non color case, it's handled properly. This change simplifies following patch. Link: http://lkml.kernel.org/n/tip-496k3c59ckl2z7yrhnv6ln73@git.kernel.org Signed-off-by: Jiri Olsa --- 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 067d8b5b2c83..0b1ddd5ef05d 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)) -- 2.13.6