From patchwork Thu Aug 11 06:24:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12941175 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 59E50C19F2D for ; Thu, 11 Aug 2022 06:27:33 +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=bUHUO7lh1O7W/14g3GrJEg7kwNsesw9eklbEUW3N+UY=; b=4nl6qksDxY6ZlE P9ANQvXxNOMlxKWuVoNCmgqNiWxSIHRUPbTE51SAQjBhk7DCoiXkxBNwf5XnV06SPc9luXSLrmfeN FVyJLHU6BhkC5AQo47NnZ5fx8fJLcuQsDpByvPTtE80Co7UH7BDPLVdWmwifOl9nAfJLosmedP8T6 0D8+6ngcoh6z1K8DTpkXLJTy08fN8yrMWYCb3WqckjvO+hEQtsKnFVk5xwpyU97HqlWZXTeENzqmt Wfj97geOQg4+Aw56xIkrcCKY5t7fdRql4nyaU/agbhcqLb3+V87UNGZDY3ljEcZ5BaZIH4ib7oOfp FZNYvBFvCkOufQhZwnBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oM1e7-006toA-Lp; Thu, 11 Aug 2022 06:26:20 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oM1dQ-006rCt-6F for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2022 06:25:37 +0000 Received: by mail-pj1-x1029.google.com with SMTP id q7-20020a17090a7a8700b001f300db8677so4217052pjf.5 for ; Wed, 10 Aug 2022 23:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=cg7a420zG6mGCvpK6vY7htHWem4OIwFbitF47hyqumE=; b=wFl7aouajRfbB6E+kMU6XeqMu3NoocK7br+p3/49bIpe4jYXuIs7bjd4XBZejSGPR1 7eeALnSLscuSn2RCo5CFSEBNg3U4f7JuMkaM9p9vrTZt4DRk886qkyFOx9L402zurRl+ CqF8AbZxmZyvmqbvoJAu8LZeL/fsAIaJQJ02tkcwvt+gvAfG0B9SLav+IbFWMqBNGCxo DzGuO4Dx8gM3z+lMuuHZaCW66f9s7+ULN/kLsD5mM8WFxpfx6t/kQuO/MyFDwvhtq5o4 MIZZrk0g8I4GjuKLbcBAZ2SgUrbbeKNNm7sGHVAC5/VdL4KdnTtmCgJDemUtKHWtcvbr k6VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=cg7a420zG6mGCvpK6vY7htHWem4OIwFbitF47hyqumE=; b=HqMQfOkQwxBB+OF5zPu6buDH4bW14VSQGsdrLmvP2A710tJFzVxA0rNAK58tk5+RFb ImngIx5wDG1thT9FackaV+pfCfdmFe0ncLoYyIq0WSeCA7cpAyLcuuw4DWILSH8R9ZUs aFDYceHscY3ADwsfiRM+hTZoOCaRZiBjYBreXZUYjllGSZaGghHqufcwG7zik4Xy+6GV beGpzNVuqyZBnB8jHntEcDI3EIUu9sxvJ9KwOYMiRdRDmuthLdFEskOiMxtQmhEptANj ZmxTd+/HFrz0LLrOx5xKzhsqKZVigqSKkeIUXSRUwRg1/zt3ppQYXTqtF06Z+4Lix1TO czXg== X-Gm-Message-State: ACgBeo1T4nn17UISA401uJXlbsUAZSnO9hVKjnb7moRS5KPjyzt5ZAz9 N9zlw/t9S+HbqtesG+IiwwtsYA== X-Google-Smtp-Source: AA6agR6CzoXrkfrHDM8h4A9KPEADERjSTTYsvO4KYcFXuvBg48yGNd7DKUiVXAZ7pueiI/DiQekZvg== X-Received: by 2002:a17:90b:1907:b0:1f3:d6:985c with SMTP id mp7-20020a17090b190700b001f300d6985cmr7422284pjb.46.1660199133174; Wed, 10 Aug 2022 23:25:33 -0700 (PDT) Received: from leoy-yangtze.lan (n058152077182.netvigator.com. [58.152.77.182]) by smtp.gmail.com with ESMTPSA id o12-20020a17090a55cc00b001f506009036sm2766926pjm.49.2022.08.10.23.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 23:25:32 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , John Garry , Will Deacon , James Clark , Mike Leach , Kajol Jain , Ali Saidi , Adrian Hunter , "Gustavo A. R. Silva" , Anshuman Khandual , Ian Rogers , Like Xu , German Gomez , Timothy Hayes , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v6 05/15] perf c2c: Output statistics for peer snooping Date: Thu, 11 Aug 2022 14:24:41 +0800 Message-Id: <20220811062451.435810-6-leo.yan@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220811062451.435810-1-leo.yan@linaro.org> References: <20220811062451.435810-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-20220810_232536_347365_0B175ED5 X-CRM114-Status: GOOD ( 10.66 ) 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 outputs statistics for peer snooping for whole trace events and global shared cache line. Signed-off-by: Leo Yan Acked-by: Ian Rogers Tested-by: Ali Saidi Reviewed-by: Ali Saidi --- tools/perf/builtin-c2c.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 4898ee57d156..37bebeb6c11b 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2202,6 +2202,8 @@ static void print_c2c__display_stats(FILE *out) fprintf(out, " Load LLC Misses : %10d\n", llc_misses); fprintf(out, " Load access blocked by data : %10d\n", stats->blk_data); fprintf(out, " Load access blocked by address : %10d\n", stats->blk_addr); + fprintf(out, " Load HIT Local Peer : %10d\n", stats->lcl_peer); + fprintf(out, " Load HIT Remote Peer : %10d\n", stats->rmt_peer); fprintf(out, " LLC Misses to Local DRAM : %10.1f%%\n", ((double)stats->lcl_dram/(double)llc_misses) * 100.); fprintf(out, " LLC Misses to Remote DRAM : %10.1f%%\n", ((double)stats->rmt_dram/(double)llc_misses) * 100.); fprintf(out, " LLC Misses to Remote cache (HIT) : %10.1f%%\n", ((double)stats->rmt_hit /(double)llc_misses) * 100.); @@ -2230,6 +2232,7 @@ static void print_shared_cacheline_info(FILE *out) fprintf(out, " L1D hits on shared lines : %10d\n", stats->ld_l1hit); fprintf(out, " L2D hits on shared lines : %10d\n", stats->ld_l2hit); fprintf(out, " LLC hits on shared lines : %10d\n", stats->ld_llchit + stats->lcl_hitm); + fprintf(out, " Load hits on peer cache or nodes : %10d\n", stats->lcl_peer + stats->rmt_peer); fprintf(out, " Locked Access on shared lines : %10d\n", stats->locks); fprintf(out, " Blocked Access on shared lines : %10d\n", stats->blk_data + stats->blk_addr); fprintf(out, " Store HITs on shared lines : %10d\n", stats->store);