Linux Audio

Check our new training course

Loading...
v4.6
 
 1#ifndef __PERF_MEM_EVENTS_H
 2#define __PERF_MEM_EVENTS_H
 3
 4#include <stdbool.h>
 
 
 
 
 
 
 5
 6struct perf_mem_event {
 7	bool		record;
 8	bool		supported;
 9	const char	*tag;
10	const char	*name;
11	const char	*sysfs_name;
12};
13
 
 
 
 
 
 
 
14enum {
15	PERF_MEM_EVENTS__LOAD,
16	PERF_MEM_EVENTS__STORE,
17	PERF_MEM_EVENTS__MAX,
18};
19
20extern struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX];
 
21
22int perf_mem_events__parse(const char *str);
23int perf_mem_events__init(void);
24
25char *perf_mem_events__name(int i);
26
27struct mem_info;
28int perf_mem__tlb_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
29int perf_mem__lvl_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
30int perf_mem__snp_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
31int perf_mem__lck_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
32
33int perf_script__meminfo_scnprintf(char *bf, size_t size, struct mem_info *mem_info);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
35#endif /* __PERF_MEM_EVENTS_H */
v5.4
 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 <linux/refcount.h>
10#include <linux/perf_event.h>
11#include "stat.h"
12
13struct perf_mem_event {
14	bool		record;
15	bool		supported;
16	const char	*tag;
17	const char	*name;
18	const char	*sysfs_name;
19};
20
21struct mem_info {
22	struct addr_map_symbol	iaddr;
23	struct addr_map_symbol	daddr;
24	union perf_mem_data_src	data_src;
25	refcount_t		refcnt;
26};
27
28enum {
29	PERF_MEM_EVENTS__LOAD,
30	PERF_MEM_EVENTS__STORE,
31	PERF_MEM_EVENTS__MAX,
32};
33
34extern struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX];
35extern unsigned int perf_mem_events__loads_ldlat;
36
37int perf_mem_events__parse(const char *str);
38int perf_mem_events__init(void);
39
40char *perf_mem_events__name(int i);
41
42struct mem_info;
43int perf_mem__tlb_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
44int perf_mem__lvl_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
45int perf_mem__snp_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
46int perf_mem__lck_scnprintf(char *out, size_t sz, struct mem_info *mem_info);
47
48int perf_script__meminfo_scnprintf(char *bf, size_t size, struct mem_info *mem_info);
49
50struct c2c_stats {
51	u32	nr_entries;
52
53	u32	locks;               /* count of 'lock' transactions */
54	u32	store;               /* count of all stores in trace */
55	u32	st_uncache;          /* stores to uncacheable address */
56	u32	st_noadrs;           /* cacheable store with no address */
57	u32	st_l1hit;            /* count of stores that hit L1D */
58	u32	st_l1miss;           /* count of stores that miss L1D */
59	u32	load;                /* count of all loads in trace */
60	u32	ld_excl;             /* exclusive loads, rmt/lcl DRAM - snp none/miss */
61	u32	ld_shared;           /* shared loads, rmt/lcl DRAM - snp hit */
62	u32	ld_uncache;          /* loads to uncacheable address */
63	u32	ld_io;               /* loads to io address */
64	u32	ld_miss;             /* loads miss */
65	u32	ld_noadrs;           /* cacheable load with no address */
66	u32	ld_fbhit;            /* count of loads hitting Fill Buffer */
67	u32	ld_l1hit;            /* count of loads that hit L1D */
68	u32	ld_l2hit;            /* count of loads that hit L2D */
69	u32	ld_llchit;           /* count of loads that hit LLC */
70	u32	lcl_hitm;            /* count of loads with local HITM  */
71	u32	rmt_hitm;            /* count of loads with remote HITM */
72	u32	tot_hitm;            /* count of loads with local and remote HITM */
73	u32	rmt_hit;             /* count of loads with remote hit clean; */
74	u32	lcl_dram;            /* count of loads miss to local DRAM */
75	u32	rmt_dram;            /* count of loads miss to remote DRAM */
76	u32	nomap;               /* count of load/stores with no phys adrs */
77	u32	noparse;             /* count of unparsable data sources */
78};
79
80struct hist_entry;
81int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi);
82void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add);
83
84#endif /* __PERF_MEM_EVENTS_H */