libmsr  0.3.0
A friendlier interface to accessing MSRs on Intel platforms
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
msr_turbo.h
Go to the documentation of this file.
1 /* msr_turbo.h
2  *
3  * Copyright (c) 2011-2016, Lawrence Livermore National Security, LLC.
4  * LLNL-CODE-645430
5  *
6  * Produced at Lawrence Livermore National Laboratory
7  * Written by Barry Rountree, rountree@llnl.gov
8  * Scott Walker, walker91@llnl.gov
9  * Kathleen Shoga, shoga1@llnl.gov
10  *
11  * All rights reserved.
12  *
13  * This file is part of libmsr.
14  *
15  * libmsr is free software: you can redistribute it and/or modify it under the
16  * terms of the GNU Lesser General Public License as published by the Free
17  * Software Foundation, either version 3 of the License, or (at your option)
18  * any later version.
19  *
20  * libmsr is distributed in the hope that it will be useful, but WITHOUT ANY
21  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
23  * details.
24  *
25  * You should have received a copy of the GNU Lesser General Public License
26  * along with libmsr. If not, see <http://www.gnu.org/licenses/>.
27  *
28  * This material is based upon work supported by the U.S. Department of
29  * Energy's Lawrence Livermore National Laboratory. Office of Science, under
30  * Award number DE-AC52-07NA27344.
31  *
32  */
33 
34 #ifndef MSR_TURBO_H_INCLUDE
35 #define MSR_TURBO_H_INCLUDE
36 
37 #include <stdio.h>
38 
39 #include "master.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
48  uint64_t bits;
52 };
53 
61  uint64_t bits;
63  double max_1c;
65  double max_2c;
67  double max_3c;
69  double max_4c;
71  double max_5c;
73  double max_6c;
75  double max_7c;
77  double max_8c;
78 };
79 
86 void turbo_storage(uint64_t ***val);
87 
94 void enable_turbo(void);
95 
102 void disable_turbo(void);
103 
112 void dump_turbo(FILE *writedest);
113 
120 void calc_max_non_turbo(const unsigned socket,
121  struct turbo_activation_ratio_data *info);
122 
131 int get_max_turbo_activation_ratio(const unsigned socket,
132  struct turbo_activation_ratio_data *info);
133 
142 void calc_max_turbo_ratio(const unsigned socket,
143  struct turbo_limit_data *info,
144  struct turbo_limit_data *info2);
145 
156 int get_turbo_ratio_limit(const unsigned socket,
157  struct turbo_limit_data *info,
158  struct turbo_limit_data *info2);
159 
160 #ifdef __cplusplus
161 }
162 #endif
163 #endif