History

perf tools: Add support for printing new mem_info encodings

Add decoding for the new "lvlx" and "snoopx" meminfo fields added earlier to the kernel so that "perf mem report" and other tools can print it properly. v2: Merge with persistent memory patch. Switch to new bit encoding for each combination. v3: Switch to generic lvlnum field.

Andi Kleen committed 9 years ago

Commit 52839e61 parent 41d3d6d2 files · +68 −5Browse files

Showing the changes to tools/include/uapi (1 of 2 files). Show all

Unified · Split

tools/include/uapi/linux/perf_event.h+28−2
@@ -954,14 +954,20 @@ union perf_mem_data_src { · 953 unmodified lines
954954 mem_snoop:5, /* snoop mode */
955955 mem_lock:2, /* lock instr */
956956 mem_dtlb:7, /* tlb access */
957− mem_rsvd:31;
957+ mem_lvl_num:4, /* memory hierarchy level number */
958+ mem_remote:1, /* remote */
959+ mem_snoopx:2, /* snoop mode, ext */
960+ mem_rsvd:24;
958961 };
959962 };
960963 #elif defined(__BIG_ENDIAN_BITFIELD)
961964 union perf_mem_data_src {
962965 __u64 val;
963966 struct {
964− __u64 mem_rsvd:31,
967+ __u64 mem_rsvd:24,
968+ mem_snoopx:2, /* snoop mode, ext */
969+ mem_remote:1, /* remote */
970+ mem_lvl_num:4, /* memory hierarchy level number */
965971 mem_dtlb:7, /* tlb access */
966972 mem_lock:2, /* lock instr */
967973 mem_snoop:5, /* snoop mode */
@@ -998,6 +1004,22 @@ union perf_mem_data_src { · 30 unmodified lines
9981004 #define PERF_MEM_LVL_UNC 0x2000 /* Uncached memory */
9991005 #define PERF_MEM_LVL_SHIFT 5
10001006
1007+#define PERF_MEM_REMOTE_REMOTE 0x01 /* Remote */
1008+#define PERF_MEM_REMOTE_SHIFT 37
1009+
1010+#define PERF_MEM_LVLNUM_L1 0x01 /* L1 */
1011+#define PERF_MEM_LVLNUM_L2 0x02 /* L2 */
1012+#define PERF_MEM_LVLNUM_L3 0x03 /* L3 */
1013+#define PERF_MEM_LVLNUM_L4 0x04 /* L4 */
1014+/* 5-0xa available */
1015+#define PERF_MEM_LVLNUM_ANY_CACHE 0x0b /* Any cache */
1016+#define PERF_MEM_LVLNUM_LFB 0x0c /* LFB */
1017+#define PERF_MEM_LVLNUM_RAM 0x0d /* RAM */
1018+#define PERF_MEM_LVLNUM_PMEM 0x0e /* PMEM */
1019+#define PERF_MEM_LVLNUM_NA 0x0f /* N/A */
1020+
1021+#define PERF_MEM_LVLNUM_SHIFT 33
1022+
10011023 /* snoop mode */
10021024 #define PERF_MEM_SNOOP_NA 0x01 /* not available */
10031025 #define PERF_MEM_SNOOP_NONE 0x02 /* no snoop */
@@ -1006,6 +1028,10 @@ union perf_mem_data_src { · 2 unmodified lines
10061028 #define PERF_MEM_SNOOP_HITM 0x10 /* snoop hit modified */
10071029 #define PERF_MEM_SNOOP_SHIFT 19
10081030
1031+#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
1032+/* 1 free */
1033+#define PERF_MEM_SNOOPX_SHIFT 37
1034+
10091035 /* locked instruction */
10101036 #define PERF_MEM_LOCK_NA 0x01 /* not available */
10111037 #define PERF_MEM_LOCK_LOCKED 0x02 /* locked transaction */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t