PAPI  5.3.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
freebsd-memory.c
Go to the documentation of this file.
1 /****************************/
2 /* THIS IS OPEN SOURCE CODE */
3 /****************************/
4 
5 /*
6 * File: freebsd-memory.c
7 * Author: Harald Servat
8 * redcrash@gmail.com
9 * Mod: James Ralph
10 * ralph@cs.utk.edu
11 */
12 
13 #include "papi.h"
14 #include "papi_internal.h"
15 
16 #include "x86_cpuid_info.h"
17 
18 #define UNREFERENCED(x) (void)x
19 
20 
21 #if defined(__i386__)||defined(__x86_64__)
22 static int
23 x86_get_memory_info( PAPI_hw_info_t *hw_info )
24 {
25  int retval = PAPI_OK;
26 
27  switch ( hw_info->vendor ) {
28  case PAPI_VENDOR_AMD:
29  case PAPI_VENDOR_INTEL:
30  retval = _x86_cache_info( &hw_info->mem_hierarchy );
31  break;
32  default:
33  PAPIERROR( "Unknown vendor in memory information call for x86." );
34  return PAPI_ENOIMPL;
35  }
36  return retval;
37 }
38 #endif
39 
40 
41 int
43 {
44  UNREFERENCED(id);
45  UNREFERENCED(hw_info);
46 
47 #if defined(__i386__)||defined(__x86_64__)
48  x86_get_memory_info( hw_info );
49 #endif
50 
51  return PAPI_ENOIMPL;
52 }
53 
55 {
56  /* TODO */
57  d->pagesize = getpagesize();
58  return PAPI_OK;
59 }
60 
#define PAPI_ENOIMPL
Definition: fpapi.h:124
Hardware info structure.
Definition: papi.h:775
PAPI_mh_info_t mem_hierarchy
Definition: papi.h:794
return PAPI_OK
Definition: linux-nvml.c:458
Return codes and api definitions.
#define UNREFERENCED(x)
int _x86_cache_info(PAPI_mh_info_t *mh_info)
A pointer to the following is passed to PAPI_get_dmem_info()
Definition: papi.h:866
long long pagesize
Definition: papi.h:877
void PAPIERROR(char *format,...)
int _freebsd_get_memory_info(PAPI_hw_info_t *hw_info, int id)
#define PAPI_VENDOR_INTEL
Definition: papi.h:346
int vendor
Definition: papi.h:782
int _papi_freebsd_get_dmem_info(PAPI_dmem_info_t *d)
ssize_t retval
Definition: libasync.c:338
static const PAPI_hw_info_t * hw_info
Definition: byte_profile.c:23
#define PAPI_VENDOR_AMD
Definition: papi.h:347