Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Add interface for power monitoring and telemetry option for power-related statistics
[palacios.git] / palacios / include / interfaces / vmm_pwrstat.h
1 /* 
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2013, Kyle C. Hale <kh@u.northwestern.edu>
11  * Copyright (c) 2013, The V3VEE Project <http://www.v3vee.org> 
12  * All rights reserved.
13  *
14  * Author: Kyle C. Hale <kh@u.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20 #ifndef __RAPL_H__
21 #define __RAPL_H__
22
23 #include <palacios/vmm_types.h>
24
25 typedef enum {
26         V3_PWRSTAT_PKG_ENERGY,
27         V3_PWRSTAT_CORE_ENERGY,
28         V3_PWRSTAT_EXT_ENERGY, /* "Power plane 1", e.g. graphics peripheral */
29         V3_PWRSTAT_DRAM_ENERGY,
30 } v3_pwrstat_ctr_t;
31
32 /* note that (on Intel at least) RAPL doesn't adhere to PMU semantics */
33 struct v3_pwrstat_iface {
34         int (*init)(void);
35         int (*deinit)(void);
36         int (*ctr_valid)(v3_pwrstat_ctr_t ctr);
37         uint64_t (*get_value)(v3_pwrstat_ctr_t ctr);
38 };
39
40 extern void V3_Init_Pwrstat (struct v3_pwrstat_iface * palacios_pwrstat);
41
42 #ifdef __V3VEE__
43 void v3_pwrstat_init(void);
44 int v3_pwrstat_ctr_valid(v3_pwrstat_ctr_t ctr);
45 uint64_t v3_pwrstat_get_value(v3_pwrstat_ctr_t ctr);
46 void v3_pwrstat_deinit(void);
47
48 #endif
49
50 #endif