Received: by 10.213.65.68 with SMTP id h4csp875422imn; Tue, 27 Mar 2018 10:22:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx49rvtC5nw7sTKXuU7iua1t0T/e4I+FqfRouaKkmnLVVgPSRmtbciflOYZ2x1IuUPJzMsWcy X-Received: by 2002:a17:902:122:: with SMTP id 31-v6mr204641plb.280.1522171375625; Tue, 27 Mar 2018 10:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522171375; cv=none; d=google.com; s=arc-20160816; b=meeN/K/Bxgu7t5p4TIB10ZqYEjd4AVFyQa8VCaEKUopiDRNBW9+qtpNtJFSZtudUp8 BZNgL+pJaihb1WBx57k6BrlfCwwspDJLVqa7Gm15d7H16IkCSltVcUOKemYkREFl0Jp6 8F0Ie6kkuWegQGrromzxJ3GYj2VI6vJE7D5TZ/50SbasVgQ2lvVaJAhAB/QOio2S8BSC k32Z/VNEgbcKDSI61oedY2qGDrhmFutbJV1V0xqDOlAg16EWYb43Xao2U7pwv2gLNAPL /poEi9nAGh05EG99cqUPXfAOMzPMYugyr85A+toDydznuYg6C8FAWHcNsM/ywBXYN7fQ wxyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=9tmUA6hXdGJlHls7+cvdgpgp3M93ihV+Xbdb4+y3mXk=; b=T7A27akgm3VXYzh3KgZrxb5E0VwvL22uCB+ak/Opy/zpwiEYCdj1CrQOK37vtE2VT7 UYjwCDegToTW5+ZBOGfIGQPQIKqkSS1Q0wGYjkh7FeYY++G7Q+WH/13UYaHa2z4nqA5n iPema1Ub6XA3w4mPn/pSe+nt+Q/wByC0bG2wrtoT5jQNyi0QHHplp+FuPfbb7+/rkC+1 11z6ptr8bs0/MIP6iFIOb42CrsWXtqpuAPosuQiNWEItVT26f92rJjkoWucB7FcthdBc bZVVM6NkmeNn9wEXj6fDt/Xq0b3ZtRNuc0Cn8nDK7XiPppDkBLUoFmen9W+DE3tDsfFk w0Uw== 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 69-v6si1595024pla.390.2018.03.27.10.22.40; Tue, 27 Mar 2018 10:22:55 -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 S1755045AbeC0Qhu (ORCPT + 99 others); Tue, 27 Mar 2018 12:37:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46422 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755012AbeC0Qhq (ORCPT ); Tue, 27 Mar 2018 12:37:46 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 60AB5FDC; Tue, 27 Mar 2018 16:37:45 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilya Pronin , Jiri Olsa , Andi Kleen , Cong Wang , Arnaldo Carvalho de Melo Subject: [PATCH 4.14 088/101] perf stat: Fix CVS output format for non-supported counters Date: Tue, 27 Mar 2018 18:28:00 +0200 Message-Id: <20180327162755.455552312@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162749.993880276@linuxfoundation.org> References: <20180327162749.993880276@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ilya Pronin commit 40c21898ba5372c14ef71717040529794a91ccc2 upstream. When printing stats in CSV mode, 'perf stat' appends extra separators when a counter is not supported: ,,L1-dcache-store-misses,mesos/bd442f34-2b4a-47df-b966-9b281f9f56fc,0,100.00,,,, Which causes a failure when parsing fields. The numbers of separators should be the same for each line, no matter if the counter is or not supported. Signed-off-by: Ilya Pronin Acked-by: Jiri Olsa Cc: Andi Kleen Link: http://lkml.kernel.org/r/20180306064353.31930-1-xiyou.wangcong@gmail.com Fixes: 92a61f6412d3 ("perf stat: Implement CSV metrics output") Signed-off-by: Cong Wang Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/builtin-stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -922,7 +922,7 @@ static void print_metric_csv(void *ctx, char buf[64], *vals, *ends; if (unit == NULL || fmt == NULL) { - fprintf(out, "%s%s%s%s", csv_sep, csv_sep, csv_sep, csv_sep); + fprintf(out, "%s%s", csv_sep, csv_sep); return; } snprintf(buf, sizeof(buf), fmt, val);