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
954 mem_snoop:5, /* snoop mode */954 mem_snoop:5, /* snoop mode */
955 mem_lock:2, /* lock instr */955 mem_lock:2, /* lock instr */
956 mem_dtlb:7, /* tlb access */956 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;
958 };961 };
959};962};
960#elif defined(__BIG_ENDIAN_BITFIELD)963#elif defined(__BIG_ENDIAN_BITFIELD)
961union perf_mem_data_src {964union perf_mem_data_src {
962 __u64 val;965 __u64 val;
963 struct {966 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 */
965 mem_dtlb:7, /* tlb access */971 mem_dtlb:7, /* tlb access */
966 mem_lock:2, /* lock instr */972 mem_lock:2, /* lock instr */
967 mem_snoop:5, /* snoop mode */973 mem_snoop:5, /* snoop mode */
@@ -998,6 +1004,22 @@ union perf_mem_data_src { · 30 unmodified lines
998#define PERF_MEM_LVL_UNC 0x2000 /* Uncached memory */1004#define PERF_MEM_LVL_UNC 0x2000 /* Uncached memory */
999#define PERF_MEM_LVL_SHIFT 51005#define PERF_MEM_LVL_SHIFT 5
1000 1006
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
1001/* snoop mode */1023/* snoop mode */
1002#define PERF_MEM_SNOOP_NA 0x01 /* not available */1024#define PERF_MEM_SNOOP_NA 0x01 /* not available */
1003#define PERF_MEM_SNOOP_NONE 0x02 /* no snoop */1025#define PERF_MEM_SNOOP_NONE 0x02 /* no snoop */
@@ -1006,6 +1028,10 @@ union perf_mem_data_src { · 2 unmodified lines
1006#define PERF_MEM_SNOOP_HITM 0x10 /* snoop hit modified */1028#define PERF_MEM_SNOOP_HITM 0x10 /* snoop hit modified */
1007#define PERF_MEM_SNOOP_SHIFT 191029#define PERF_MEM_SNOOP_SHIFT 19
1008 1030
1031#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
1032/* 1 free */
1033#define PERF_MEM_SNOOPX_SHIFT 37
1034
1009/* locked instruction */1035/* locked instruction */
1010#define PERF_MEM_LOCK_NA 0x01 /* not available */1036#define PERF_MEM_LOCK_NA 0x01 /* not available */
1011#define PERF_MEM_LOCK_LOCKED 0x02 /* locked transaction */1037#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