PAPI  5.3.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
linux-bgp-memory.c
Go to the documentation of this file.
1 /*
2  * File: linux-bgp-memory.c
3  * Author: Dave Hermsmeier
4  * dlherms@us.ibm.com
5  */
6 
7 #include "papi.h"
8 #include "papi_internal.h"
9 #ifdef __LINUX__
10 #include <limits.h>
11 #endif
12 #include <stdio.h>
13 #include <string.h>
14 
15 /*
16  * Prototypes...
17  */
18 int init_bgp( PAPI_mh_info_t * pMem_Info );
19 
20 /*
21  * Get Memory Information
22  *
23  * Fills in memory information - effectively set to all 0x00's
24  */
25 extern int
26 _bgp_get_memory_info( PAPI_hw_info_t * pHwInfo, int pCPU_Type )
27 {
28  int retval = 0;
29 
30  switch ( pCPU_Type ) {
31  default:
32  //fprintf(stderr,"Default CPU type in %s (%d)\n",__FUNCTION__,__LINE__);
33  retval = init_bgp( &pHwInfo->mem_hierarchy );
34  break;
35  }
36 
37  return retval;
38 }
39 
40 /*
41  * Get DMem Information for BG/P
42  *
43  * NOTE: Currently, all values set to -1
44  */
45 extern int
47 {
48 
49  pDmemInfo->size = PAPI_EINVAL;
50  pDmemInfo->resident = PAPI_EINVAL;
51  pDmemInfo->high_water_mark = PAPI_EINVAL;
52  pDmemInfo->shared = PAPI_EINVAL;
53  pDmemInfo->text = PAPI_EINVAL;
54  pDmemInfo->library = PAPI_EINVAL;
55  pDmemInfo->heap = PAPI_EINVAL;
56  pDmemInfo->locked = PAPI_EINVAL;
57  pDmemInfo->stack = PAPI_EINVAL;
58  pDmemInfo->pagesize = PAPI_EINVAL;
59 
60  return PAPI_OK;
61 }
62 
63 /*
64  * Cache configuration for BG/P
65  */
66 int
67 init_bgp( PAPI_mh_info_t * pMem_Info )
68 {
69  memset( pMem_Info, 0x0, sizeof ( *pMem_Info ) );
70 
71  return PAPI_OK;
72 }
memset(eventId, 0, size)
Hardware info structure.
Definition: papi.h:775
PAPI_mh_info_t mem_hierarchy
Definition: papi.h:794
int _bgp_get_memory_info(PAPI_hw_info_t *pHwInfo, int pCPU_Type)
int _bgp_get_dmem_info(PAPI_dmem_info_t *pDmemInfo)
return PAPI_OK
Definition: linux-nvml.c:458
long long heap
Definition: papi.h:874
return PAPI_EINVAL
Definition: linux-nvml.c:408
Return codes and api definitions.
long long resident
Definition: papi.h:869
A pointer to the following is passed to PAPI_get_dmem_info()
Definition: papi.h:866
long long pagesize
Definition: papi.h:877
long long locked
Definition: papi.h:875
long long library
Definition: papi.h:873
mh for mem hierarchy maybe?
Definition: papi.h:768
long long shared
Definition: papi.h:871
long long text
Definition: papi.h:872
long long stack
Definition: papi.h:876
ssize_t retval
Definition: libasync.c:338
long long size
Definition: papi.h:868
int init_bgp(PAPI_mh_info_t *pMem_Info)
long long high_water_mark
Definition: papi.h:870