Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp179648iob; Tue, 17 May 2022 22:58:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6fIUqY3hkNqHUpvL217hNmH4YLxIYR2ftv7ji2MEd4OuIDb39tWs6Z8eFJWzkDB0HnYPe X-Received: by 2002:a17:903:2350:b0:15e:d63f:9721 with SMTP id c16-20020a170903235000b0015ed63f9721mr26097948plh.116.1652853522545; Tue, 17 May 2022 22:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652853522; cv=none; d=google.com; s=arc-20160816; b=aSWVIHXy0AfhP1mMidZEg3x+YIRj2T5aO4HN4+i8u397TTCnAKMUDwlw2DHRsbJbxK V2XZeTaHvnlLYUpfINECPgqMIXNFXb2mhUW5i83MLxtlyWLEnJaZwl1piS9za0VBbAAm QlePw8kflag0488P4JsmQ2LOraJ6tNV1rNrPBIjGxi+oQ4+Y2ttix0f2YQECGnpSwbwz NxrOoQKqs8rFbdBvDZ0sU/+ZdSRKNCul0ep758Qc04R3kf0kqhoSXSaMNaK6HLrEDnzI dv/l4dwcP/+fciCGBuu5C16+eHVKRBqK82liijOLLfEWdKCAMcB8U4y76TyooNUftRxH ZcXg== 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=R3Yh9OX4NzFrM6RxjNS5jxXjJZrys2g1AGRWw+4sxiM=; b=xYcsfBK3PhrDcIYcT/c/4T6wwQ3oaev0ZS35WZzccYTN2h+k9kQSf01gAwzvvrCocr d5a8+6FfMigqRv+7DgldEXn0zT1b2bAepT03tt+DMdxmfHHt1J6ie4Mw+NPp/yeup8RK AmNlNtY9AkzIxZVfIoRZBsgOGFyZI/J1Zfvpw/xjQY/bJEdfkZz/ltafsVVcMmZhGrKg Sy+jVlUU1jC4KKxM08Lnz2lQRdGoa5Qs5LrOM7Hu6rknRQe5hCH53ALes3RZcTStkBKd +dkv0IjtzBiNLFZvWSYfeXCI3aqhiZx83FmdtrjmNUwRZovG6rzvgvR4GJWqjnt06Tex RIXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q9kNuOfA; 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 g14-20020a65580e000000b003dba52917d9si1867036pgr.440.2022.05.17.22.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 22:58:42 -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=Q9kNuOfA; 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 EED7CBCE9D; Tue, 17 May 2022 22:58:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230346AbiERF6D (ORCPT + 99 others); Wed, 18 May 2022 01:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230341AbiERF56 (ORCPT ); Wed, 18 May 2022 01:57:58 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 460AB427C7 for ; Tue, 17 May 2022 22:57:57 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id nr2-20020a17090b240200b001df2b1bfc40so4610691pjb.5 for ; Tue, 17 May 2022 22:57:57 -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=R3Yh9OX4NzFrM6RxjNS5jxXjJZrys2g1AGRWw+4sxiM=; b=Q9kNuOfARJjI7J2EZ3CQdmbELpBY7kE9qwf16TgG7SyMG/EaO482O2dRGzygG3Qba3 hN3UHWLkcxibOZ5vWaDprr/jh1M3P98J5SrkRAQDrSvytLP/PJnff4jxR27ofiKkNw14 DtUaPf9Y4TAYD/zj53xxWh5Jep2wNitoQppJza/b5i7O61rYhAt/8H4HKA+Wj0ouUbiU 6mT9ceOkJcgQlVm0qOUD6aOoassvRQ4x/cqKOylEm6aNfhfDfo2ZirhUScfFy5ZSyc3T s4YdGZJu7vE97vS3Ey21S9XYvoqcQy7RVDuPH8m9jb51AV1Vnz1BtgVnqgJwEfuFQ6CW Nqaw== 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=R3Yh9OX4NzFrM6RxjNS5jxXjJZrys2g1AGRWw+4sxiM=; b=0IYfryQgNtRhKdN5sAq5XV/JC8KegSPmeotYVfnVUYJW2+UsPe/hxVckEuy5NhN/uP iopmMA5OPsxAs8OAHcmVeVkl5VhPlCgRffwouAsfTIuPQ4FGjmZ5L34nuIMh1yF37bc0 LhljRMIUb2Aj0VXmQUzrk8HtZaip5c3SxGHqFWtrYts3dn26S+Jb2CZ4zX3WetzpscBR UgzS14sq4LNfbQZo5WbKxps7L9VbLifmukV0bkZwD0o7CXOURbJ60m4kmI5dVoJd08rS pMXBSpFzov5Vws+f8U1YboHQpR83DXAyiusj8nKGkHE7AjnFZwCVYJ4fyeFN9eEhKlYm QDVg== X-Gm-Message-State: AOAM531UaKCFMj6AF8eDFPnDoAnstpyAu3qmOSJ9Z9V5ScPlXMJGl+jB ZSeeuL6Dxn2TWsK2V0A79MrnTw== X-Received: by 2002:a17:90b:4b48:b0:1de:af4f:7e13 with SMTP id mi8-20020a17090b4b4800b001deaf4f7e13mr28275660pjb.146.1652853476613; Tue, 17 May 2022 22:57:56 -0700 (PDT) Received: from localhost.localdomain (n058152048195.netvigator.com. [58.152.48.195]) by smtp.gmail.com with ESMTPSA id cp16-20020a170902e79000b0015e8d4eb2c2sm627127plb.268.2022.05.17.22.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 22:57:56 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Like Xu , Alyssa Ross , Ian Rogers , Kajol Jain , Adam Li , Li Huafei , German Gomez , James Clark , Kan Liang , Ali Saidi , Joe Mario , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v3 01/11] perf mem: Add stats for store operation with no available memory level Date: Wed, 18 May 2022 13:57:19 +0800 Message-Id: <20220518055729.1869566-2-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220518055729.1869566-1-leo.yan@linaro.org> References: <20220518055729.1869566-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 Sometimes we don't know memory store operations happen on exactly which memory (or cache) level, the memory level flag is set to PERF_MEM_LVL_NA in this case; a practical example is Arm SPE AUX trace sets this flag for all store operations due to absent info for cache level. This patch is to add a new item "st_na" in structure c2c_stats to add statistics for store operations with no available cache level. Signed-off-by: Leo Yan --- tools/perf/util/mem-events.c | 3 +++ tools/perf/util/mem-events.h | 1 + 2 files changed, 4 insertions(+) diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c index db5225caaabe..5dca1882c284 100644 --- a/tools/perf/util/mem-events.c +++ b/tools/perf/util/mem-events.c @@ -621,6 +621,8 @@ do { \ } if (lvl & P(LVL, MISS)) if (lvl & P(LVL, L1)) stats->st_l1miss++; + if (lvl & P(LVL, NA)) + stats->st_na++; } else { /* unparsable data_src? */ stats->noparse++; @@ -647,6 +649,7 @@ void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add) stats->st_noadrs += add->st_noadrs; stats->st_l1hit += add->st_l1hit; stats->st_l1miss += add->st_l1miss; + stats->st_na += add->st_na; stats->load += add->load; stats->ld_excl += add->ld_excl; stats->ld_shared += add->ld_shared; diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h index 916242f8020a..8a8b568baeee 100644 --- a/tools/perf/util/mem-events.h +++ b/tools/perf/util/mem-events.h @@ -63,6 +63,7 @@ struct c2c_stats { u32 st_noadrs; /* cacheable store with no address */ u32 st_l1hit; /* count of stores that hit L1D */ u32 st_l1miss; /* count of stores that miss L1D */ + u32 st_na; /* count of stores with memory level is not available */ u32 load; /* count of all loads in trace */ u32 ld_excl; /* exclusive loads, rmt/lcl DRAM - snp none/miss */ u32 ld_shared; /* shared loads, rmt/lcl DRAM - snp hit */ -- 2.25.1