PAPI  5.7.0.0
cache_helper.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define L1I_CACHE   0
 
#define L1D_CACHE   1
 
#define L2_CACHE   2
 
#define L3_CACHE   3
 
#define MAX_CACHE   (L3_CACHE+1)
 

Functions

long long get_cachesize (int type)
 
long long get_entries (int type)
 
long long get_linesize (int type)
 

Macro Definition Documentation

◆ L1D_CACHE

#define L1D_CACHE   1

Definition at line 2 of file cache_helper.h.

◆ L1I_CACHE

#define L1I_CACHE   0

Definition at line 1 of file cache_helper.h.

◆ L2_CACHE

#define L2_CACHE   2

Definition at line 3 of file cache_helper.h.

◆ L3_CACHE

#define L3_CACHE   3

Definition at line 4 of file cache_helper.h.

◆ MAX_CACHE

#define MAX_CACHE   (L3_CACHE+1)

Definition at line 5 of file cache_helper.h.

Function Documentation

◆ get_cachesize()

long long get_cachesize ( int  type)

Definition at line 78 of file cache_helper.c.

78  {
79 
80  int result;
81 
83  if (result<0) return result;
84 
85  if (type>=MAX_CACHE) {
86  printf("Errror!\n");
87  return -1;
88  }
89 
90  return cache_info[type].size;
91 }
static int check_if_cache_info_available(void)
Definition: cache_helper.c:21
static struct cache_info_t cache_info[MAX_CACHE]
Definition: cache_helper.c:19
#define MAX_CACHE
Definition: cache_helper.h:5
Here is the call graph for this function:

◆ get_entries()

long long get_entries ( int  type)

Definition at line 94 of file cache_helper.c.

94  {
95 
96  int result;
97 
99  if (result<0) return result;
100 
101  if (type>=MAX_CACHE) {
102  printf("Errror!\n");
103  return -1;
104  }
105 
106  return cache_info[type].entries;
107 }
static int check_if_cache_info_available(void)
Definition: cache_helper.c:21
static struct cache_info_t cache_info[MAX_CACHE]
Definition: cache_helper.c:19
#define MAX_CACHE
Definition: cache_helper.h:5
Here is the call graph for this function:

◆ get_linesize()

long long get_linesize ( int  type)

Definition at line 110 of file cache_helper.c.

110  {
111 
112  int result;
113 
115  if (result<0) return result;
116 
117  if (type>=MAX_CACHE) {
118  printf("Errror!\n");
119  return -1;
120  }
121 
122  return cache_info[type].linesize;
123 }
static int check_if_cache_info_available(void)
Definition: cache_helper.c:21
static struct cache_info_t cache_info[MAX_CACHE]
Definition: cache_helper.c:19
#define MAX_CACHE
Definition: cache_helper.h:5
Here is the call graph for this function: