History

perf: Add mem_hops field in perf_mem_data_src structure

Going forward, future generation systems can have more hierarchy within the node/package level but currently we don't have any data source encoding field in perf, which can be used to represent this level of data. Add a new field called 'mem_hops' in the perf_mem_data_src structure which can be used to represent intra-node/package or inter-node/off-package details. This field is of size 3 bits where PERF_MEM_HOPS_{NA, 0..6} value can be used to present different hop levels data. Also add corresponding macros to define mem_hop field values and shift value. Currently we define macro for HOPS_0 which corresponds to data coming from another core but same node. For ex: Encodings for mem_hops fields with L2 cache: L2 - local L2 L2 | REMOTE | HOPS_0 - remote core, same node L2

Kajol Jain committed 5 years ago

Commit fec9cc61 parent f4c62171 file · +9 −2Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/perf_event.h+9−2
@@ -1225,14 +1225,16 @@ union perf_mem_data_src { · 1224 unmodified lines
1225 mem_remote:1, /* remote */1225 mem_remote:1, /* remote */
1226 mem_snoopx:2, /* snoop mode, ext */1226 mem_snoopx:2, /* snoop mode, ext */
1227 mem_blk:3, /* access blocked */1227 mem_blk:3, /* access blocked */
1228 mem_rsvd:21;1228 mem_hops:3, /* hop level */
1229 mem_rsvd:18;
1229 };1230 };
1230};1231};
1231#elif defined(__BIG_ENDIAN_BITFIELD)1232#elif defined(__BIG_ENDIAN_BITFIELD)
1232union perf_mem_data_src {1233union perf_mem_data_src {
1233 __u64 val;1234 __u64 val;
1234 struct {1235 struct {
1235 __u64 mem_rsvd:21,1236 __u64 mem_rsvd:18,
1237 mem_hops:3, /* hop level */
1236 mem_blk:3, /* access blocked */1238 mem_blk:3, /* access blocked */
1237 mem_snoopx:2, /* snoop mode, ext */1239 mem_snoopx:2, /* snoop mode, ext */
1238 mem_remote:1, /* remote */1240 mem_remote:1, /* remote */
@@ -1328,6 +1330,11 @@ union perf_mem_data_src { · 89 unmodified lines
1328#define PERF_MEM_BLK_ADDR 0x04 /* address conflict */1330#define PERF_MEM_BLK_ADDR 0x04 /* address conflict */
1329#define PERF_MEM_BLK_SHIFT 401331#define PERF_MEM_BLK_SHIFT 40
1330 1332
1333/* hop level */
1334#define PERF_MEM_HOPS_0 0x01 /* remote core, same node */
1335/* 2-7 available */
1336#define PERF_MEM_HOPS_SHIFT 43
1337
1331#define PERF_MEM_S(a, s) \1338#define PERF_MEM_S(a, s) \
1332 (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)1339 (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
1333 1340