Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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