mem-events.h 2.8 KB

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