Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5961035rwb; Mon, 5 Dec 2022 06:22:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf54Bs/gSSzuEGL5ize0hlEHQTgWmRCk9hnRsN4bt/gFG5MZYZ7dmvwy0WU0IJhhXcuVClcm X-Received: by 2002:a17:906:7215:b0:78d:a7f0:e232 with SMTP id m21-20020a170906721500b0078da7f0e232mr69289791ejk.9.1670250139213; Mon, 05 Dec 2022 06:22:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670250139; cv=none; d=google.com; s=arc-20160816; b=lWc7eYDp7KIQxYe8sHYT2NscEYfTmXOKzo3wGJfr9jvF+OL0rxjybksgSVh4D4vjeV 4HCHH9dbxjxSqDEohN34WeJqL05XERK+cA5B2qT/YOIOSV176AIeAMCJDbj/g5aCDfVH JZH60FVV5fOaK4laLAd6t/7+gYNphNVcXQV+NqWER5ydzpPrhlI84kzIxSlJ1StGj/nP dkQQc/Qozg2gWi1F3HZZkE2dBJeXQOCtke2GKgNVJD8l2PDa0WFTEu+BmQI28ED3DSoX 9yrOi/Bq7I0wGBnusIdH0n1M3V3bRYHLgikzRkpywiILWASiogtKbfJG6Hknwkhalgea KQAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pLfnScMjrysvcfeUEljIAFryuehR924m3j1NvYmvbng=; b=LBdvgkGJqoDbExuN/pmshCObicosoJKutvvIm+BqlIAoSjJLM3Lv3R4sYLoTGOeuTO wN2oSRUmA2/G0Dx+9U1R1kCsBIQKgr8B5xWNrZcSRAhEFsPsgYZ78L4BMOYL5XryS7P1 B97wSGawwteDRxF3x5c7UWGfLho3uWOGjhZ6tr7Mq7vn1/65WL0I3AD/3KGI2xevjHgp 8inU4LtKrsK+uzmj0f6L46IlnUC+3Ns4o4fFx/FQhWB4PBS4uTugSPCUj9/m2nGTrJKS R2N0lje30ChtTCFvnjnDCO5AJbAFuNCVWFNGtf8PfLZkOzd5itQGKCuYiF0XXnQnddox 5bKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mnPeEla3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb27-20020a170907961b00b007c0c9bd6211si8107729ejc.357.2022.12.05.06.21.59; Mon, 05 Dec 2022 06:22:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mnPeEla3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232053AbiLENDp (ORCPT + 81 others); Mon, 5 Dec 2022 08:03:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231579AbiLENDn (ORCPT ); Mon, 5 Dec 2022 08:03:43 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38B2717076; Mon, 5 Dec 2022 05:03:39 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DD508B80F79; Mon, 5 Dec 2022 13:03:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C79DC433D6; Mon, 5 Dec 2022 13:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670245416; bh=Quf8sZ9+qKyYMVb9fzP+lHM/3KdkQrgRIaq463QOEqs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mnPeEla3sDLBZSYO61/ydsUn2P/Tr91kbJ+GSZTiOUrs9nA6IwjkQj1QrIUqDwxgr E36EfikIxwS3d2OsMWeoY43FguQ+Akvy0RlH3MeXKqqruOoAknH5jljzhr30OKjy02 PZzq50RMCu0KLCA6472I9kX66T0kDlUSVXG5ylKzdlcTGOiLSRunSNjCjqhdsGpJhY iy+BGA7ZfouBBIQGjozOiBCRGfPcbpSu+5OJstmCK7bY/FDpKlpL3t6EYa+wm2jHGc V450oEKFy7w78OSDdr3obgQLmM6CSbwTaABz2Y4pDTEse7NR68OCMH9fZ7BbMP4gwE puqaRHd3bRSrA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 4B26940404; Mon, 5 Dec 2022 10:03:34 -0300 (-03) Date: Mon, 5 Dec 2022 10:03:34 -0300 From: Arnaldo Carvalho de Melo To: "Wang, Weilin" Cc: Namhyung Kim , Jiri Olsa , Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , "Hunter, Adrian" , "linux-perf-users@vger.kernel.org" , Kan Liang , Zhengjun Xing , James Clark , Athira Jajeev Subject: Re: [PATCH] perf stat: Fix multi-line metric output in JSON Message-ID: References: <20221202190447.1588680-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Dec 02, 2022 at 07:31:59PM +0000, Wang, Weilin escreveu: > Namhyung, it works. Thanks! Thanks, applied and added a Tested-by: Weilin, ok? - Arnaldo > -----Original Message----- > From: Namhyung Kim On Behalf Of Namhyung Kim > Sent: Friday, December 2, 2022 11:05 AM > To: Arnaldo Carvalho de Melo ; Jiri Olsa > Cc: Ingo Molnar ; Peter Zijlstra ; LKML ; Ian Rogers ; Hunter, Adrian ; linux-perf-users@vger.kernel.org; Kan Liang ; Zhengjun Xing ; James Clark ; Athira Jajeev ; Wang, Weilin > Subject: [PATCH] perf stat: Fix multi-line metric output in JSON > > When a metric produces more than one values, it missed to print the opening bracket. > > Fixes: ab6baaae2735 ("perf stat: Fix JSON output in metric-only mode") > Reported-by: "Wang, Weilin" > Signed-off-by: Namhyung Kim > --- > Weilin, could you please verify it fixes your problem? > > tools/perf/util/stat-display.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index f1ee4b052198..8d0bdd57163d 100644 > --- a/tools/perf/util/stat-display.c > +++ b/tools/perf/util/stat-display.c > @@ -440,7 +440,7 @@ static void new_line_json(struct perf_stat_config *config, void *ctx) { > struct outstate *os = ctx; > > - fputc('\n', os->fh); > + fputs("\n{", os->fh); > if (os->prefix) > fprintf(os->fh, "%s", os->prefix); > aggr_printout(config, os->evsel, os->id, os->nr); > -- > 2.39.0.rc0.267.gcb52ba06e7-goog -- - Arnaldo