From mboxrd@z Thu Jan 1 00:00:00 1970 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 038ECC433EF for ; Wed, 20 Apr 2022 19:04:14 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Hl0Q8aOjiI77g1bFDnrfbsV0vsOcjoMcswnLLl/JBRE=; b=p+ShDs2vMGxVWt JDeJ6eNz/GQe44UypxESmCm2UU9BM6zzRMTJJsgsTHSN1d+MntS99c5VDzYxKd1pS26D/pIqvecql UbylhpipCfAFtC2RDAandRkFRCyov/WSxpUlMhj4r/uyuvqi5eu6bOkaKsEb9yPTcaV2JYt68BmR9 DH5/Qpd7S2ve5Y3uyf9lHuyewMaYcF5TStRD+tt4hXd5qPAE5hSgHN+OEMFkf2RYq/s3pm2TsK2xI WeyP+YHiPoyv85YDZA8Z8CzbyxqUjBfrw0yDNfxnCHdw72wOeJIAua5PhfV+R23gn50ZWPYEmnG87 1zA3Bw7NtK0MwHHfrN5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhFbJ-00A91J-Cv; Wed, 20 Apr 2022 19:02:53 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhFbF-00A90O-OX for linux-arm-kernel@lists.infradead.org; Wed, 20 Apr 2022 19:02:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650481369; x=1682017369; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=kKQBmPp1VZYcgCiUJsleCcUtBP4LxeMiM4JoNgp0U24=; b=Uo4KeOTnDhGU1dI5c7Ph2aoNretsX0+EIROwY+f2ZR3QIiq7OKghtnBG TizDGIcJXdB+x3xMxCJ+MnTx64GZyNXwn5Zfot5v1293oRktHL1YIO2om w0HZ1E5bFZzjH0+93++In7ln2Vscmp/2XjOoEAh8UY3NqSouf3yqaPVb6 H55oVGJ2N2W86UNSbsFLecXu5QzJdZ/oq9JVacmzt82tU++9oTxjxqo5E N5kZFFDcK4tMdT+0sZj+pgxbP1ahoJoFm2+lYQer4xILZDSwIk/fUY9sg kg8/1dzXA4toW7WpHytmIYvwfPax6PQ2LWgmH8tcmL2OE0uhJacshwt6e g==; X-IronPort-AV: E=McAfee;i="6400,9594,10323"; a="263891110" X-IronPort-AV: E=Sophos;i="5.90,276,1643702400"; d="scan'208";a="263891110" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2022 12:02:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,276,1643702400"; d="scan'208";a="614545737" Received: from linux.intel.com ([10.54.29.200]) by fmsmga008.fm.intel.com with ESMTP; 20 Apr 2022 12:02:45 -0700 Received: from [10.209.97.182] (kliang2-MOBL.ccr.corp.intel.com [10.209.97.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 3F6DD580AE2; Wed, 20 Apr 2022 12:02:43 -0700 (PDT) Message-ID: Date: Wed, 20 Apr 2022 15:02:42 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v5 5/5] perf mem: Support mem_lvl_num in c2c command Content-Language: en-US To: Ali Saidi , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, german.gomez@arm.com, leo.yan@linaro.org, acme@kernel.org Cc: benh@kernel.crashing.org, Nick.Forrington@arm.com, alexander.shishkin@linux.intel.com, andrew.kilroy@arm.com, james.clark@arm.com, john.garry@huawei.com, jolsa@kernel.org, kjain@linux.ibm.com, lihuafei1@huawei.com, mark.rutland@arm.com, mathieu.poirier@linaro.org, mingo@redhat.com, namhyung@kernel.org, peterz@infradead.org, will@kernel.org References: <20220408195344.32764-1-alisaidi@amazon.com> <20220408195344.32764-6-alisaidi@amazon.com> From: "Liang, Kan" In-Reply-To: <20220408195344.32764-6-alisaidi@amazon.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220420_120249_982803_A2E5C896 X-CRM114-Status: GOOD ( 18.64 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 4/8/2022 3:53 PM, Ali Saidi wrote: > In addition to summarizing data encoded in mem_lvl also support data > encoded in mem_lvl_num. > > Since other architectures don't seem to populate the mem_lvl_num field > here there shouldn't be a change in functionality. > > Signed-off-by: Ali Saidi > --- > tools/perf/util/mem-events.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c > index ed0ab838bcc5..e5e405185498 100644 > --- a/tools/perf/util/mem-events.c > +++ b/tools/perf/util/mem-events.c > @@ -485,6 +485,7 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi) > u64 daddr = mi->daddr.addr; > u64 op = data_src->mem_op; > u64 lvl = data_src->mem_lvl; > + u64 lnum = data_src->mem_lvl_num; > u64 snoop = data_src->mem_snoop; > u64 lock = data_src->mem_lock; > u64 blk = data_src->mem_blk; > @@ -527,16 +528,18 @@ do { \ > if (lvl & P(LVL, UNC)) stats->ld_uncache++; > if (lvl & P(LVL, IO)) stats->ld_io++; > if (lvl & P(LVL, LFB)) stats->ld_fbhit++; > - if (lvl & P(LVL, L1 )) stats->ld_l1hit++; > - if (lvl & P(LVL, L2 )) stats->ld_l2hit++; > - if (lvl & P(LVL, L3 )) { > + if (lvl & P(LVL, L1) || lnum == P(LVLNUM, L1)) > + stats->ld_l1hit++; > + if (lvl & P(LVL, L2) || lnum == P(LVLNUM, L2)) > + stats->ld_l2hit++; > + if (lvl & P(LVL, L3) || lnum == P(LVLNUM, L3)) { > if (snoop & P(SNOOP, HITM)) > HITM_INC(lcl_hitm); > else > stats->ld_llchit++; > } > > - if (lvl & P(LVL, LOC_RAM)) { > + if (lvl & P(LVL, LOC_RAM) || lnum == P(LVLNUM, RAM)) { I think the PERF_MEM_LVLNUM_RAM only means it's a DRAM. It doesn't contain the location information. To distinguish the local and remote dram, X86 uses PERF_MEM_REMOTE_REMOTE. Here the remote dram will be mistakenly calculated if you only check the PERF_MEM_LVLNUM_RAM. Actually, it looks like the mem_lvl_num fields supported in this patch are also supported by the PERF_MEM_LVL*. Why don't you set both PERF_MEM_LVLNUM_* and PERF_MEM_LVL* in your previous patch 4? Then you can drop this patch. Thanks, Kan > stats->lcl_dram++; > if (snoop & P(SNOOP, HIT)) > stats->ld_shared++; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel