From patchwork Wed Nov 23 18:02:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 25127 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2943516wrr; Wed, 23 Nov 2022 10:07:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf661eqxyjC/CatT1jRtC/WLSYb9OaZIbuXA5k5pUSDO3XspMCEof5PaPsRWKnNIT31Ea99M X-Received: by 2002:a05:6402:104b:b0:461:7d1f:1a7b with SMTP id e11-20020a056402104b00b004617d1f1a7bmr9098808edu.400.1669226853317; Wed, 23 Nov 2022 10:07:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669226853; cv=none; d=google.com; s=arc-20160816; b=d3YMOpX/J/KgqtC33Pyff57L5cgDPnm7/xYCFxf5niW4Xt1lSp5cpewhuERz/cW5JM KzU7fQd3TRMZ6zJN6gmVq3CNlDOi9rL49FNkQZJBBLeKRvZ2imVTx1xnBMqy14YcQLIo u4+4MpJvqCWcy97C1p6d8JLnn2ceROf1ZF+o75JaBElfg18ittr1q8WAuX2F2KN3Rh5G GTeVjmotxF1i3iK/2kPVx+DecwrzMJYGA+ndDJW/BqUgyFJo9YJYa+JtzHuaA0DQLVon znuEoTu6O+DpUG0XRxPFIeVL6lz8812tdPOsv0C7yJnHL/2TU/uQ7SmyHptCl1uVELUb 6saQ== 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=i58ch+3MvSovbxgHuPI+VzjhA43rzCO6VyOVuXc7lHM=; b=VssOEhWG5Y1mIWIXmywnL+yEV7UvohtpgDq37769UYF3G9BlnUXd4blxlAtH+wvUlt yCDUuDRmQpASMTjv+ZtHRcficOeKo7HdMwyZxMGe3/OumynnE8CmV9GCUtVDZRBse9CL IxAQ3NrvwHUPpX4vGxQa7Fd9Di8VunvLZ6zR35IrCZNShqv4h6wrIGFSH5MxOKzy58uH WitLOk+h2PoydqEZBxLomO+NnsSv8fuMTsk7GMh2AvNrvFiP3dKZJxt6rrAt43yFDQhF b2OiWWF9vUErco66XEl4scdIITnKCslp9OWd3wVmxKCaMUh2k7u/BcPO3A6CcQZbnG65 nh8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="FfVOR/9W"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a056402440700b0045d3e06e4d5si16329589eda.389.2022.11.23.10.07.07; Wed, 23 Nov 2022 10:07:33 -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="FfVOR/9W"; 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 S238957AbiKWSE4 (ORCPT + 99 others); Wed, 23 Nov 2022 13:04:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239439AbiKWSCi (ORCPT ); Wed, 23 Nov 2022 13:02:38 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82BF45FA6; Wed, 23 Nov 2022 10:02:27 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id d20so17310802plr.10; Wed, 23 Nov 2022 10:02:27 -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=i58ch+3MvSovbxgHuPI+VzjhA43rzCO6VyOVuXc7lHM=; b=FfVOR/9WaGv3WxhuuUQHJxjW/D1aSEBu4+EtTJgE50WZYia6oDCf4kd0Kz3jliWGnq 3DzdvlZqj7jehx/mNc6CNbouCeQOFRw+taifsc0WfwnYLdH6gplhgNpOTDCfk1d9xmXI 6qORHso09UzO2W+VoHwTKpurA9d07uLIdKgdn8VaE0DV+N2Pdo3sd6QrigCfPt+YXMUL jX7esb+h0WGEisVeZjCuykJsodrhvOpP/tBopASz11Ey2tVEt+h5SKOtgbkD4HIP9wzT Ehxd7B7EUtqBMi1PAZCZOV5aLJFnfOE2QEMf7j0E6vGK2scDNC9VWRvE6KMa88+Iy4Bd Bw+Q== 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=i58ch+3MvSovbxgHuPI+VzjhA43rzCO6VyOVuXc7lHM=; b=NSqa1wK+Mql7VczFQlf4Ylpjfq+sz34lwL61c7Epf/zJ0aeZYENDjsQAKnyvolLsvW An4+OB9/MbJh/Swg4PgvwjIoNsRKB9bVGgbRqMFnFSdRpyP4B6g8XbtixeeV14Gb2Fon IkrHWAtSrjn2f+d5qlm+AfrTAsg5ZWgHp7QQMUMVWoBXODiixJnARlOCM/09qp7z7JFG 0z5SV5NZ3Fl7CB3EJT6wxQEgi5SFKaDtSoaFL576GFLPEVWKHVwzfTtXhUzbjvs66c9n /PVzPUpmYquLQNN2BVwjbe7Ajam9dqwnJTRr5ISqw3M3bO95wJnCiSLPLuDGs9n0q3F7 orSg== X-Gm-Message-State: ANoB5pmfTCqXmmC72McCtKNRCVcJih45y3BgyVDCEfBZowZ4L9huaGXF x+LgQ/AEv54djdpfyYVwMa0= X-Received: by 2002:a17:902:9686:b0:189:24b3:c54 with SMTP id n6-20020a170902968600b0018924b30c54mr9943652plp.96.1669226546627; Wed, 23 Nov 2022 10:02:26 -0800 (PST) Received: from balhae.hsd1.ca.comcast.net ([2601:647:6780:a80:c968:76:254b:3790]) by smtp.gmail.com with ESMTPSA id i15-20020a655b8f000000b00470275c8d6dsm10792364pgr.10.2022.11.23.10.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Nov 2022 10:02:26 -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 Subject: [PATCH 11/15] perf stat: Do not pass runtime_stat to printout() Date: Wed, 23 Nov 2022 10:02:04 -0800 Message-Id: <20221123180208.2068936-12-namhyung@kernel.org> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog In-Reply-To: <20221123180208.2068936-1-namhyung@kernel.org> References: <20221123180208.2068936-1-namhyung@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.6 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750311216823374913?= X-GMAIL-MSGID: =?utf-8?q?1750311216823374913?= It always passes a pointer to rt_stat as it's the only one. Let's not pass it and directly refer it in the printout(). Signed-off-by: Namhyung Kim Acked-by: Ian Rogers --- tools/perf/util/stat-display.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index dd190f71e933..cdf4ca7f6e3a 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -674,8 +674,7 @@ static bool is_mixed_hw_group(struct evsel *counter) } static void printout(struct perf_stat_config *config, struct outstate *os, - double uval, u64 run, u64 ena, double noise, - struct runtime_stat *st, int map_idx) + double uval, u64 run, u64 ena, double noise, int map_idx) { struct perf_stat_output_ctx out; print_metric_t pm; @@ -737,7 +736,7 @@ static void printout(struct perf_stat_config *config, struct outstate *os, if (ok) { perf_stat__print_shadow_stats(config, counter, uval, map_idx, - &out, &config->metric_events, st); + &out, &config->metric_events, &rt_stat); } else { pm(config, &os, /*color=*/NULL, /*format=*/NULL, /*unit=*/"", /*val=*/0); } @@ -834,7 +833,7 @@ static void print_counter_aggrdata(struct perf_stat_config *config, uval = val * counter->scale; - printout(config, &os, uval, run, ena, avg, &rt_stat, s); + printout(config, &os, uval, run, ena, avg, s); if (!metric_only) fputc('\n', output); @@ -987,7 +986,7 @@ static void print_no_aggr_metric(struct perf_stat_config *config, run = ps->aggr[counter_idx].counts.run; uval = val * counter->scale; - printout(config, &os, uval, run, ena, 1.0, &rt_stat, counter_idx); + printout(config, &os, uval, run, ena, 1.0, counter_idx); } if (!first) print_metric_end(config);