Linux Perf
mem-events.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0 */
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 
12  bool record;
13  bool supported;
14  const char *tag;
15  const char *name;
16  const char *sysfs_name;
17 };
18 
19 enum {
23 };
24 
26 extern unsigned int perf_mem_events__loads_ldlat;
27 
28 int perf_mem_events__parse(const char *str);
29 int perf_mem_events__init(void);
30 
31 char *perf_mem_events__name(int i);
32 
33 struct mem_info;
34 int perf_mem__tlb_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
35 int perf_mem__lvl_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
36 int perf_mem__snp_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
37 int perf_mem__lck_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
38 
39 int perf_script__meminfo_scnprintf(char *bf, size_t size, struct mem_info *mem_info);
40 
41 struct c2c_stats {
43 
44  u32 locks; /* count of 'lock' transactions */
45  u32 store; /* count of all stores in trace */
46  u32 st_uncache; /* stores to uncacheable address */
47  u32 st_noadrs; /* cacheable store with no address */
48  u32 st_l1hit; /* count of stores that hit L1D */
49  u32 st_l1miss; /* count of stores that miss L1D */
50  u32 load; /* count of all loads in trace */
51  u32 ld_excl; /* exclusive loads, rmt/lcl DRAM - snp none/miss */
52  u32 ld_shared; /* shared loads, rmt/lcl DRAM - snp hit */
53  u32 ld_uncache; /* loads to uncacheable address */
54  u32 ld_io; /* loads to io address */
55  u32 ld_miss; /* loads miss */
56  u32 ld_noadrs; /* cacheable load with no address */
57  u32 ld_fbhit; /* count of loads hitting Fill Buffer */
58  u32 ld_l1hit; /* count of loads that hit L1D */
59  u32 ld_l2hit; /* count of loads that hit L2D */
60  u32 ld_llchit; /* count of loads that hit LLC */
61  u32 lcl_hitm; /* count of loads with local HITM */
62  u32 rmt_hitm; /* count of loads with remote HITM */
63  u32 tot_hitm; /* count of loads with local and remote HITM */
64  u32 rmt_hit; /* count of loads with remote hit clean; */
65  u32 lcl_dram; /* count of loads miss to local DRAM */
66  u32 rmt_dram; /* count of loads miss to remote DRAM */
67  u32 nomap; /* count of load/stores with no phys adrs */
68  u32 noparse; /* count of unparsable data sources */
69 };
70 
71 struct hist_entry;
72 int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi);
73 void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add);
74 
75 #endif /* __PERF_MEM_EVENTS_H */
u32 ld_noadrs
Definition: mem-events.h:56
u32 st_l1miss
Definition: mem-events.h:49
struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX]
Definition: mem-events.c:20
size_t size
Definition: evsel.c:60
u32 ld_io
Definition: mem-events.h:54
u32 ld_llchit
Definition: mem-events.h:60
u32 rmt_dram
Definition: mem-events.h:66
u32 ld_miss
Definition: mem-events.h:55
u32 st_noadrs
Definition: mem-events.h:47
u32 ld_shared
Definition: mem-events.h:52
char * perf_mem_events__name(int i)
Definition: mem-events.c:31
u32 ld_uncache
Definition: mem-events.h:53
u32 nr_entries
Definition: mem-events.h:42
u32 lcl_dram
Definition: mem-events.h:65
u32 tot_hitm
Definition: mem-events.h:63
u32 ld_l2hit
Definition: mem-events.h:59
int perf_mem__lvl_scnprintf(char *out, size_t sz, struct mem_info *mem_info)
Definition: mem-events.c:178
Definition: sort.h:89
u32 nomap
Definition: mem-events.h:67
void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add)
Definition: mem-events.c:423
int perf_script__meminfo_scnprintf(char *bf, size_t size, struct mem_info *mem_info)
Definition: mem-events.c:297
unsigned int perf_mem_events__loads_ldlat
Definition: mem-events.c:16
u32 ld_l1hit
Definition: mem-events.h:58
u32 st_uncache
Definition: mem-events.h:46
static int str(yyscan_t scanner, int token)
int perf_mem__lck_scnprintf(char *out, size_t sz, struct mem_info *mem_info)
Definition: mem-events.c:279
int perf_mem__tlb_scnprintf(char *out, size_t sz, struct mem_info *mem_info)
Definition: mem-events.c:116
u32 ld_fbhit
Definition: mem-events.h:57
u32 load
Definition: mem-events.h:50
Definition: stat.h:10
int perf_mem__snp_scnprintf(char *out, size_t sz, struct mem_info *mem_info)
Definition: mem-events.c:244
const char * sysfs_name
Definition: mem-events.h:16
u32 rmt_hitm
Definition: mem-events.h:62
u32 rmt_hit
Definition: mem-events.h:64
int perf_mem_events__parse(const char *str)
Definition: mem-events.c:46
u32 ld_excl
Definition: mem-events.h:51
const char * tag
Definition: mem-events.h:14
u32 lcl_hitm
Definition: mem-events.h:61
u32 noparse
Definition: mem-events.h:68
u32 st_l1hit
Definition: mem-events.h:48
u32 locks
Definition: mem-events.h:44
const char * name
Definition: mem-events.h:15
u32 store
Definition: mem-events.h:45
int perf_mem_events__init(void)
Definition: mem-events.c:82
int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
Definition: mem-events.c:312