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 E255BC433F5 for ; Wed, 20 Apr 2022 08:49:44 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NnhPy3HzaDsT6/05g0B5Sei+gn6qn2lcGPOxaXvbu3k=; b=W6YeBFmyYaD8r0 Zo5tw0+Ph+48uTFVQzAk1utNL94ahvmTUM6hrMaTPMHHyKvgPeVTQUH3y4OvXfPDk5v/8ZC5UPEPH 6UobYbmUYK1JYJ6JhLNMoXiTcmMQpwBmoirXMQLBNg8jGV5QMoST1PQzeugabuxSsEn4wfFjX/Nv1 ghGjoMWFtpWy5HNjHR7qyI6fvhAOnRJIP8SNyMApB2dnyAQpdAdIEfasH/BAhgKaP9Ic5V3GQO2xa TcxQErRN4AAjjCHtaY6gm8B8cSYpwCwL7UnrGm83k9wTi4AXumfrk62ygcWXpwwglFzjvdFiRIRBt E00BvAmhs569B5atia3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nh60s-0089Ov-7y; Wed, 20 Apr 2022 08:48:38 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nh60o-0089Mo-5Y for linux-arm-kernel@lists.infradead.org; Wed, 20 Apr 2022 08:48:36 +0000 Received: by mail-ej1-x636.google.com with SMTP id y20so2045240eju.7 for ; Wed, 20 Apr 2022 01:48:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qpUXxpkY1LQrTCewxX/BwK6Ql1sWiAOxr2avilSjOww=; b=D5HHuJNPDcWp1NhI9j9oJPY7JJPhJj+u4XdYy1OxHt81Dn0FBmrtkeHQZMXe3qs7in F5uWxg1sMMIckuW84/EW22jv0iNA9uPUNUpXhBgwaGBXD90wfqoVeAg5vD0JqA7Z6V7R afuF9PVp7P5c3qnx7lTC/QrKKRVORLV0+dR8r5DdRSOj1wqhtdBcrRypRedRZAPBtWwy SaH54loFCEpKBqpyIIQjPlk2f5KhSC5u2TKKbh624a6BsRP+Fseii00sZ3ehon6fl+Fb NwXX7xs3MKYk8Fm1MGhuUZRKZPNDmxLf/pVUe+jps6uDt3Aywxj6szZxoi3F2pSjopHn yMcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qpUXxpkY1LQrTCewxX/BwK6Ql1sWiAOxr2avilSjOww=; b=MtKEFxp8CED2n0X2FzYzI/CaycI6SZMubuoGw36a+ZVOtU+LUyLuX5pPoeapSmBMPm LzPzN6jLdvPIxzJG1Ix54ODGG6Kkwr/koeLhffZG9nlq9Zn9RJsw2eDbi51J43jaUc/b 1jy6tuBRBsQR0HLuPqI6PVVVZ4frUovuEZaxQ8ee1eeGKI8Xb8ha7stPeo3IFY/4h734 HIDqhOI1mu485gVn9nLPwnKRCEOX9QzCWQF/ilq9L7bYPnHJ5lkd4cL1B+PZiVI4P/sK iy+D3Z4uz0jp8AQW0IQNA4YV2f44hPFt2l3eHjDIm+x2pNsEUFH1T5Bn6GiXx0cfvJls 3mSA== X-Gm-Message-State: AOAM532wLJhyjf/yLbmUota/0vYvoj+DT2I0P1MFmavxjidD6aUVhCB6 WNv6uKeSDf9IOLz2XHP3OGrn/g== X-Google-Smtp-Source: ABdhPJw837T3cRO9mLC5fpo5UIyr0XVBpI4v0Nlm9M0zRzKPBvuTg9N+7xCZv7v5VIuNF5cHZ9SIrg== X-Received: by 2002:a17:907:7286:b0:6ef:f594:e063 with SMTP id dt6-20020a170907728600b006eff594e063mr2925426ejc.611.1650444510495; Wed, 20 Apr 2022 01:48:30 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([104.245.96.34]) by smtp.gmail.com with ESMTPSA id n25-20020a1709062bd900b006e8766b7907sm6490432ejg.223.2022.04.20.01.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 01:48:29 -0700 (PDT) Date: Wed, 20 Apr 2022 16:48:23 +0800 From: Leo Yan To: German Gomez Cc: Ali Saidi , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, acme@kernel.org, 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 Subject: Re: [PATCH v5 5/5] perf mem: Support mem_lvl_num in c2c command Message-ID: <20220420084823.GE843168@leoy-ThinkPad-X240s> References: <20220408195344.32764-1-alisaidi@amazon.com> <20220408195344.32764-6-alisaidi@amazon.com> <3ad0128a-1b3d-37a7-81f6-fd597b565b18@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3ad0128a-1b3d-37a7-81f6-fd597b565b18@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220420_014834_255304_B963A0E1 X-CRM114-Status: GOOD ( 20.58 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 11, 2022 at 11:04:28AM +0100, German Gomez wrote: > > On 08/04/2022 20:53, 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++; > > Just for completion, can we also handle LFB as it seems to be being set > in "/arch/x86/events/intel/ds.c"? (Sorry I missed this in the v4) With fixing LFB issue pointed by German, the change looks good to me: Reviewed-by: Leo Yan It would be appreciate if x86 or PowerPC maintainers could take a look for this patch. Thanks! Leo > > - 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)) { > > 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