PAPI 7.1.0.0
Loading...
Searching...
No Matches
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

◆ _aix_get_dmem_info()

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;
94 d->text = pi.pi_trss; /* this is a guess */
96 d->heap = PAPI_EINVAL;
98 d->stack = PAPI_EINVAL;
99 d->pagesize = getpagesize( );
100
101 return ( PAPI_OK );
102}
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_EINVAL
Definition: f90papi.h:115
#define PAPI_ESYS
Definition: f90papi.h:136
static int pid
long long locked
Definition: papi.h:874
long long shared
Definition: papi.h:870
long long text
Definition: papi.h:871
long long heap
Definition: papi.h:873
long long size
Definition: papi.h:867
long long library
Definition: papi.h:872
long long stack
Definition: papi.h:875
long long pagesize
Definition: papi.h:876
long long high_water_mark
Definition: papi.h:869
long long resident
Definition: papi.h:868

◆ _aix_get_memory_info()

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 ) ) {
24 L[0].tlb[0].num_entries = _system_configuration.itlb_size;
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 {
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;
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}
#define PAPI_MH_TYPE_DATA
Definition: papi.h:720
#define PAPI_MH_TYPE_INST
Definition: papi.h:719
#define PAPI_MH_TYPE_UNIFIED
Definition: papi.h:723
PAPI_mh_info_t mem_hierarchy
Definition: papi.h:793
int levels
Definition: papi.h:768
PAPI_mh_level_t level[PAPI_MAX_MEM_HIERARCHY_LEVELS]
Definition: papi.h:769
PAPI_mh_tlb_info_t tlb[PAPI_MH_MAX_LEVELS]
Definition: papi.h:761
PAPI_mh_cache_info_t cache[PAPI_MH_MAX_LEVELS]
Definition: papi.h:762
int associativity
Definition: papi.h:747