PAPI  5.3.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
aix-memory.c File Reference
Include dependency graph for aix-memory.c:

Go to the source code of this file.

Functions

int _aix_get_memory_info (PAPI_hw_info_t *mem_info, int type)
 
int _aix_get_dmem_info (PAPI_dmem_info_t *d)
 

Function Documentation

int _aix_get_dmem_info ( PAPI_dmem_info_t d)

Definition at line 64 of file aix-memory.c.

65 {
66  /* This function has been reimplemented
67  to conform to current interface.
68  It has not been tested.
69  Nor has it been confirmed for completeness.
70  dkt 05-10-06
71  */
72 
73  struct procsinfo pi;
74  pid_t mypid = getpid( );
75  pid_t pid;
76  int found = 0;
77 
78  pid = 0;
79  while ( 1 ) {
80  if ( getprocs( &pi, sizeof ( pi ), 0, 0, &pid, 1 ) != 1 )
81  break;
82  if ( mypid == pi.pi_pid ) {
83  found = 1;
84  break;
85  }
86  }
87  if ( !found )
88  return ( PAPI_ESYS );
89 
90  d->size = pi.pi_size;
91  d->resident = pi.pi_drss + pi.pi_trss;
93  d->shared = PAPI_EINVAL;
94  d->text = pi.pi_trss; /* this is a guess */
95  d->library = PAPI_EINVAL;
96  d->heap = PAPI_EINVAL;
97  d->locked = PAPI_EINVAL;
98  d->stack = PAPI_EINVAL;
99  d->pagesize = getpagesize( );
100 
101  return ( PAPI_OK );
102 }
return PAPI_OK
Definition: linux-nvml.c:458
long long heap
Definition: papi.h:874
return PAPI_EINVAL
Definition: linux-nvml.c:408
long long resident
Definition: papi.h:869
static int pid
long long found
Definition: libasync.c:735
long long pagesize
Definition: papi.h:877
long long locked
Definition: papi.h:875
long long library
Definition: papi.h:873
#define PAPI_ESYS
Definition: fpapi.h:108
long long shared
Definition: papi.h:871
long long text
Definition: papi.h:872
long long stack
Definition: papi.h:876
long long size
Definition: papi.h:868
long long high_water_mark
Definition: papi.h:870
FILE * pi
Definition: iozone.c:1367
int _aix_get_memory_info ( PAPI_hw_info_t mem_info,
int  type 
)

Definition at line 16 of file aix-memory.c.

17 {
18  PAPI_mh_level_t *L = mem_info->mem_hierarchy.level;
19 
20  /* Not quite sure what bit 30 indicates.
21  I'm assuming it flags a unified tlb */
22  if ( _system_configuration.tlb_attrib & ( 1 << 30 ) ) {
23  L[0].tlb[0].type = PAPI_MH_TYPE_UNIFIED;
24  L[0].tlb[0].num_entries = _system_configuration.itlb_size;
25  L[0].tlb[0].type = PAPI_MH_TYPE_UNIFIED;
26  } else {
27  L[0].tlb[0].type = PAPI_MH_TYPE_INST;
28  L[0].tlb[0].num_entries = _system_configuration.itlb_size;
29  L[0].tlb[0].associativity = _system_configuration.itlb_asc;
30  L[0].tlb[1].type = PAPI_MH_TYPE_DATA;
31  L[0].tlb[1].num_entries = _system_configuration.dtlb_size;
32  L[0].tlb[1].associativity = _system_configuration.dtlb_asc;
33  }
34  /* Not quite sure what bit 30 indicates.
35  I'm assuming it flags a unified cache */
36  if ( _system_configuration.cache_attrib & ( 1 << 30 ) ) {
38  L[0].cache[0].size = _system_configuration.icache_size;
39  L[0].cache[0].associativity = _system_configuration.icache_asc;
40  L[0].cache[0].line_size = _system_configuration.icache_line;
41  } else {
42  L[0].cache[0].type = PAPI_MH_TYPE_INST;
43  L[0].cache[0].size = _system_configuration.icache_size;
44  L[0].cache[0].associativity = _system_configuration.icache_asc;
45  L[0].cache[0].line_size = _system_configuration.icache_line;
46  L[0].cache[1].type = PAPI_MH_TYPE_DATA;
47  L[0].cache[1].size = _system_configuration.dcache_size;
48  L[0].cache[1].associativity = _system_configuration.dcache_asc;
49  L[0].cache[1].line_size = _system_configuration.dcache_line;
50  }
52  L[1].cache[0].size = _system_configuration.L2_cache_size;
53  L[1].cache[0].associativity = _system_configuration.L2_cache_asc;
54  /* is there a line size for Level 2 cache? */
55 
56  /* it looks like we've always got at least 2 levels of info */
57  /* what about level 3 cache? */
58  mem_info->mem_hierarchy.levels = 2;
59 
60  return PAPI_OK;
61 }
int levels
Definition: papi.h:769
#define PAPI_MH_TYPE_INST
Definition: papi.h:725
PAPI_mh_info_t mem_hierarchy
Definition: papi.h:794
int associativity
Definition: papi.h:748
return PAPI_OK
Definition: linux-nvml.c:458
#define PAPI_MH_TYPE_DATA
Definition: papi.h:726
PAPI_mh_cache_info_t cache[PAPI_MH_MAX_LEVELS]
Definition: papi.h:763
PAPI_mh_level_t level[PAPI_MAX_MEM_HIERARCHY_LEVELS]
Definition: papi.h:770
PAPI_mh_tlb_info_t tlb[PAPI_MH_MAX_LEVELS]
Definition: papi.h:762
#define PAPI_MH_TYPE_UNIFIED
Definition: papi.h:729