Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2993904rwb; Fri, 11 Nov 2022 19:29:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf6/7Z1AUcuq8SiMro02ITwLlvoGS9gPfmgTtOqilzgblC6HayI6pkZtMcFpgrg0kn9MdkaN X-Received: by 2002:a05:6402:3884:b0:458:d9e1:79e1 with SMTP id fd4-20020a056402388400b00458d9e179e1mr3950791edb.289.1668223766891; Fri, 11 Nov 2022 19:29:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668223766; cv=none; d=google.com; s=arc-20160816; b=LeeKJqFJvl2x4ffKUq/VJPJ9xmgPnmc65SNhSMqrJLnVnUI7ek8iLsUpq3hYVuY56n LjoDS5xQtU88TMu801/WIWjLSYauUaU8KtFk1X+IlCeUPl1i71cuDRVO0IToLKzv3NuD 6owEwwZSVZmytZAwUuPgkDTNdevkVSt3GLYvCCJOIedIrIiGOdPcgxpmzVyqnw1MFukl PchsNoyaqnwFTETuXSIQqO1bm+9bIWPfqLsgVQMRl98gDSnIl2bXDRXEhA2pK9WEZ8qF aecqkOike/SkqP+/0hlpkDGY/Qbq+VKUiJ/dAl8YnucL/N1F3qQPNrVYMJjOhFY1lkyX PXyw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=OCrq93Ou9ulSTWplOyqr42G3tytqfI7Ze+qFafkY6Oc=; b=hSS5yvlkGlwxMSl6a+al3I5DgfM/LY0YPJEHKU9oyPXVExEmGqksd7CkcaCPiTFJHt LDukAguP/hMOWA41d37yYH+iu5NIVWv0HCugv+z+v3m1+iolCQDKpmVyjMqTRU/Ee11E wOzZEvCeyEfQ+3v+Ujrc6wNf9IjHivrHtjpEigFuk5+T17Wv2DYPSQwdwn6+rm7YVVwI z68cuZpf5vze2E5hUz5duJ5QyVaeuWOpALg+SIHlQ9M6JQlvZ4z3duwv+XWZvSx51dD9 hiXhqcgRlZYjlrAf4zslglXNS+YCKavqYs1Prd8Ci6IEtwgGvBReZUc/LuG4QO9xzzf5 x8Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YzWwQaPH; 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 du4-20020a17090772c400b00741a0c28f07si3814266ejc.943.2022.11.11.19.29.05; Fri, 11 Nov 2022 19:29:26 -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=YzWwQaPH; 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 S234607AbiKLDXb (ORCPT + 90 others); Fri, 11 Nov 2022 22:23:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234489AbiKLDXK (ORCPT ); Fri, 11 Nov 2022 22:23:10 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71A6D73430; Fri, 11 Nov 2022 19:23:04 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id m6so6454301pfb.0; Fri, 11 Nov 2022 19:23:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=OCrq93Ou9ulSTWplOyqr42G3tytqfI7Ze+qFafkY6Oc=; b=YzWwQaPHElVm0LGJ3HDfNkJ7OIvk7JmJcJ/5EuT2mwrgKGzvhiOv8qaFFA1M5Qs5Qb 9mhboMBUNGaoDbX/9KE147crGSUvxQHeMJRk0uSUAoSv7Z/aTk/3fkTpvvVFkKflixez 1QzQTdf5VInC8BHMH9LemeD3/a01k4YbHwdqs05qt9bPZ4ikmvi7g5AtubpcNpApamQO 8Uo1+hlOgjTBfwZAFuNReZX9A0JFPCu/w+5iKwCk87Zau8eej0p+MkQ2otIeC8Nid2b6 +amaAlsYlKrZ82qOis65OGP8cjYW399KLOegR1osuGkxPaWkFOv1J5PV0tm/lHKZAh/6 LOlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OCrq93Ou9ulSTWplOyqr42G3tytqfI7Ze+qFafkY6Oc=; b=syTIBWQdky/2D6xrTM/TBkwZjwjZ/3iRV0CJJuUHnN+Df+vwXVl0fVclYRYtr+LsUt UyWNAZWR8SAgL6TFb4wKRZcVxMT70UDe3HuiG48PraEfxrvlTvfX9VMl2lt2QaD3O1K2 tOiI6OOuhIE6POip2ZeYYp/krTwNNXNvRONS3PGr08hmto6UxbImEmUk7MNGTcYVx+aj Vupni0km338W6660biubtdubDPqSu87fuDkGCbSx8AFyRUmjCyra1a2CWbL4lHYOl4Fc iK0GG76yWcPaqGencM043UKeXW54CF/rV+xXO8OnU9Tp8GWG3Wyh4IBzHJEgjYlJ8GJN g1+w== X-Gm-Message-State: ANoB5pmQqzHrchE7BCWlSed+Q1/sEnPbyCaXp7ZqdzbVfW89rYMiAe0/ /lztqYmEge+MeqNmVPxKDv7+49duyWM= X-Received: by 2002:a63:4b18:0:b0:470:48c0:f37a with SMTP id y24-20020a634b18000000b0047048c0f37amr4073123pga.83.1668223384064; Fri, 11 Nov 2022 19:23:04 -0800 (PST) Received: from balhae.roam.corp.google.com ([2607:fb90:27dc:8408:33d7:3b01:eee1:84b]) by smtp.gmail.com with ESMTPSA id ij25-20020a170902ab5900b00186f0f59d1esm2434552plb.192.2022.11.11.19.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 19:23:03 -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 Subject: [PATCH 09/11] perf stat: Consolidate condition to print metrics Date: Fri, 11 Nov 2022 19:22:42 -0800 Message-Id: <20221112032244.1077370-10-namhyung@kernel.org> X-Mailer: git-send-email 2.38.1.493.g58b659f92b-goog In-Reply-To: <20221112032244.1077370-1-namhyung@kernel.org> References: <20221112032244.1077370-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.5 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 The pm variable holds an appropriate function to print metrics for CSV anf JSON already. So we can combine the if statement to simplify the code a little bit. This also matches to the above condition for non-CSV and non-JSON case. Acked-by: Ian Rogers Signed-off-by: Namhyung Kim --- tools/perf/util/stat-display.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index 5f4fb0bd4037..ce81798b5864 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -600,9 +600,7 @@ static void printout(struct perf_stat_config *config, struct aggr_cpu_id id, int pm(config, &os, NULL, NULL, "", 0); print_noise(config, counter, noise); print_running(config, run, ena); - if (config->csv_output) - pm(config, &os, NULL, NULL, "", 0); - else if (config->json_output) + if (config->csv_output || config->json_output) pm(config, &os, NULL, NULL, "", 0); return; } -- 2.38.1.493.g58b659f92b-goog