| OLD | NEW |
| 1 // Copyright (c) 2014, Intel Corporation | 1 // Copyright (c) 2014, Intel Corporation |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | 29 |
| 30 #include <Windows.h> | 30 #include <Windows.h> |
| 31 #include <string> | 31 #include <string> |
| 32 | 32 |
| 33 using namespace std; | |
| 34 | |
| 35 typedef bool (*IPGInitialize) (); | 33 typedef bool (*IPGInitialize) (); |
| 36 typedef bool (*IPGGetNumNodes) (int *nNodes); | 34 typedef bool (*IPGGetNumNodes) (int *nNodes); |
| 37 typedef bool (*IPGGetNumMsrs) (int *nMsr); | 35 typedef bool (*IPGGetNumMsrs) (int *nMsr); |
| 38 typedef bool (*IPGGetMsrName) (int iMsr, wchar_t *szName); | 36 typedef bool (*IPGGetMsrName) (int iMsr, wchar_t *szName); |
| 39 typedef bool (*IPGGetMsrFunc) (int iMsr, int *funcID); | 37 typedef bool (*IPGGetMsrFunc) (int iMsr, int *funcID); |
| 40 typedef bool (*IPGGetIAFrequency) (int iNode, int *freqInMHz); | 38 typedef bool (*IPGGetIAFrequency) (int iNode, int *freqInMHz); |
| 41 typedef bool (*IPGGetTDP) (int iNode, double *TDP); | 39 typedef bool (*IPGGetTDP) (int iNode, double *TDP); |
| 42 typedef bool (*IPGGetMaxTemperature) (int iNode, int *degreeC); | 40 typedef bool (*IPGGetMaxTemperature) (int iNode, int *degreeC); |
| 43 typedef bool (*IPGGetTemperature) (int iNode, int *degreeC); | 41 typedef bool (*IPGGetTemperature) (int iNode, int *degreeC); |
| 44 typedef bool (*IPGReadSample) (); | 42 typedef bool (*IPGReadSample) (); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 66 bool GetMaxTemperature(int iNode, int *degreeC); | 64 bool GetMaxTemperature(int iNode, int *degreeC); |
| 67 bool GetTemperature(int iNode, int *degreeC); | 65 bool GetTemperature(int iNode, int *degreeC); |
| 68 bool ReadSample(); | 66 bool ReadSample(); |
| 69 bool GetSysTime(SYSTEMTIME *sysTime); | 67 bool GetSysTime(SYSTEMTIME *sysTime); |
| 70 bool GetRDTSC(UINT64 *TSC); | 68 bool GetRDTSC(UINT64 *TSC); |
| 71 bool GetTimeInterval(double *offset); | 69 bool GetTimeInterval(double *offset); |
| 72 bool GetBaseFrequency(int iNode, double *baseFrequency); | 70 bool GetBaseFrequency(int iNode, double *baseFrequency); |
| 73 bool GetPowerData(int iNode, int iMSR, double *results, int *nResult); | 71 bool GetPowerData(int iNode, int iMSR, double *results, int *nResult); |
| 74 bool StartLog(wchar_t *szFilename); | 72 bool StartLog(wchar_t *szFilename); |
| 75 bool StopLog(); | 73 bool StopLog(); |
| 76 » string GetLastError(); | 74 » std::string GetLastError(); |
| 77 | 75 |
| 78 private: | 76 private: |
| 79 IPGInitialize pInitialize; | 77 IPGInitialize pInitialize; |
| 80 IPGGetNumNodes pGetNumNodes; | 78 IPGGetNumNodes pGetNumNodes; |
| 81 IPGGetNumMsrs pGetNumMsrs; | 79 IPGGetNumMsrs pGetNumMsrs; |
| 82 IPGGetMsrName pGetMsrName; | 80 IPGGetMsrName pGetMsrName; |
| 83 IPGGetMsrFunc pGetMsrFunc; | 81 IPGGetMsrFunc pGetMsrFunc; |
| 84 IPGGetIAFrequency pGetIAFrequency; | 82 IPGGetIAFrequency pGetIAFrequency; |
| 85 IPGGetTDP pGetTDP; | 83 IPGGetTDP pGetTDP; |
| 86 IPGGetMaxTemperature pGetMaxTemperature; | 84 IPGGetMaxTemperature pGetMaxTemperature; |
| 87 IPGGetTemperature pGetTemperature; | 85 IPGGetTemperature pGetTemperature; |
| 88 IPGReadSample pReadSample; | 86 IPGReadSample pReadSample; |
| 89 IPGGetSysTime pGetSysTime; | 87 IPGGetSysTime pGetSysTime; |
| 90 IPGGetRDTSC pGetRDTSC; | 88 IPGGetRDTSC pGetRDTSC; |
| 91 IPGGetTimeInterval pGetTimeInterval; | 89 IPGGetTimeInterval pGetTimeInterval; |
| 92 IPGGetBaseFrequency pGetBaseFrequency; | 90 IPGGetBaseFrequency pGetBaseFrequency; |
| 93 IPGGetPowerData pGetPowerData; | 91 IPGGetPowerData pGetPowerData; |
| 94 IPGStartLog pStartLog; | 92 IPGStartLog pStartLog; |
| 95 IPGStopLog pStopLog; | 93 IPGStopLog pStopLog; |
| 96 }; | 94 }; |
| 97 | 95 |
| OLD | NEW |