libmsr  0.3.0
A friendlier interface to accessing MSRs on Intel platforms
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
msr_misc.h
Go to the documentation of this file.
1 /* msr_misc.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_MISC_H_INCLUDE
35 #define MSR_MISC_H_INCLUDE
36 
37 #include <stdint.h>
38 #include <stdio.h>
39 #include <sys/types.h>
40 
41 #include "master.h"
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
49 struct misc_enable {
51  uint64_t raw;
151 };
152 
158 struct pkg_cres {
161  uint64_t **pkg_c2;
164  uint64_t **pkg_c3;
167  uint64_t **pkg_c4;
170  uint64_t **pkg_c6;
173  uint64_t **pkg_c7;
176  uint64_t **pkg_c8;
179  uint64_t **pkg_c9;
182  uint64_t **pkg_c10;
183 };
184 
190 struct core_cres {
193  uint64_t **core_c1;
196  uint64_t **core_c3;
199  uint64_t **core_c6;
202  uint64_t **core_c7;
203 };
204 
205 /*************************/
206 /* Misc Enable Functions */
207 /*************************/
208 
213 void dump_misc_enable(struct misc_enable *s);
214 
221 void get_misc_enable(unsigned socket,
222  struct misc_enable *s);
223 
230 void set_misc_enable(unsigned socket,
231  struct misc_enable *s);
232 
233 /*******************************/
234 /* C-State Residency Functions */
235 /*******************************/
236 
240 void pkg_cres_storage(struct pkg_cres **pcr);
241 
245 void core_cres_storage(struct core_cres **ccr);
246 
250 void dump_pkg_cres_label(FILE *writedest);
251 
255 void dump_pkg_cres(FILE *writedest);
256 
260 void dump_core_cres_label(FILE *writedest);
261 
265 void dump_core_cres(FILE *writedest);
266 
267 #ifdef __cplusplus
268 }
269 #endif
270 #endif