1
2#ifndef __PERF_MEM_EVENTS_H
3#define __PERF_MEM_EVENTS_H
4
5#include <stdbool.h>
6#include <stdint.h>
7#include <stdio.h>
8#include <linux/types.h>
9#include "stat.h"
10
11struct perf_mem_event {
12 bool record;
13 bool supported;
14 const char *tag;
15 const char *name;
16 const char *sysfs_name;
17};
18
19enum {
20 PERF_MEM_EVENTS__LOAD,
21 PERF_MEM_EVENTS__STORE,
22 PERF_MEM_EVENTS__MAX,
23};
24
25extern struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX];
26extern unsigned int perf_mem_events__loads_ldlat;
27
28int perf_mem_events__parse(const char *str);
29int perf_mem_events__init(void);
30
31char *perf_mem_events__name(int i);
32
33struct mem_info;
34int perf_mem__tlb_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
35int perf_mem__lvl_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
36int perf_mem__snp_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
37int perf_mem__lck_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
38
39int perf_script__meminfo_scnprintf(char *bf, size_t size, struct mem_info *mem_info);
40
41struct c2c_stats {
42 u32 nr_entries;
43
44 u32 locks;
45 u32 store;
46 u32 st_uncache;
47 u32 st_noadrs;
48 u32 st_l1hit;
49 u32 st_l1miss;
50 u32 load;
51 u32 ld_excl;
52 u32 ld_shared;
53 u32 ld_uncache;
54 u32 ld_io;
55 u32 ld_miss;
56 u32 ld_noadrs;
57 u32 ld_fbhit;
58 u32 ld_l1hit;
59 u32 ld_l2hit;
60 u32 ld_llchit;
61 u32 lcl_hitm;
62 u32 rmt_hitm;
63 u32 tot_hitm;
64 u32 rmt_hit;
65 u32 lcl_dram;
66 u32 rmt_dram;
67 u32 nomap;
68 u32 noparse;
69};
70
71struct hist_entry;
72int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi);
73void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add);
74
75#endif
76