Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp133185iof; Sun, 5 Jun 2022 23:20:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM1Vq8uA/F7570T/Nil1WYBXJjCxaWn+sa+DkseBn6snsuB0Wy/TrHgRhFyZIe7+XQVZbF X-Received: by 2002:a63:5f48:0:b0:3fd:3a3e:5b1c with SMTP id t69-20020a635f48000000b003fd3a3e5b1cmr11775064pgb.419.1654496458758; Sun, 05 Jun 2022 23:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654496458; cv=none; d=google.com; s=arc-20160816; b=y6t1j1diWH/axCFusvSMa0mCG/k5Odu3B6MMPk3eocqz0roxR2EFwnXmrAROrvVLrM zdLLUVzzmp7qPn9h2aZ8K2t3VaPcslu8xnfERRfsZTtmppeAIePkv8E5yJut4OnrJgVB ro/w2PF9Gt/F+1c3S8aOX3SKfcD+xJU2uIjX3T6RgHKQy6m/0+q04EWG7pi4HmW9GeqH JhMmwapKxrDbn766uYk5QBBuEVVHwddmNjuvlvfL3/AQJEAp4+Hh21SJnk5ZoHEsFve6 MEChNIWP8fW2h/rc8/Xy+V5cirQNkcggKeXGHjg/4GZv/OR5KAlTACPZhtTCBxrVU/dy s4sw== 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 :dkim-signature; bh=D1zDapSGMri2EcwZUI87fBe3l89UfGHtqbVcPddjTxg=; b=vyd+dZE4YXRUS7kAA9hSo3cY1vvpu6o/GwMT3ZydQR++D+PmCKGXiQ3a8J6pkyBuvj 2X5NpL7YX4az38vQ7ACS/A/cDmYx/P+G7lbPvWzfXh5RCJ05areyj6pghd2jLc1NIvmX oeEstX0CyL/TYUcOaFyJCuWmXlST7DfRZiYJtqNIyr05U7CLugd/b3UmcMGFlgxtEJSd k4pNuaryC7hISjlg/eyxKisgZyJKK0ZqqrWpykmlZ9Dj8F46i7cugT9esW48OHUmCbVu 0Fb2kD5jCSnwGmI5IbVudeysea4QvaSfXIfJ1U4sH1fur1fodCCXeQ9pAyDXFYbLemRZ lVFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HOlju+XO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g6-20020a636b06000000b003fd8db87697si5583340pgc.441.2022.06.05.23.20.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:20:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HOlju+XO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D51267B9DD; Sun, 5 Jun 2022 22:00:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238924AbiFDEaN (ORCPT + 99 others); Sat, 4 Jun 2022 00:30:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350487AbiFDE3v (ORCPT ); Sat, 4 Jun 2022 00:29:51 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8257959BAA for ; Fri, 3 Jun 2022 21:29:46 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 7so7877330pga.12 for ; Fri, 03 Jun 2022 21:29:46 -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=D1zDapSGMri2EcwZUI87fBe3l89UfGHtqbVcPddjTxg=; b=HOlju+XOFSK9bTHri58+pxpWFgXQRr2HfFgWZJIwQvpUQOHPpbrtK40oEnURHRbuDO aHPCT1HpumIku94ea8UiAh4nqtKomcUXsO6opKd/w4+4vopwwhoOjhtNwYaClCDXpmQ/ ilbdUs/J1FZXGvKYROZO8dTcxbRIIQLlozz4Xdrhh7fJW9jKZ5O/h8yLyK2Sgv3nVIHe pUShyaouhWvx8MlIeJwlUR4hOnuB3lZaMHx7BjBuPURYoFjGqbTVwcngKsY0uGGZjBnu isvUrgku0xtc8HbnxKh2PdRaLAJjoQrKXIixJdF2SsN0BLjF6gRHTP4SQSY7WE7xBGnG E49w== 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=D1zDapSGMri2EcwZUI87fBe3l89UfGHtqbVcPddjTxg=; b=InO3SwIHJNHIbvogNeNfHGdb+gDkxHpv3NI9IKUQQfmB43/5gGmADolyNs+YLIVBYr iOA7QFE3yDwGg7rIdFmVXxUbprYsyrNl/cvn2xtTKm2ja9SmcfXnXDo7AUuHYznTbgbN UB0d6h9ROIQgvu6fTNka/AsqSgHJlyfjpmmF4vYpylDLgj9CNp150U1iX5zWH/0rMrjL j3Jtp/GWPoCD5qBLLTpr4y/jFMFraVuE1tGJ/Hw4GlW3aj3H+aMQ9nBEGbqUk2H2O7Kw pwA9PQmUCMs3G4X9KSwPnvT4ZBLMxUZ5eIEPeqJuNP52CE2F3iVxOoFZd9wxwHtCVVKF UCWw== X-Gm-Message-State: AOAM531aCQQEo1iuQT63KIBni7xn88PqIsgfANgIgW/wO89NQTFzeDwe ELcVXGxajU5obbokrTDTWa+XXA== X-Received: by 2002:a63:6a4a:0:b0:3fd:4f3a:3f0f with SMTP id f71-20020a636a4a000000b003fd4f3a3f0fmr2185912pgc.625.1654316985522; Fri, 03 Jun 2022 21:29:45 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 21:29:44 -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 11/17] perf c2c: Use explicit names for display macros Date: Sat, 4 Jun 2022 12:28:14 +0800 Message-Id: <20220604042820.2270916-12-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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 Perf c2c tool has an assumption that it heavily depends on HITM snoop type to detect cache false sharing, unfortunately, HITM is not supported on some architectures. Essentially, perf c2c tool wants to find some very costly snooping operations for false cache sharing, this means it's not necessarily to stick using HITM tags and we can explore other snooping types (e.g. SNOOPX_PEER). For this reason, this patch renames HITM related display macros with suffix '_HITM', so it can be distinct if later add more display types for on other snooping type. Signed-off-by: Leo Yan Acked-by: Ian Rogers Tested-by: Ali Saidi Reviewed-by: Ali Saidi --- tools/perf/builtin-c2c.c | 58 ++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 8dd9218a052f..cbeb1878a71c 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -115,16 +115,16 @@ struct perf_c2c { }; enum { - DISPLAY_LCL, - DISPLAY_RMT, - DISPLAY_TOT, + DISPLAY_LCL_HITM, + DISPLAY_RMT_HITM, + DISPLAY_TOT_HITM, DISPLAY_MAX, }; static const char *display_str[DISPLAY_MAX] = { - [DISPLAY_LCL] = "Local", - [DISPLAY_RMT] = "Remote", - [DISPLAY_TOT] = "Total", + [DISPLAY_LCL_HITM] = "Local", + [DISPLAY_RMT_HITM] = "Remote", + [DISPLAY_TOT_HITM] = "Total", }; static const struct option c2c_options[] = { @@ -811,15 +811,15 @@ static double percent_hitm(struct c2c_hist_entry *c2c_he) total = &hists->stats; switch (c2c.display) { - case DISPLAY_RMT: + case DISPLAY_RMT_HITM: st = stats->rmt_hitm; tot = total->rmt_hitm; break; - case DISPLAY_LCL: + case DISPLAY_LCL_HITM: st = stats->lcl_hitm; tot = total->lcl_hitm; break; - case DISPLAY_TOT: + case DISPLAY_TOT_HITM: st = stats->tot_hitm; tot = total->tot_hitm; default: @@ -1217,15 +1217,15 @@ node_entry(struct perf_hpp_fmt *fmt __maybe_unused, struct perf_hpp *hpp, advance_hpp(hpp, ret); switch (c2c.display) { - case DISPLAY_RMT: + case DISPLAY_RMT_HITM: ret = display_metrics(hpp, stats->rmt_hitm, c2c_he->stats.rmt_hitm); break; - case DISPLAY_LCL: + case DISPLAY_LCL_HITM: ret = display_metrics(hpp, stats->lcl_hitm, c2c_he->stats.lcl_hitm); break; - case DISPLAY_TOT: + case DISPLAY_TOT_HITM: ret = display_metrics(hpp, stats->tot_hitm, c2c_he->stats.tot_hitm); break; @@ -1606,9 +1606,9 @@ static struct c2c_dimension dim_tot_loads = { }; static struct c2c_header percent_hitm_header[] = { - [DISPLAY_LCL] = HEADER_BOTH("Lcl", "Hitm"), - [DISPLAY_RMT] = HEADER_BOTH("Rmt", "Hitm"), - [DISPLAY_TOT] = HEADER_BOTH("Tot", "Hitm"), + [DISPLAY_LCL_HITM] = HEADER_BOTH("Lcl", "Hitm"), + [DISPLAY_RMT_HITM] = HEADER_BOTH("Rmt", "Hitm"), + [DISPLAY_TOT_HITM] = HEADER_BOTH("Tot", "Hitm"), }; static struct c2c_dimension dim_percent_hitm = { @@ -2101,15 +2101,15 @@ static bool he__display(struct hist_entry *he, struct c2c_stats *stats) c2c_he = container_of(he, struct c2c_hist_entry, he); switch (c2c.display) { - case DISPLAY_LCL: + case DISPLAY_LCL_HITM: he->filtered = filter_display(c2c_he->stats.lcl_hitm, stats->lcl_hitm); break; - case DISPLAY_RMT: + case DISPLAY_RMT_HITM: he->filtered = filter_display(c2c_he->stats.rmt_hitm, stats->rmt_hitm); break; - case DISPLAY_TOT: + case DISPLAY_TOT_HITM: he->filtered = filter_display(c2c_he->stats.tot_hitm, stats->tot_hitm); break; @@ -2132,13 +2132,13 @@ static inline bool is_valid_hist_entry(struct hist_entry *he) return true; switch (c2c.display) { - case DISPLAY_LCL: + case DISPLAY_LCL_HITM: has_record = !!c2c_he->stats.lcl_hitm; break; - case DISPLAY_RMT: + case DISPLAY_RMT_HITM: has_record = !!c2c_he->stats.rmt_hitm; break; - case DISPLAY_TOT: + case DISPLAY_TOT_HITM: has_record = !!c2c_he->stats.tot_hitm; break; default: @@ -2835,11 +2835,11 @@ static int setup_display(const char *str) const char *display = str ?: "tot"; if (!strcmp(display, "tot")) - c2c.display = DISPLAY_TOT; + c2c.display = DISPLAY_TOT_HITM; else if (!strcmp(display, "rmt")) - c2c.display = DISPLAY_RMT; + c2c.display = DISPLAY_RMT_HITM; else if (!strcmp(display, "lcl")) - c2c.display = DISPLAY_LCL; + c2c.display = DISPLAY_LCL_HITM; else { pr_err("failed: unknown display type: %s\n", str); return -1; @@ -2927,9 +2927,9 @@ static int setup_coalesce(const char *coalesce, bool no_source) return -1; if (asprintf(&c2c.cl_resort, "offset,%s", - c2c.display == DISPLAY_TOT ? + c2c.display == DISPLAY_TOT_HITM ? "tot_hitm" : - c2c.display == DISPLAY_RMT ? + c2c.display == DISPLAY_RMT_HITM ? "rmt_hitm,lcl_hitm" : "lcl_hitm,rmt_hitm") < 0) return -ENOMEM; @@ -3087,11 +3087,11 @@ static int perf_c2c__report(int argc, const char **argv) "ld_rmthit,rmt_hitm," "dram_lcl,dram_rmt"; - if (c2c.display == DISPLAY_TOT) + if (c2c.display == DISPLAY_TOT_HITM) sort_str = "tot_hitm"; - else if (c2c.display == DISPLAY_RMT) + else if (c2c.display == DISPLAY_RMT_HITM) sort_str = "rmt_hitm"; - else if (c2c.display == DISPLAY_LCL) + else if (c2c.display == DISPLAY_LCL_HITM) sort_str = "lcl_hitm"; c2c_hists__reinit(&c2c.hists, output_str, sort_str); -- 2.25.1