From patchwork Sat Jun 4 04:28:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12869566 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8FB57C43334 for ; Sat, 4 Jun 2022 04:32:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8+ZmQd7MXeLnuwTt+90ZkuQUXJe6vb9x/PtKleu9tlI=; b=RfqL3qx7xMWcJq m2YxKzbDX5fTVCiLdwR5wzcVwkPifXI2AmRhICWClP+pxK2pqeWUhtt332orBThY2EiWw2nU/7SaD zISPYgRzn48EXusr93y0SphcV0YSI24oyyjbYJHvV6Z3CJY9CIpO+eYt3Q3Cz/29nYj68KbhP74Fz Sa/VR6FFquHpxnDgwDwP6yEsd+rrg5WPk/tf9z43GSXy/W+pWUA5GCMUz6SB4uX2rgaZXWSV7MriA p8VnlmDQrr8tqDQGlLifFDsRIsOlhmGOEpo637meAJFmFBKJlSre/5vBPR+OAIt8TTNx2OZWAAgBR M5pWz1qC5CQpFkg46waw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxLRT-00AF0G-Rk; Sat, 04 Jun 2022 04:31:16 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxLPw-00AE8J-Pe for linux-arm-kernel@lists.infradead.org; Sat, 04 Jun 2022 04:29:42 +0000 Received: by mail-pl1-x62c.google.com with SMTP id h1so8114717plf.11 for ; Fri, 03 Jun 2022 21:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3Qm66nfhudmwJA9iVinA9JP0NApAajjTf2BuY1M3OaI=; b=kK5aeXkDtX7iX8griW86CyYEXdl/A0eEoOAH35kMiy8zC5YxZ13vkmUz41hNukiVED mwOD/eHzHg/ydHq9EnMam14CC+qi74lZ5DT/BZLht4Ycg8oUmzkBZjyRvP10Zabr1bml pM1ANKzvXgjiQFcGdB9yBK2kbxntk93fVC8L8EGzg5bWrtj+cW0HA62JIklUfPSZPpBY JDX4X7ZtLv2ApTgr9o96CGNSHF9wrVPb++OYdBxWV9Af+auINOLjKL/8fwy9yJG6h9FN qJlps4+jXViETOdDnbJUJNm1u+nf/wo2MAZWn914jK2uKqI6n0arJcJqgH+uKM8h8vhY WiBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3Qm66nfhudmwJA9iVinA9JP0NApAajjTf2BuY1M3OaI=; b=yeR7nQb3cwetGIU2tECJEXmZoPWVD4+LckgWkirnDs9uIRqIfdC9PSTZkL8OI38Q6K Gr3tVcNtO8RLTdZjIVcZMQcFoG+8vMY3HnkUVi2kNTUkGLcftJEYPRWQReC7d2UN69J5 bIs6PgL46MmUGaFfUh8MJ6A4FcW8c9dp39AaeDGYMKGlvwCTjfzZVhOWXHBFbrtXEiW0 neSvJ9RI5ydiknHnBdiBFxbgYrbwIyTZvMfIstuGaqblCk+tl95d6cQAinqB+qhJERkh KquKWhuYSuhB8yYkhC6ln3G7f12KCowPg3m2DiM4YV7opejTlMn3eI+knlD3wvlj/b1K FB8w== X-Gm-Message-State: AOAM533evINOGh0MvYOUf5Wv2TsvZhgFIGtTWfUwFcW0XUHKr6oWt/dS 46xM90dc31bBPM4vHsVeRhWGR0CYjVj1u8V9 X-Google-Smtp-Source: ABdhPJwhqQsWGwdhBIJ5vTo2aAtQciKAeP/FJizUt9b/VLhWNxzBpnmgnb4AcoR7NQR0tJzKw6Rx1A== X-Received: by 2002:a17:902:b694:b0:162:6ea:30 with SMTP id c20-20020a170902b69400b0016206ea0030mr13186546pls.95.1654316979740; Fri, 03 Jun 2022 21:29:39 -0700 (PDT) Received: from leo-build-box.lan (ec2-54-67-95-58.us-west-1.compute.amazonaws.com. [54.67.95.58]) by smtp.gmail.com with ESMTPSA id w24-20020a1709027b9800b00163d4c3ffabsm6152916pll.304.2022.06.03.21.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 21:29:39 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , Namhyung Kim , Ian Rogers , John Garry , Will Deacon , James Clark , German Gomez , Ali Saidi , Joe Mario , Adam Li , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v5 10/17] perf c2c: Add mean dimensions for peer operations Date: Sat, 4 Jun 2022 12:28:13 +0800 Message-Id: <20220604042820.2270916-11-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220604042820.2270916-1-leo.yan@linaro.org> References: <20220604042820.2270916-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220603_212940_895011_2B517ABD X-CRM114-Status: GOOD ( 14.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch adds two dimensions for the mean value of peer operations. Signed-off-by: Leo Yan Acked-by: Ian Rogers Tested-by: Ali Saidi Reviewed-by: Ali Saidi --- tools/perf/builtin-c2c.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index dd47f068b8da..8dd9218a052f 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -55,6 +55,8 @@ struct c2c_hists { struct compute_stats { struct stats lcl_hitm; struct stats rmt_hitm; + struct stats lcl_peer; + struct stats rmt_peer; struct stats load; }; @@ -154,6 +156,8 @@ static void *c2c_he_zalloc(size_t size) init_stats(&c2c_he->cstats.lcl_hitm); init_stats(&c2c_he->cstats.rmt_hitm); + init_stats(&c2c_he->cstats.lcl_peer); + init_stats(&c2c_he->cstats.rmt_peer); init_stats(&c2c_he->cstats.load); return &c2c_he->he; @@ -253,6 +257,10 @@ static void compute_stats(struct c2c_hist_entry *c2c_he, update_stats(&cstats->rmt_hitm, weight); else if (stats->lcl_hitm) update_stats(&cstats->lcl_hitm, weight); + else if (stats->rmt_peer) + update_stats(&cstats->rmt_peer, weight); + else if (stats->lcl_peer) + update_stats(&cstats->lcl_peer, weight); else if (stats->load) update_stats(&cstats->load, weight); } @@ -1280,6 +1288,8 @@ __func(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he) \ MEAN_ENTRY(mean_rmt_entry, rmt_hitm); MEAN_ENTRY(mean_lcl_entry, lcl_hitm); MEAN_ENTRY(mean_load_entry, load); +MEAN_ENTRY(mean_rmt_peer_entry, rmt_peer); +MEAN_ENTRY(mean_lcl_peer_entry, lcl_peer); static int cpucnt_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, @@ -1750,6 +1760,22 @@ static struct c2c_dimension dim_mean_load = { .width = 8, }; +static struct c2c_dimension dim_mean_rmt_peer = { + .header = HEADER_SPAN("---------- cycles ----------", "rmt peer", 2), + .name = "mean_rmt_peer", + .cmp = empty_cmp, + .entry = mean_rmt_peer_entry, + .width = 8, +}; + +static struct c2c_dimension dim_mean_lcl_peer = { + .header = HEADER_SPAN_LOW("lcl peer"), + .name = "mean_lcl_peer", + .cmp = empty_cmp, + .entry = mean_lcl_peer_entry, + .width = 8, +}; + static struct c2c_dimension dim_cpucnt = { .header = HEADER_BOTH("cpu", "cnt"), .name = "cpucnt", @@ -1835,6 +1861,8 @@ static struct c2c_dimension *dimensions[] = { &dim_node, &dim_mean_rmt, &dim_mean_lcl, + &dim_mean_rmt_peer, + &dim_mean_lcl_peer, &dim_mean_load, &dim_cpucnt, &dim_srcline,