Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1660422 > unrolled thread
| Started by | Andi Kleen <andi@firstfloor.org> |
|---|---|
| First post | 2017-06-08 01:30 +0200 |
| Last post | 2017-06-09 10:10 +0200 |
| Articles | 9 — 5 participants |
Back to article view | Back to linux.kernel
Fix Skylake PEBS data source for perf Andi Kleen <andi@firstfloor.org> - 2017-06-08 01:30 +0200
[PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake Andi Kleen <andi@firstfloor.org> - 2017-06-08 01:30 +0200
Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake Peter Zijlstra <peterz@infradead.org> - 2017-06-08 10:20 +0200
Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake Stephane Eranian <eranian@google.com> - 2017-06-08 21:50 +0200
Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake Peter Zijlstra <peterz@infradead.org> - 2017-06-08 22:10 +0200
Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake Andi Kleen <ak@linux.intel.com> - 2017-06-09 18:50 +0200
Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake Andi Kleen <andi@firstfloor.org> - 2017-06-08 22:20 +0200
Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake Peter Zijlstra <peterz@infradead.org> - 2017-06-08 22:30 +0200
Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2017-06-09 10:10 +0200
| From | Andi Kleen <andi@firstfloor.org> |
|---|---|
| Date | 2017-06-08 01:30 +0200 |
| Subject | Fix Skylake PEBS data source for perf |
| Message-ID | <tPSyJ-4M5-11@gated-at.bofh.it> |
Fix data source reporting for Skylake and Skylake Server. The encodings have changed to express support for L4 and persistent memory. The first patch is a (independent) cleanup. The second is for the kernel and the third for perf/tools. The kernel part and perf tools will compile independently. v1: Initial post v2: Merged some patches. Change encoding to use special bit for each combination instead of modifiers.
[toc] | [next] | [standalone]
| From | Andi Kleen <andi@firstfloor.org> |
|---|---|
| Date | 2017-06-08 01:30 +0200 |
| Subject | [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake |
| Message-ID | <tPSyL-4M5-51@gated-at.bofh.it> |
| In reply to | #1660422 |
From: Andi Kleen <ak@linux.intel.com>
Skylake changed the encoding of the PEBS data source field.
Some combinations are not available anymore, but some new cases
e.g. for L4 cache hit are added.
Fix up the conversion table for Skylake, similar as had been done
for Nehalem.
On Skylake server the encoding for L4 actually means persistent
memory. Handle this case too.
To properly describe it in the abstracted perf format I had to add
some new bits. Unfortunately the existing fields were full, so
this required adding eXtension fields for mem_lvl and snoop
into existing reserved space.
v2: Merge with persistent memory patch.
Add explicit bit for each case instead of using generic modifier.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
arch/x86/events/intel/core.c | 2 ++
arch/x86/events/intel/ds.c | 13 +++++++++++++
arch/x86/events/perf_event.h | 2 ++
include/uapi/linux/perf_event.h | 22 ++++++++++++++++++++--
4 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index dec9b4bf0752..08e53f36d697 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -4052,6 +4052,8 @@ __init int intel_pmu_init(void)
skl_format_attr);
WARN_ON(!x86_pmu.format_attrs);
x86_pmu.cpu_events = hsw_events_attrs;
+ intel_pmu_pebs_data_source_skl(
+ boot_cpu_data.x86_model == INTEL_FAM6_SKYLAKE_X);
pr_cont("Skylake events, ");
break;
diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index 7732999f5e2a..cd28c4babd36 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -79,6 +79,19 @@ void __init intel_pmu_pebs_data_source_nhm(void)
pebs_data_source[0x07] = OP_LH | P(LVL, L3) | P(SNOOP, HITM);
}
+void __init intel_pmu_pebs_data_source_skl(bool pmem)
+{
+ u64 pmem_or_l4;
+
+ pmem_or_l4 = pmem ? P(LVLX, PMEM) : P(LVLX, L4);
+ pebs_data_source[0x08] = OP_LH | pmem_or_l4 | P(SNOOP, HIT);
+ pmem_or_l4 = pmem ? P(LVLX, REM_PMEM) : P(LVLX, REM_L4);
+ pebs_data_source[0x09] = OP_LH | pmem_or_l4 | P(SNOOP, HIT);
+ pebs_data_source[0x0b] = OP_LH | P(LVLX, REM_RAM) | P(SNOOP, NONE);
+ pebs_data_source[0x0c] = OP_LH | P(LVLX, REM_NA) | P(SNOOPX, FWD);
+ pebs_data_source[0x0d] = OP_LH | P(LVLX, REM_NA) | P(SNOOP, HITM);
+}
+
static u64 precise_store_data(u64 status)
{
union intel_x86_pebs_dse dse;
diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
index a6d9d6570957..d7571f248652 100644
--- a/arch/x86/events/perf_event.h
+++ b/arch/x86/events/perf_event.h
@@ -946,6 +946,8 @@ void intel_pmu_lbr_init_knl(void);
void intel_pmu_pebs_data_source_nhm(void);
+void intel_pmu_pebs_data_source_skl(bool pmem);
+
int intel_pmu_setup_lbr_filter(struct perf_event *event);
void intel_pt_interrupt(void);
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index b1c0b187acfe..95daade294d7 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -931,14 +931,18 @@ union perf_mem_data_src {
mem_snoop:5, /* snoop mode */
mem_lock:2, /* lock instr */
mem_dtlb:7, /* tlb access */
- mem_rsvd:31;
+ mem_lvlx:8, /* memory hierarchy level, ext */
+ mem_snoopx:2, /* snoop mode, ext */
+ mem_rsvd:21;
};
};
#elif defined(__BIG_ENDIAN_BITFIELD)
union perf_mem_data_src {
__u64 val;
struct {
- __u64 mem_rsvd:31,
+ __u64 mem_rsvd:21,
+ mem_snoopx:2, /* snoop mode, ext */
+ mem_lvlx:8, /* memory hierarchy level, ext */
mem_dtlb:7, /* tlb access */
mem_lock:2, /* lock instr */
mem_snoop:5, /* snoop mode */
@@ -975,6 +979,16 @@ union perf_mem_data_src {
#define PERF_MEM_LVL_UNC 0x2000 /* Uncached memory */
#define PERF_MEM_LVL_SHIFT 5
+#define PERF_MEM_LVLX_L4 0x01 /* L4 */
+#define PERF_MEM_LVLX_REM_L4 0x02 /* Remote L4 */
+#define PERF_MEM_LVLX_REM_RAM 0x04 /* Remote Ram, unknown hops */
+#define PERF_MEM_LVLX_PMEM 0x08 /* Persistent Memory */
+#define PERF_MEM_LVLX_REM_PMEM 0x10 /* Remote Persistent Memory */
+#define PERF_MEM_LVLX_REM_NA 0x20 /* Remote N/A level */
+/* 2 free */
+
+#define PERF_MEM_LVLX_SHIFT 33
+
/* snoop mode */
#define PERF_MEM_SNOOP_NA 0x01 /* not available */
#define PERF_MEM_SNOOP_NONE 0x02 /* no snoop */
@@ -983,6 +997,10 @@ union perf_mem_data_src {
#define PERF_MEM_SNOOP_HITM 0x10 /* snoop hit modified */
#define PERF_MEM_SNOOP_SHIFT 19
+#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
+/* 1 free */
+#define PERF_MEM_SNOOPX_SHIFT 41
+
/* locked instruction */
#define PERF_MEM_LOCK_NA 0x01 /* not available */
#define PERF_MEM_LOCK_LOCKED 0x02 /* locked transaction */
--
2.9.4
[toc] | [prev] | [next] | [standalone]
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2017-06-08 10:20 +0200 |
| Subject | Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake |
| Message-ID | <tQ0PE-1Le-17@gated-at.bofh.it> |
| In reply to | #1660423 |
On Wed, Jun 07, 2017 at 04:22:24PM -0700, Andi Kleen wrote:
> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> index b1c0b187acfe..95daade294d7 100644
> --- a/include/uapi/linux/perf_event.h
> +++ b/include/uapi/linux/perf_event.h
> @@ -931,14 +931,18 @@ union perf_mem_data_src {
> mem_snoop:5, /* snoop mode */
> mem_lock:2, /* lock instr */
> mem_dtlb:7, /* tlb access */
> - mem_rsvd:31;
> + mem_lvlx:8, /* memory hierarchy level, ext */
> + mem_snoopx:2, /* snoop mode, ext */
> + mem_rsvd:21;
> };
> };
> #elif defined(__BIG_ENDIAN_BITFIELD)
> union perf_mem_data_src {
> __u64 val;
> struct {
> - __u64 mem_rsvd:31,
> + __u64 mem_rsvd:21,
> + mem_snoopx:2, /* snoop mode, ext */
> + mem_lvlx:8, /* memory hierarchy level, ext */
> mem_dtlb:7, /* tlb access */
> mem_lock:2, /* lock instr */
> mem_snoop:5, /* snoop mode */
So one thing we could do is add a mem_hops field and always set that,
even for the old stuff. The old stuff will not know about that field and
ignore the bits, but new stuff will then not need as many LVL bits.
Of course, we then get into the problem of how many bits of hops we
need.. Power guys ?
> @@ -975,6 +979,16 @@ union perf_mem_data_src {
> #define PERF_MEM_LVL_UNC 0x2000 /* Uncached memory */
> #define PERF_MEM_LVL_SHIFT 5
>
> +#define PERF_MEM_LVLX_L4 0x01 /* L4 */
> +#define PERF_MEM_LVLX_REM_L4 0x02 /* Remote L4 */
> +#define PERF_MEM_LVLX_REM_RAM 0x04 /* Remote Ram, unknown hops */
> +#define PERF_MEM_LVLX_PMEM 0x08 /* Persistent Memory */
> +#define PERF_MEM_LVLX_REM_PMEM 0x10 /* Remote Persistent Memory */
> +#define PERF_MEM_LVLX_REM_NA 0x20 /* Remote N/A level */
Still wondering what the point of REM_NA is.. can you explain?
> +/* 2 free */
> +
> +#define PERF_MEM_LVLX_SHIFT 33
> +
> /* snoop mode */
> #define PERF_MEM_SNOOP_NA 0x01 /* not available */
> #define PERF_MEM_SNOOP_NONE 0x02 /* no snoop */
> @@ -983,6 +997,10 @@ union perf_mem_data_src {
> #define PERF_MEM_SNOOP_HITM 0x10 /* snoop hit modified */
> #define PERF_MEM_SNOOP_SHIFT 19
>
> +#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
> +/* 1 free */
> +#define PERF_MEM_SNOOPX_SHIFT 41
> +
> /* locked instruction */
> #define PERF_MEM_LOCK_NA 0x01 /* not available */
> #define PERF_MEM_LOCK_LOCKED 0x02 /* locked transaction */
> --
> 2.9.4
>
[toc] | [prev] | [next] | [standalone]
| From | Stephane Eranian <eranian@google.com> |
|---|---|
| Date | 2017-06-08 21:50 +0200 |
| Subject | Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake |
| Message-ID | <tQbBo-8th-17@gated-at.bofh.it> |
| In reply to | #1660914 |
Hi,
On Thu, Jun 8, 2017 at 1:15 AM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Wed, Jun 07, 2017 at 04:22:24PM -0700, Andi Kleen wrote:
>
> > diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> > index b1c0b187acfe..95daade294d7 100644
> > --- a/include/uapi/linux/perf_event.h
> > +++ b/include/uapi/linux/perf_event.h
> > @@ -931,14 +931,18 @@ union perf_mem_data_src {
> > mem_snoop:5, /* snoop mode */
> > mem_lock:2, /* lock instr */
> > mem_dtlb:7, /* tlb access */
> > - mem_rsvd:31;
> > + mem_lvlx:8, /* memory hierarchy level, ext */
> > + mem_snoopx:2, /* snoop mode, ext */
> > + mem_rsvd:21;
> > };
> > };
> > #elif defined(__BIG_ENDIAN_BITFIELD)
> > union perf_mem_data_src {
> > __u64 val;
> > struct {
> > - __u64 mem_rsvd:31,
> > + __u64 mem_rsvd:21,
> > + mem_snoopx:2, /* snoop mode, ext */
> > + mem_lvlx:8, /* memory hierarchy level, ext */
> > mem_dtlb:7, /* tlb access */
> > mem_lock:2, /* lock instr */
> > mem_snoop:5, /* snoop mode */
>
> So one thing we could do is add a mem_hops field and always set that,
> even for the old stuff. The old stuff will not know about that field and
> ignore the bits, but new stuff will then not need as many LVL bits.
>
That would be better than lvlx I think. I am guessing you're suggesting
an integer count here and not a bitmask. Right? Then I wonder why it
would need 8 bits or 255 possible levels!
> Of course, we then get into the problem of how many bits of hops we
> need.. Power guys ?
>
> > @@ -975,6 +979,16 @@ union perf_mem_data_src {
> > #define PERF_MEM_LVL_UNC 0x2000 /* Uncached memory */
> > #define PERF_MEM_LVL_SHIFT 5
> >
> > +#define PERF_MEM_LVLX_L4 0x01 /* L4 */
> > +#define PERF_MEM_LVLX_REM_L4 0x02 /* Remote L4 */
> > +#define PERF_MEM_LVLX_REM_RAM 0x04 /* Remote Ram, unknown hops */
> > +#define PERF_MEM_LVLX_PMEM 0x08 /* Persistent Memory */
> > +#define PERF_MEM_LVLX_REM_PMEM 0x10 /* Remote Persistent Memory */
> > +#define PERF_MEM_LVLX_REM_NA 0x20 /* Remote N/A level */
>
> Still wondering what the point of REM_NA is.. can you explain?
>
> > +/* 2 free */
> > +
> > +#define PERF_MEM_LVLX_SHIFT 33
> > +
> > /* snoop mode */
> > #define PERF_MEM_SNOOP_NA 0x01 /* not available */
> > #define PERF_MEM_SNOOP_NONE 0x02 /* no snoop */
> > @@ -983,6 +997,10 @@ union perf_mem_data_src {
> > #define PERF_MEM_SNOOP_HITM 0x10 /* snoop hit modified */
> > #define PERF_MEM_SNOOP_SHIFT 19
> >
> > +#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
> > +/* 1 free */
> > +#define PERF_MEM_SNOOPX_SHIFT 41
> > +
> > /* locked instruction */
> > #define PERF_MEM_LOCK_NA 0x01 /* not available */
> > #define PERF_MEM_LOCK_LOCKED 0x02 /* locked transaction */
> > --
> > 2.9.4
> >
[toc] | [prev] | [next] | [standalone]
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2017-06-08 22:10 +0200 |
| Subject | Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake |
| Message-ID | <tQbUK-nj-27@gated-at.bofh.it> |
| In reply to | #1661624 |
On Thu, Jun 08, 2017 at 12:40:59PM -0700, Stephane Eranian wrote:
> Hi,
>
> On Thu, Jun 8, 2017 at 1:15 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Wed, Jun 07, 2017 at 04:22:24PM -0700, Andi Kleen wrote:
> >
> > > diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> > > index b1c0b187acfe..95daade294d7 100644
> > > --- a/include/uapi/linux/perf_event.h
> > > +++ b/include/uapi/linux/perf_event.h
> > > @@ -931,14 +931,18 @@ union perf_mem_data_src {
> > > mem_snoop:5, /* snoop mode */
> > > mem_lock:2, /* lock instr */
> > > mem_dtlb:7, /* tlb access */
> > > - mem_rsvd:31;
> > > + mem_lvlx:8, /* memory hierarchy level, ext */
> > > + mem_snoopx:2, /* snoop mode, ext */
> > > + mem_rsvd:21;
> > > };
> > > };
> > > #elif defined(__BIG_ENDIAN_BITFIELD)
> > > union perf_mem_data_src {
> > > __u64 val;
> > > struct {
> > > - __u64 mem_rsvd:31,
> > > + __u64 mem_rsvd:21,
> > > + mem_snoopx:2, /* snoop mode, ext */
> > > + mem_lvlx:8, /* memory hierarchy level, ext */
> > > mem_dtlb:7, /* tlb access */
> > > mem_lock:2, /* lock instr */
> > > mem_snoop:5, /* snoop mode */
> >
> > So one thing we could do is add a mem_hops field and always set that,
> > even for the old stuff. The old stuff will not know about that field and
> > ignore the bits, but new stuff will then not need as many LVL bits.
> >
> That would be better than lvlx I think. I am guessing you're suggesting
> an integer count here and not a bitmask. Right?
Yah, 0 hops = local, etc..
> Then I wonder why it
> would need 8 bits or 255 possible levels!
I thing we still need lvlx, simply because the current lvl doesn't have
room to encode L4.
But having a mem_hops field avoids having to have local/remote/remote2
variants of everything.
That said, I'm afraid SGI can actually fill a mem_hops:8 or something like
that ;-)
[toc] | [prev] | [next] | [standalone]
| From | Andi Kleen <ak@linux.intel.com> |
|---|---|
| Date | 2017-06-09 18:50 +0200 |
| Subject | Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake |
| Message-ID | <tQvgK-3VG-37@gated-at.bofh.it> |
| In reply to | #1661643 |
> > > So one thing we could do is add a mem_hops field and always set that, > > > even for the old stuff. The old stuff will not know about that field and > > > ignore the bits, but new stuff will then not need as many LVL bits. > > > > > That would be better than lvlx I think. I am guessing you're suggesting > > an integer count here and not a bitmask. Right? > > Yah, 0 hops = local, etc.. This doesn't work on Skylake because it doesn't report the number of hops, just remote or not. Would need a wildcard entry, but that can as well be a separate bit. That's what I did in the latest version of my patch. -Andi
[toc] | [prev] | [next] | [standalone]
| From | Andi Kleen <andi@firstfloor.org> |
|---|---|
| Date | 2017-06-08 22:20 +0200 |
| Subject | Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake |
| Message-ID | <tQc4q-sN-5@gated-at.bofh.it> |
| In reply to | #1661624 |
On Thu, Jun 08, 2017 at 12:40:59PM -0700, Stephane Eranian wrote:
> Hi,
>
> On Thu, Jun 8, 2017 at 1:15 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Wed, Jun 07, 2017 at 04:22:24PM -0700, Andi Kleen wrote:
> >
> > > diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> > > index b1c0b187acfe..95daade294d7 100644
> > > --- a/include/uapi/linux/perf_event.h
> > > +++ b/include/uapi/linux/perf_event.h
> > > @@ -931,14 +931,18 @@ union perf_mem_data_src {
> > > mem_snoop:5, /* snoop mode */
> > > mem_lock:2, /* lock instr */
> > > mem_dtlb:7, /* tlb access */
> > > - mem_rsvd:31;
> > > + mem_lvlx:8, /* memory hierarchy level, ext */
> > > + mem_snoopx:2, /* snoop mode, ext */
> > > + mem_rsvd:21;
> > > };
> > > };
> > > #elif defined(__BIG_ENDIAN_BITFIELD)
> > > union perf_mem_data_src {
> > > __u64 val;
> > > struct {
> > > - __u64 mem_rsvd:31,
> > > + __u64 mem_rsvd:21,
> > > + mem_snoopx:2, /* snoop mode, ext */
> > > + mem_lvlx:8, /* memory hierarchy level, ext */
> > > mem_dtlb:7, /* tlb access */
> > > mem_lock:2, /* lock instr */
> > > mem_snoop:5, /* snoop mode */
> >
> > So one thing we could do is add a mem_hops field and always set that,
> > even for the old stuff. The old stuff will not know about that field and
> > ignore the bits, but new stuff will then not need as many LVL bits.
Note that Skylake cannot fill it in, it doesn't report the hops.
And for the old parts the existing bits work. So I don't think
there's a motivation to add a new hops field, unless some other
architecture needs it.
> >
> That would be better than lvlx I think. I am guessing you're suggesting
> an integer count here and not a bitmask. Right? Then I wonder why it
> would need 8 bits or 255 possible levels!
Sure counts are better than bits. At least it's a far more efficient
encoding. Ok so add a new level_num field, and use one count for
PMEM and L4, and also fill in for the others.
> > > +#define PERF_MEM_LVLX_PMEM 0x08 /* Persistent Memory */
> > > +#define PERF_MEM_LVLX_REM_PMEM 0x10 /* Remote Persistent Memory */
> > > +#define PERF_MEM_LVLX_REM_NA 0x20 /* Remote N/A level */
> >
> > Still wondering what the point of REM_NA is.. can you explain?
It's a remote cache, but the hardware doesn't report which one,
and also doesn't report the hops.
Ok PERF_MEM_LVL_REM_CCE would be a better name I guess, fitting
with the existing ones.
-Andi
[toc] | [prev] | [next] | [standalone]
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2017-06-08 22:30 +0200 |
| Subject | Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake |
| Message-ID | <tQce6-vS-27@gated-at.bofh.it> |
| In reply to | #1661644 |
On Thu, Jun 08, 2017 at 01:10:07PM -0700, Andi Kleen wrote: > Note that Skylake cannot fill it in, it doesn't report the hops. > And for the old parts the existing bits work. So I don't think > there's a motivation to add a new hops field, unless some other > architecture needs it. PowerPC is currently using the REM2 stuff, I added the people who wrote that code to Cc in the hope they would help by explaining their platform capabilities.
[toc] | [prev] | [next] | [standalone]
| From | Madhavan Srinivasan <maddy@linux.vnet.ibm.com> |
|---|---|
| Date | 2017-06-09 10:10 +0200 |
| Subject | Re: [PATCH v2 2/4] perf/x86: Fix data source decoding for Skylake |
| Message-ID | <tQn9v-7uN-17@gated-at.bofh.it> |
| In reply to | #1660914 |
On Thursday 08 June 2017 01:45 PM, Peter Zijlstra wrote:
> On Wed, Jun 07, 2017 at 04:22:24PM -0700, Andi Kleen wrote:
>
>> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
>> index b1c0b187acfe..95daade294d7 100644
>> --- a/include/uapi/linux/perf_event.h
>> +++ b/include/uapi/linux/perf_event.h
>> @@ -931,14 +931,18 @@ union perf_mem_data_src {
>> mem_snoop:5, /* snoop mode */
>> mem_lock:2, /* lock instr */
>> mem_dtlb:7, /* tlb access */
>> - mem_rsvd:31;
>> + mem_lvlx:8, /* memory hierarchy level, ext */
>> + mem_snoopx:2, /* snoop mode, ext */
>> + mem_rsvd:21;
>> };
>> };
>> #elif defined(__BIG_ENDIAN_BITFIELD)
>> union perf_mem_data_src {
>> __u64 val;
>> struct {
>> - __u64 mem_rsvd:31,
>> + __u64 mem_rsvd:21,
>> + mem_snoopx:2, /* snoop mode, ext */
>> + mem_lvlx:8, /* memory hierarchy level, ext */
>> mem_dtlb:7, /* tlb access */
>> mem_lock:2, /* lock instr */
>> mem_snoop:5, /* snoop mode */
> So one thing we could do is add a mem_hops field and always set that,
> even for the old stuff. The old stuff will not know about that field and
> ignore the bits, but new stuff will then not need as many LVL bits.
>
> Of course, we then get into the problem of how many bits of hops we
> need.. Power guys ?
Currently we support 3 hops (local, remote and distant) and
in future we may have another for capi. So 4 levels of hops
might do. 8 would be nice future proof.
Maddy
>
>> @@ -975,6 +979,16 @@ union perf_mem_data_src {
>> #define PERF_MEM_LVL_UNC 0x2000 /* Uncached memory */
>> #define PERF_MEM_LVL_SHIFT 5
>>
>> +#define PERF_MEM_LVLX_L4 0x01 /* L4 */
>> +#define PERF_MEM_LVLX_REM_L4 0x02 /* Remote L4 */
>> +#define PERF_MEM_LVLX_REM_RAM 0x04 /* Remote Ram, unknown hops */
>> +#define PERF_MEM_LVLX_PMEM 0x08 /* Persistent Memory */
>> +#define PERF_MEM_LVLX_REM_PMEM 0x10 /* Remote Persistent Memory */
>> +#define PERF_MEM_LVLX_REM_NA 0x20 /* Remote N/A level */
> Still wondering what the point of REM_NA is.. can you explain?
>
>> +/* 2 free */
>> +
>> +#define PERF_MEM_LVLX_SHIFT 33
>> +
>> /* snoop mode */
>> #define PERF_MEM_SNOOP_NA 0x01 /* not available */
>> #define PERF_MEM_SNOOP_NONE 0x02 /* no snoop */
>> @@ -983,6 +997,10 @@ union perf_mem_data_src {
>> #define PERF_MEM_SNOOP_HITM 0x10 /* snoop hit modified */
>> #define PERF_MEM_SNOOP_SHIFT 19
>>
>> +#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
>> +/* 1 free */
>> +#define PERF_MEM_SNOOPX_SHIFT 41
>> +
>> /* locked instruction */
>> #define PERF_MEM_LOCK_NA 0x01 /* not available */
>> #define PERF_MEM_LOCK_LOCKED 0x02 /* locked transaction */
>> --
>> 2.9.4
>>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web