From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org,
dsahern@gmail.com, jolsa@redhat.com, dzickus@redhat.com,
mingo@kernel.org, a.p.zijlstra@chello.nl, namhyung@kernel.org,
acme@redhat.com, andi@firstfloor.org, hpa@zytor.com,
jmario@redhat.com, jolsa@kernel.org
Subject: [tip:perf/core] perf c2c report: Add struct c2c_stats::tot_hitm field
Date: Wed, 23 Nov 2016 20:16:59 -0800 [thread overview]
Message-ID: <tip-dba8ab93792a3a864ff741efe435b2ecbdfb66b1@git.kernel.org> (raw)
In-Reply-To: <1479764011-10732-5-git-send-email-jolsa@kernel.org>
Commit-ID: dba8ab93792a3a864ff741efe435b2ecbdfb66b1
Gitweb: http://git.kernel.org/tip/dba8ab93792a3a864ff741efe435b2ecbdfb66b1
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 21 Nov 2016 22:33:29 +0100
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 23 Nov 2016 10:44:05 -0300
perf c2c report: Add struct c2c_stats::tot_hitm field
Count total number of HITMs in a special field. This will ease up
addition of total HITM sorting into c2c report in the following patch.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1479764011-10732-5-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/mem-events.c | 12 ++++++++++--
tools/perf/util/mem-events.h | 1 +
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c
index e507732..1d4ab53 100644
--- a/tools/perf/util/mem-events.c
+++ b/tools/perf/util/mem-events.c
@@ -280,6 +280,12 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
u64 lock = data_src->mem_lock;
int err = 0;
+#define HITM_INC(__f) \
+do { \
+ stats->__f++; \
+ stats->tot_hitm++; \
+} while (0)
+
#define P(a, b) PERF_MEM_##a##_##b
stats->nr_entries++;
@@ -303,7 +309,7 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
if (lvl & P(LVL, L2 )) stats->ld_l2hit++;
if (lvl & P(LVL, L3 )) {
if (snoop & P(SNOOP, HITM))
- stats->lcl_hitm++;
+ HITM_INC(lcl_hitm);
else
stats->ld_llchit++;
}
@@ -331,7 +337,7 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
if (snoop & P(SNOOP, HIT))
stats->rmt_hit++;
else if (snoop & P(SNOOP, HITM))
- stats->rmt_hitm++;
+ HITM_INC(rmt_hitm);
}
if ((lvl & P(LVL, MISS)))
@@ -364,6 +370,7 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
}
#undef P
+#undef HITM_INC
return err;
}
@@ -390,6 +397,7 @@ void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add)
stats->ld_llchit += add->ld_llchit;
stats->lcl_hitm += add->lcl_hitm;
stats->rmt_hitm += add->rmt_hitm;
+ stats->tot_hitm += add->tot_hitm;
stats->rmt_hit += add->rmt_hit;
stats->lcl_dram += add->lcl_dram;
stats->rmt_dram += add->rmt_dram;
diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h
index faf8040..40f72ee 100644
--- a/tools/perf/util/mem-events.h
+++ b/tools/perf/util/mem-events.h
@@ -59,6 +59,7 @@ struct c2c_stats {
u32 ld_llchit; /* count of loads that hit LLC */
u32 lcl_hitm; /* count of loads with local HITM */
u32 rmt_hitm; /* count of loads with remote HITM */
+ u32 tot_hitm; /* count of loads with local and remote HITM */
u32 rmt_hit; /* count of loads with remote hit clean; */
u32 lcl_dram; /* count of loads miss to local DRAM */
u32 rmt_dram; /* count of loads miss to remote DRAM */
next prev parent reply other threads:[~2016-11-24 4:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-21 21:33 [PATCH 0/6] perf c2c report: Change default HITM sort/display Jiri Olsa
2016-11-21 21:33 ` [PATCH 1/6] perf tools: Show event fd in debug output Jiri Olsa
2016-11-24 4:15 ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-11-21 21:33 ` [PATCH 2/6] perf c2c report: Setup browser after opening perf.data Jiri Olsa
2016-11-24 4:16 ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-11-21 21:33 ` [PATCH 3/6] perf c2c report: Add -f/--force option Jiri Olsa
2016-11-24 4:16 ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-11-21 21:33 ` [PATCH 4/6] perf c2c report: Add struct c2c_stats::tot_hitm field Jiri Olsa
2016-11-24 4:16 ` tip-bot for Jiri Olsa [this message]
2016-11-21 21:33 ` [PATCH 5/6] perf c2c report: Display total HITMs on default Jiri Olsa
2016-11-24 4:17 ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-11-21 21:33 ` [PATCH 6/6] perf c2c: Support cascading options Jiri Olsa
2016-11-24 4:17 ` [tip:perf/core] " tip-bot for Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-dba8ab93792a3a864ff741efe435b2ecbdfb66b1@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=andi@firstfloor.org \
--cc=dsahern@gmail.com \
--cc=dzickus@redhat.com \
--cc=hpa@zytor.com \
--cc=jmario@redhat.com \
--cc=jolsa@kernel.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.