Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2599421rwb; Fri, 2 Dec 2022 12:05:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf6zyq3bctJPyUQAYApE58pFhz85kzkrObNXGnu5BLVxU0rQ897Yptw3nHrhA12NqGVyQYrb X-Received: by 2002:a17:90a:2d81:b0:219:9676:fef4 with SMTP id p1-20020a17090a2d8100b002199676fef4mr3022776pjd.89.1670011535861; Fri, 02 Dec 2022 12:05:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670011535; cv=none; d=google.com; s=arc-20160816; b=U6T1IGVJl1DZBWtFnLVSlWOVthoDfuNQ9Kdg6BujnsuDqVulq2+PKChC6mygeiDkRl 0Da9RMtvOH8uOhjHQUra0wDJpa174FddgurAJM0GJhiv8c9ApxBN6atSFGmaAuFdMKBe BBlMrb3wwm5BdaZqTvIgzBAo3Zomo5xhoou0xsD4wQJpkxQc9zliqXQtRTeTWExde82/ 3KO5rVcqllSuCg24/WBCQfe+GdIQApywqOBqu4Qr82j4Ch4iNEIHr/BPb9VQtiwM8eOj Au+1UfDqB3ySsJPP8vxVelMFJ0qIaP+PNHDK9Jw8ncTg00tYMP5NbiGdGpF9SqeNEWJl 9PBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=GpCCioLM9L47vHsyUU0BFPjstz/YfKaTI+OyQ8H60AQ=; b=jY0OpkcvcugB+mRcUO3mIwJYpHl9p+gPHMgeuwITHCPdEr1Pjf/tlu4XMyigjWp81B 6l/y0evUXMEP/TfJ+gk7etJNn7G59Ik4q7U9b+UneblAu4NhY1Zh0ry7DEAcAuy8tX4W QZTFuHyJ2BKYrSL/Wk7drxHVV4dE9zH1gFToypB7T3uZTX6081VcbO0cu5I8yivRafJO o+BA0U90fMV2qrKPlrZ78hx2LNtHXGvUd/JHuaYO46Fo6JzbLqdyudM1Z3mP4LhsJt21 mHBC2cNQ72FsnUOmIu7khXzdZOPEBpW55d+xIFZ5pvHnQgxTFL/Kb8EblTklr8laCFUt bFRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SBv7vN5F; 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 f5-20020a056a00228500b0056b8f6cd527si8708192pfe.61.2022.12.02.12.05.24; Fri, 02 Dec 2022 12:05:35 -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=@gmail.com header.s=20210112 header.b=SBv7vN5F; 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 S234620AbiLBTEy (ORCPT + 82 others); Fri, 2 Dec 2022 14:04:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234497AbiLBTEw (ORCPT ); Fri, 2 Dec 2022 14:04:52 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 243EEE2545; Fri, 2 Dec 2022 11:04:52 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id l22-20020a17090a3f1600b00212fbbcfb78so9148417pjc.3; Fri, 02 Dec 2022 11:04:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=GpCCioLM9L47vHsyUU0BFPjstz/YfKaTI+OyQ8H60AQ=; b=SBv7vN5F83mWZfY6RlGdDBnby3yPJ/hp3wy0pAFNvBUn87UE0bDK/Onk50IPd8skFi 3LND9ztwqJgBiwNpR5auGoLGWI3oezYu6CKeOpeVM1INsclgFIK0Ft2ZjISzjXHK6tYX WyaDw2bj4Eab+EDabRP3jg2DA3uZAxJW0upZ9JdBYkTMjpAtJ4fKtR6zAZtX3Q22n3vf 7gkM9e+4Nczz4zjRh6ItgIK+HbuRw2ZP+2Xju5R2z2ntrC1C2qFw1PXbQPrPDLgIGsdy kK0Up0g77AfQh1nZkNRLd9PP7GXrM1pZ+27ZI4yomDQirVs9jzk2ibxqhAeNeVlAThNF abqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GpCCioLM9L47vHsyUU0BFPjstz/YfKaTI+OyQ8H60AQ=; b=wy7NtkBtpWliSHNMGAG0toubrYynTcfpNiBaoaD/Lvzdewu7lbS2SLmuloY2bv5wZv po9QqWTrMEalHaUfLx4EADrpF4BHThEcdEBF+yuogbQy94aXU8lwCkBjGYgthiw3/kBx 7i+uBRpF+7btERp75LSQ+hIpPO1RPQ7VxOJPqZOAb7je68k6jP88KVyCne/RHnAOX2v3 2SAsknek7y75Pn2aK382tVRipnBu6qAXV12ccx8CyMxKMCd8X2Wpnu0gHimcRsbv0MDj 93/wD5KcnTsveXmOzVrnCWjsJxfORGjd38YDYZxK1Ii0bWQ4XgswpAV5ToMTFRmqlSWe oZYQ== X-Gm-Message-State: ANoB5plkXle5nmUVzg5PStxwttakY0S6EpHv4A1L0ZsVQ07W/+a6K/J8 yWrnpqJ6vxTOnCN74EBWNKUQG7DckU8= X-Received: by 2002:a17:902:8503:b0:188:e49e:2668 with SMTP id bj3-20020a170902850300b00188e49e2668mr57385385plb.125.1670007891546; Fri, 02 Dec 2022 11:04:51 -0800 (PST) Received: from youngsil.svl.corp.google.com ([2620:15c:2d4:203:8a28:738d:8b4c:8dca]) by smtp.gmail.com with ESMTPSA id w6-20020a170902a70600b0018862bb3976sm5842570plq.308.2022.12.02.11.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 11:04:51 -0800 (PST) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , Adrian Hunter , 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 Date: Fri, 2 Dec 2022 11:04:47 -0800 Message-Id: <20221202190447.1588680-1-namhyung@kernel.org> X-Mailer: git-send-email 2.39.0.rc0.267.gcb52ba06e7-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no 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 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