From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936362AbcJVIlG (ORCPT ); Sat, 22 Oct 2016 04:41:06 -0400 Received: from terminus.zytor.com ([198.137.202.10]:57124 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932629AbcJVIlD (ORCPT ); Sat, 22 Oct 2016 04:41:03 -0400 Date: Sat, 22 Oct 2016 01:40:48 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: tglx@linutronix.de, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org, jolsa@kernel.org, acme@redhat.com, namhyung@kernel.org, andi@firstfloor.org, hpa@zytor.com, dsahern@gmail.com, jmario@redhat.com, dzickus@redhat.com, mingo@kernel.org Reply-To: linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de, acme@redhat.com, namhyung@kernel.org, andi@firstfloor.org, jolsa@kernel.org, dsahern@gmail.com, hpa@zytor.com, mingo@kernel.org, jmario@redhat.com, dzickus@redhat.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf c2c report: Add llc load miss dimension key Git-Commit-ID: 04402d205a40d38d1ebf4b48fb369bba39d4e05b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 04402d205a40d38d1ebf4b48fb369bba39d4e05b Gitweb: http://git.kernel.org/tip/04402d205a40d38d1ebf4b48fb369bba39d4e05b Author: Jiri Olsa AuthorDate: Thu, 19 May 2016 10:10:51 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 19 Oct 2016 13:18:31 -0300 perf c2c report: Add llc load miss dimension key It is to be displayed in the main cachelines overall output: ld_llcmiss It displays bare number of LLC misses for cacheline. Signed-off-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Don Zickus Cc: Joe Mario Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-wojujik7zzen770mxn295mxa@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-c2c.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 6b60183..f525384 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -421,6 +421,44 @@ STAT_FN(ld_l2hit) STAT_FN(ld_llchit) STAT_FN(rmt_hit) +static uint64_t llc_miss(struct c2c_stats *stats) +{ + uint64_t llcmiss; + + llcmiss = stats->lcl_dram + + stats->rmt_dram + + stats->rmt_hitm + + stats->rmt_hit; + + return llcmiss; +} + +static int +ld_llcmiss_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, + struct hist_entry *he) +{ + struct c2c_hist_entry *c2c_he; + int width = c2c_width(fmt, hpp, he->hists); + + c2c_he = container_of(he, struct c2c_hist_entry, he); + + return scnprintf(hpp->buf, hpp->size, "%*lu", width, + llc_miss(&c2c_he->stats)); +} + +static int64_t +ld_llcmiss_cmp(struct perf_hpp_fmt *fmt __maybe_unused, + struct hist_entry *left, struct hist_entry *right) +{ + struct c2c_hist_entry *c2c_left; + struct c2c_hist_entry *c2c_right; + + c2c_left = container_of(left, struct c2c_hist_entry, he); + c2c_right = container_of(right, struct c2c_hist_entry, he); + + return llc_miss(&c2c_left->stats) - llc_miss(&c2c_right->stats); +} + #define HEADER_LOW(__h) \ { \ .line[1] = { \ @@ -600,6 +638,14 @@ static struct c2c_dimension dim_ld_rmthit = { .width = 8, }; +static struct c2c_dimension dim_ld_llcmiss = { + .header = HEADER_BOTH("LLC", "Ld Miss"), + .name = "ld_llcmiss", + .cmp = ld_llcmiss_cmp, + .entry = ld_llcmiss_entry, + .width = 7, +}; + static struct c2c_dimension *dimensions[] = { &dim_dcacheline, &dim_offset, @@ -619,6 +665,7 @@ static struct c2c_dimension *dimensions[] = { &dim_ld_l2hit, &dim_ld_llchit, &dim_ld_rmthit, + &dim_ld_llcmiss, NULL, };