Received: by 10.213.65.68 with SMTP id h4csp899598imn; Tue, 27 Mar 2018 10:49:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Knc/zOHGboSr+PIEBRsz6HvVziBljyaONrLSMKzfmB2I3h2pbrFPN+XV/O+8IL68gk5vm X-Received: by 10.98.236.86 with SMTP id k83mr240301pfh.84.1522172984653; Tue, 27 Mar 2018 10:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522172984; cv=none; d=google.com; s=arc-20160816; b=sQBheAlU17s7+gmEd1cNLym489n5Dr1ftNY2iSQISNOfGoeqKcAcDZXzXjjqy3tKZN RKNrG/PczkulM5Ssoda9Z3tI4WqaXxqkEwXyrC7b5ijJsG/IY+KGx8wfw+9pyx0IuwRx cu0e8gOgVkh72BIahKYdHFv7rfogN9fhZeIa6HwCJ7gn2cXGi3fVz2PpjHa92MU3nPDG Gn9fx+2BlMGlyLRl0r33foiFjlFvZwdgWnOSHogQRllueJlti5d7jw6fTfvEQD+Zw1VJ CWaF70G1eotEEGZKPgI10+RLQc9xphgW/XP/PHHtzvEZ8bH0IHwTg8QkmRaCWraOfZP1 Lmug== 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=3iy1qtuTmEiqY7bpOqwNHUsNB7yi8yYKnu7rZ192oic=; b=MoXSXYU9fDLt0HqZVQj7exTuUwHIUaUPxCAjUf9DJ57kjrEC/t2KzSLFnCPfV1sKfA XPsjAv1xhQhxiqHPR5eaYFu9fcyjS2QDdDGuUyVQfskx4jljI9h+/UP2ec3+6eyCEUCU q+V+b9nYnH4pd9oN4LhP4XNR1wNuwUwinDC/njLFWKyidL8as809Fov9ZP/3l4yQQS23 CjrEXPIQ7hhiJqhrBHD/88iHeZjwbuPsBUkpV0DKRhrZVUTZ1vB8AJYmftuM8ZbidkIZ miiJSRT/8QjcKQQEmaQEPbY67k20+SI7vTDY+L5Vv9xjoltixvQCcIVXUiKZ6VI+Ixly t+GQ== 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 m11-v6si1554512pls.337.2018.03.27.10.49.30; Tue, 27 Mar 2018 10:49:44 -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 S1753717AbeC0Rrw (ORCPT + 99 others); Tue, 27 Mar 2018 13:47:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43546 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753770AbeC0Qcs (ORCPT ); Tue, 27 Mar 2018 12:32:48 -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 0EA9E10C9; Tue, 27 Mar 2018 16:32:47 +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.9 55/67] perf stat: Fix CVS output format for non-supported counters Date: Tue, 27 Mar 2018 18:27:47 +0200 Message-Id: <20180327162730.617255686@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162726.702411083@linuxfoundation.org> References: <20180327162726.702411083@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.9-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 @@ -876,7 +876,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);