Skip to content

Commit

Permalink
original source of v2.9
Browse files Browse the repository at this point in the history
Marius Hillenbrand committed Oct 23, 2015

Verified

This commit was signed with the committer’s verified signature. The key has expired.
ulyssa Ulyssa
1 parent 0d11926 commit 382e64a
Showing 60 changed files with 3,612 additions and 3,444 deletions.
8 changes: 8 additions & 0 deletions .bdsignore.all
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ ChangeLog
TODO
Debug
Release
Release64
Backup
Intel_SSA
My Inspector XE Results - pcm
.gitignore
@@ -22,3 +24,9 @@ My Inspector XE Results - pcm
.*\.htm
.*\.bat
.*\.strings
.*\.sln
.*\.suo
.*\.sdf
.*\.vcxproj
.*\.vcxproj.user
.*\.vcxproj.filters
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
*.txt
*.patch
*.orig
*.vcxproj*
*.out
*.log
*.sys
6 changes: 3 additions & 3 deletions MacMSRDriver/DriverInterface.c
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ kern_return_t getNumClients(io_connect_t connect, uint32_t* num_insts)
#if !defined(__LP64__)
if (IOConnectCallStructMethod != NULL) {
#endif
uint32_t num_outputs = 1;
size_t num_outputs = 1;
uint64_t knum_insts;
kernResult = IOConnectCallStructMethod(connect, kGetNumInstances, NULL, 0, &knum_insts, &num_outputs);
*num_insts = (uint32_t)knum_insts;
@@ -128,7 +128,7 @@ kern_return_t incrementNumClients(io_connect_t connect, uint32_t* num_insts)
#if !defined(__LP64__)
if (IOConnectCallStructMethod != NULL) {
#endif
uint32_t num_outputs = 1;
size_t num_outputs = 1;
uint64_t knum_insts;
kernResult = IOConnectCallStructMethod(connect, kIncrementNumInstances, NULL, 0, &knum_insts, &num_outputs);
*num_insts = (uint32_t)knum_insts;
@@ -148,7 +148,7 @@ kern_return_t decrementNumClients(io_connect_t connect, uint32_t* num_insts)
#if !defined(__LP64__)
if (IOConnectCallStructMethod != NULL) {
#endif
uint32_t num_outputs = 1;
size_t num_outputs = 1;
uint64_t knum_insts;
kernResult = IOConnectCallStructMethod(connect, kDecrementNumInstances, NULL, 0, &knum_insts, &num_outputs);
*num_insts = (uint32_t)knum_insts;
6 changes: 3 additions & 3 deletions MacMSRDriver/MSRAccessor.cpp
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ int32_t MSRAccessor::buildTopology(uint32_t num_cores ,void* pTopos){
int32_t MSRAccessor::read(uint32_t core_num, uint64_t msr_num, uint64_t * value){
pcm_msr_data_t idatas, odatas;
size_t size = sizeof(pcm_msr_data_t);
idatas.msr_num = msr_num;
idatas.msr_num = (uint32_t)msr_num;
idatas.cpu_num = core_num;
kern_return_t ret = readMSR(connect, &idatas, &size, &odatas, &size);
if(ret == KERN_SUCCESS)
@@ -46,7 +46,7 @@ int32_t MSRAccessor::write(uint32_t core_num, uint64_t msr_num, uint64_t value){
pcm_msr_data_t idatas;
size_t size = sizeof(pcm_msr_data_t);
idatas.value = value;
idatas.msr_num = msr_num;
idatas.msr_num = (uint32_t)msr_num;
idatas.cpu_num = core_num;
kern_return_t ret = writeMSR(connect, &idatas, &size);
if(ret == KERN_SUCCESS)
@@ -108,4 +108,4 @@ void MSRAccessor::closeConnection(){
if (kernResult != KERN_SUCCESS) {
fprintf(stderr, "IOServiceClose returned 0x%08x\n\n", kernResult);
}
}
}
2 changes: 1 addition & 1 deletion MacMSRDriver/Makefile
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ kext:
xcodebuild -configuration Release -target PcmMsrDriver clean build

library:
xcodebuild -configuration Release -target PcmMsrLibrary clean build
xcodebuild -configuration Release -target PcmMsrLibrary clean build

install: kext library
sudo sh ./kextload.sh
2 changes: 1 addition & 1 deletion MacMSRDriver/PCIDriverInterface.cpp
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
//

#include <stdio.h>
#include <map.h>
#include <map>
#include "PCIDriverInterface.h"
#include <IOKit/IOKitLib.h>
#include "PcmMsr/UserKernelShared.h"
14 changes: 6 additions & 8 deletions MacMSRDriver/PcmMsr.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -296,7 +296,7 @@
EXECUTABLE_PREFIX = lib;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INSTALL_PATH = /usr/lib;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = 10.9;
PRODUCT_NAME = PcmMsr;
};
name = Debug;
@@ -311,7 +311,7 @@
EXECUTABLE_PREFIX = lib;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INSTALL_PATH = /usr/lib;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = 10.9;
PRODUCT_NAME = PcmMsr;
};
name = Release;
@@ -370,14 +370,13 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "PcmMsr/PcmMsr-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
"HEADER_SEARCH_PATHS[arch=*]" = /usr/include;
INFOPLIST_FILE = "PcmMsr/PcmMsr-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MODULE_NAME = com.intel.driver.PcmMsrDriver;
MODULE_VERSION = 1.0.0d1;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = PcmMsrDriver;
SDKROOT = macosx10.8;
SDKROOT = macosx10.9;
WRAPPER_EXTENSION = kext;
};
name = Debug;
@@ -390,14 +389,13 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "PcmMsr/PcmMsr-Prefix.pch";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
"HEADER_SEARCH_PATHS[arch=*]" = /usr/include;
INFOPLIST_FILE = "PcmMsr/PcmMsr-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.8;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MODULE_NAME = com.intel.driver.PcmMsrDriver;
MODULE_VERSION = 1.0.0d1;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = PcmMsrDriver;
SDKROOT = macosx10.8;
SDKROOT = macosx10.9;
WRAPPER_EXTENSION = kext;
};
name = Release;
10 changes: 5 additions & 5 deletions MacMSRDriver/PcmMsr/PcmMsr-Info.plist
Original file line number Diff line number Diff line change
@@ -43,15 +43,15 @@
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.kpi.bsd</key>
<string>10.8</string>
<string>10.9</string>
<key>com.apple.kpi.mach</key>
<string>10.8</string>
<string>10.9</string>
<key>com.apple.kpi.unsupported</key>
<string>10.8</string>
<string>10.9</string>
<key>com.apple.kpi.iokit</key>
<string>10.8</string>
<string>10.9</string>
<key>com.apple.kpi.libkern</key>
<string>10.8</string>
<string>10.9</string>
</dict>
</dict>
</plist>
4 changes: 2 additions & 2 deletions MacMSRDriver/PcmMsr/PcmMsr.cpp
Original file line number Diff line number Diff line change
@@ -110,9 +110,9 @@ uint32_t PcmMsrDriverClassName::getNumCores()
if(sizeof(int) == size)
ret = *(int*)pParam;
else if(sizeof(long) == size)
ret = *(long*)pParam;
ret = (uint32_t) *(long*)pParam;
else if(sizeof(long long) == size)
ret = *(long long*)pParam;
ret = (uint32_t) *(long long*)pParam;
else
ret = *(int*)pParam;
}
6 changes: 3 additions & 3 deletions MacMSRDriver/PcmMsr/PcmMsrClient.cpp
Original file line number Diff line number Diff line change
@@ -110,11 +110,11 @@ IOReturn PcmMsrClientClassName::checkActiveAndOpened (const char* memberFunction
{
if (fProvider == NULL || isInactive()) {
IOLog("%s::%s returned kIOReturnNotAttached.\n", getName(), memberFunction);
return kIOReturnNotAttached;
return (IOReturn)kIOReturnNotAttached;

} else if (!fProvider->isOpen(this)) {
IOLog("%s::%s returned kIOReturnNotOpen.\n", getName(), memberFunction);
return kIOReturnNotOpen;
return (IOReturn)kIOReturnNotOpen;
}
return kIOReturnSuccess;
}
@@ -169,7 +169,7 @@ IOReturn PcmMsrClientClassName::sBuildTopology(PcmMsrClientClassName* target, vo

IOReturn PcmMsrClientClassName::buildTopology(topologyEntry* data, size_t output_size)
{
uint32_t num_cores = output_size / sizeof(topologyEntry);
uint32_t num_cores = (uint32_t) (output_size / sizeof(topologyEntry) );
IOReturn result = checkActiveAndOpened (__FUNCTION__);

if (result == kIOReturnSuccess)
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -3,29 +3,33 @@
# written by Roman Dementiev and Jim Harris
#

EXE = pcm-numa.x pcm-power.x pcm.x pcm-sensor.x pcm-msr.x pcm-memory.x pcm-tsx.x pcm-pcie.x
EXE = pcm-numa.x pcm-power.x pcm.x pcm-sensor.x pcm-msr.x pcm-memory.x pcm-tsx.x pcm-pcie.x pcm-core.x

all: $(EXE)

CXXFLAGS += -Wall -g -O3
klocwork: $(EXE)

CXXFLAGS += -Wall -g -O3 -Wno-unknown-pragmas

# uncomment if you want to rely on Linux perf support (user needs CAP_SYS_ADMIN privileges)
ifneq ($(wildcard /usr/include/linux/perf_event.h),)
#CXXFLAGS += -DPCM_USE_PERF
CXXFLAGS += -DPCM_USE_PERF
endif

UNAME:=$(shell uname)

ifeq ($(UNAME), Linux)
LIB= -pthread -lrt
CXXFLAGS += -std=c++0x
endif
ifeq ($(UNAME), Darwin)
LIB= -lpthread /usr/lib/libPcmMsr.dylib
CXXFLAGS += -I/usr/include
CXXFLAGS += -I/usr/include -IMacMSRDriver -std=c++0x
endif
ifeq ($(UNAME), FreeBSD)
CXX=c++
LIB= -lpthread -lc++
CXXFLAGS += -std=c++0x
endif

COMMON_OBJS = msr.o cpucounters.o pci.o client_bw.o utils.o
6 changes: 6 additions & 0 deletions PCM-Core_Win/pcm-core-win.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// pcm-core-win.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include "../pcm-core.cpp"
183 changes: 183 additions & 0 deletions PCM-Core_Win/pcm-core-win.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{CBF0B26F-19F5-4A76-BAB1-2585212026FC}</ProjectGuid>
<RootNamespace>pcm-core-win</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-core.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-core.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-core.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-core.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\cpucounters.cpp" />
<ClCompile Include="..\msr.cpp" />
<ClCompile Include="..\pci.cpp" />
<ClCompile Include="..\winpmem\winpmem.cpp" />
<ClCompile Include="..\client_bw.cpp" />
<ClCompile Include="..\freegetopt\getopt.c" />
<ClCompile Include="pcm-core-win.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="..\utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\cpucounters.h" />
<ClInclude Include="..\msr.h" />
<ClInclude Include="..\pci.h" />
<ClInclude Include="..\client_bw.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="..\types.h" />
<ClInclude Include="windriver.h" />
<ClInclude Include="..\utils.h" />
</ItemGroup>
<ItemGroup>
<None Include="My Amplifier Results\r000hs\r000hs.ampl" />
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
8 changes: 8 additions & 0 deletions PCM-Core_Win/stdafx.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// pcm.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"

// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
16 changes: 16 additions & 0 deletions PCM-Core_Win/stdafx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif

#include <stdio.h>
#include <tchar.h>


// TODO: reference additional headers your program requires here
275 changes: 0 additions & 275 deletions PCM-MSR_Win/pcm-msr-win.vcproj

This file was deleted.

183 changes: 183 additions & 0 deletions PCM-MSR_Win/pcm-msr-win.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E93F94F8-1797-4BF7-BC7F-8EF144FF17D9}</ProjectGuid>
<RootNamespace>pcm-msr-win</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-msr.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-msr.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-msr.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-msr.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\cpucounters.cpp" />
<ClCompile Include="..\msr.cpp" />
<ClCompile Include="..\pci.cpp" />
<ClCompile Include="..\client_bw.cpp" />
<ClCompile Include="..\freegetopt\getopt.c" />
<ClCompile Include="pcm-msr-win.cpp" />
<ClCompile Include="..\winpmem\winpmem.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="..\utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\cpucounters.h" />
<ClInclude Include="..\msr.h" />
<ClInclude Include="..\pci.h" />
<ClInclude Include="..\client_bw.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="..\types.h" />
<ClInclude Include="windriver.h" />
<ClInclude Include="..\utils.h" />
</ItemGroup>
<ItemGroup>
<None Include="My Amplifier Results\r000hs\r000hs.ampl" />
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
275 changes: 0 additions & 275 deletions PCM-Memory_Win/pcm-memory-win.vcproj

This file was deleted.

183 changes: 183 additions & 0 deletions PCM-Memory_Win/pcm-memory-win.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{66458306-D903-4946-AB5D-AE452DC8B50B}</ProjectGuid>
<RootNamespace>pcm-memory-win</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-memory.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-memory.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-memory.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-memory.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\cpucounters.cpp" />
<ClCompile Include="..\msr.cpp" />
<ClCompile Include="..\pci.cpp" />
<ClCompile Include="..\client_bw.cpp" />
<ClCompile Include="..\freegetopt\getopt.c" />
<ClCompile Include="pcm-memory-win.cpp" />
<ClCompile Include="..\winpmem\winpmem.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="..\utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\cpucounters.h" />
<ClInclude Include="..\msr.h" />
<ClInclude Include="..\pci.h" />
<ClInclude Include="..\client_bw.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="..\types.h" />
<ClInclude Include="windriver.h" />
<ClInclude Include="..\utils.h" />
</ItemGroup>
<ItemGroup>
<None Include="My Amplifier Results\r000hs\r000hs.ampl" />
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
275 changes: 0 additions & 275 deletions PCM-NUMA_Win/pcm-numa-win.vcproj

This file was deleted.

183 changes: 183 additions & 0 deletions PCM-NUMA_Win/pcm-numa-win.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{45AB82E6-DADE-46E8-84D0-7481D2818849}</ProjectGuid>
<RootNamespace>pcm-numa-win</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-numa.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-numa.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-numa.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-numa.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\cpucounters.cpp" />
<ClCompile Include="..\msr.cpp" />
<ClCompile Include="..\pci.cpp" />
<ClCompile Include="..\client_bw.cpp" />
<ClCompile Include="..\freegetopt\getopt.c" />
<ClCompile Include="pcm-numa-win.cpp" />
<ClCompile Include="..\winpmem\winpmem.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="..\utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\cpucounters.h" />
<ClInclude Include="..\msr.h" />
<ClInclude Include="..\pci.h" />
<ClInclude Include="..\client_bw.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="..\types.h" />
<ClInclude Include="windriver.h" />
<ClInclude Include="..\utils.h" />
</ItemGroup>
<ItemGroup>
<None Include="My Amplifier Results\r000hs\r000hs.ampl" />
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
275 changes: 0 additions & 275 deletions PCM-PCIE_Win/pcm-pcie-win.vcproj

This file was deleted.

183 changes: 183 additions & 0 deletions PCM-PCIE_Win/pcm-pcie-win.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1FAE01E6-5CD0-4C91-8C82-4FBCBB4CC419}</ProjectGuid>
<RootNamespace>pcm-pcie-win</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-pcie.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-pcie.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-pcie.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-pcie.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\cpucounters.cpp" />
<ClCompile Include="..\msr.cpp" />
<ClCompile Include="..\pci.cpp" />
<ClCompile Include="..\client_bw.cpp" />
<ClCompile Include="..\freegetopt\getopt.c" />
<ClCompile Include="pcm-pcie-win.cpp" />
<ClCompile Include="..\winpmem\winpmem.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="..\utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\cpucounters.h" />
<ClInclude Include="..\msr.h" />
<ClInclude Include="..\pci.h" />
<ClInclude Include="..\client_bw.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="..\types.h" />
<ClInclude Include="windriver.h" />
<ClInclude Include="..\utils.h" />
</ItemGroup>
<ItemGroup>
<None Include="My Amplifier Results\r000hs\r000hs.ampl" />
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
275 changes: 0 additions & 275 deletions PCM-Power_Win/pcm-power-win.vcproj

This file was deleted.

183 changes: 183 additions & 0 deletions PCM-Power_Win/pcm-power-win.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{78F57684-F6F2-4691-B498-C7FC0731F875}</ProjectGuid>
<RootNamespace>pcm-power-win</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-power.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-power.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-power.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-power.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\cpucounters.cpp" />
<ClCompile Include="..\msr.cpp" />
<ClCompile Include="..\pci.cpp" />
<ClCompile Include="..\winpmem\winpmem.cpp" />
<ClCompile Include="..\client_bw.cpp" />
<ClCompile Include="..\freegetopt\getopt.c" />
<ClCompile Include="pcm-power-win.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="..\utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\cpucounters.h" />
<ClInclude Include="..\msr.h" />
<ClInclude Include="..\pci.h" />
<ClInclude Include="..\client_bw.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="..\types.h" />
<ClInclude Include="windriver.h" />
<ClInclude Include="..\utils.h" />
</ItemGroup>
<ItemGroup>
<None Include="My Amplifier Results\r000hs\r000hs.ampl" />
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
511 changes: 0 additions & 511 deletions PCM-Service_Win/PCMService.vcproj

This file was deleted.

287 changes: 287 additions & 0 deletions PCM-Service_Win/PCMService.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release64|Win32">
<Configuration>Release64</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release64|x64">
<Configuration>Release64</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>PCM-Service</ProjectName>
<ProjectGuid>{A0DD26AB-CC35-41E5-B676-1E0FBCEF0DDC}</ProjectGuid>
<RootNamespace>PCMService</RootNamespace>
<Keyword>ManagedCProj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release64|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release64|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
<WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release64|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release64|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>11.0.61030.0</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<EnableManagedIncrementalBuild>false</EnableManagedIncrementalBuild>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release64|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<EnableManagedIncrementalBuild>false</EnableManagedIncrementalBuild>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;..\intelpcm.dll\Debug\Intelpcm.lib</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AssemblyDebug>true</AssemblyDebug>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;..\intelpcm.dll\x64\Debug\intelpcm.lib</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AssemblyDebug>true</AssemblyDebug>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;..\intelpcm.dll\Release\Intelpcm.lib</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;..\Intelpcm.dll\x64\Release\Intelpcm.lib</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release64|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>advapi32.lib;..\Intelpcm.dll\x64\Release64\Intelpcm.lib</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AssemblyDebug>true</AssemblyDebug>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="System">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="System.Data">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="System.ServiceProcess">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="System.Configuration.Install">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="System.Xml">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="System.Management">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="AssemblyInfo.cpp" />
<ClCompile Include="PCMInstaller.cpp" />
<ClCompile Include="PCMService.cpp" />
<ClCompile Include="..\utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Intelpcm.dll\Intelpcm.h" />
<ClInclude Include="PCMInstaller.h">
<FileType>CppClass</FileType>
<SubType>Component</SubType>
</ClInclude>
<ClInclude Include="PCMService.h">
<FileType>CppClass</FileType>
</ClInclude>
<ClInclude Include="resource.h" />
<ClInclude Include="..\PCM_Win\windriver.h" />
<ClInclude Include="..\utils.h" />
</ItemGroup>
<ItemGroup>
<Image Include="app.ico" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="app.rc" />
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="PCMInstaller.resx">
<DependentUpon>PCMInstaller.h</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PCMService.resX">
<DependentUpon>PCMService.h</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
275 changes: 0 additions & 275 deletions PCM-TSX_Win/pcm-tsx-win.vcproj

This file was deleted.

182 changes: 182 additions & 0 deletions PCM-TSX_Win/pcm-tsx-win.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2CDE03E0-BF03-448E-8AA6-D764F8BDE7C1}</ProjectGuid>
<RootNamespace>pcm-tsx-win</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-tsx.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-tsx.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-tsx.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm-tsx.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\cpucounters.cpp" />
<ClCompile Include="..\msr.cpp" />
<ClCompile Include="..\pci.cpp" />
<ClCompile Include="..\client_bw.cpp" />
<ClCompile Include="..\freegetopt\getopt.c" />
<ClCompile Include="pcm-tsx-win.cpp" />
<ClCompile Include="..\winpmem\winpmem.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="..\utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\cpucounters.h" />
<ClInclude Include="..\msr.h" />
<ClInclude Include="..\pci.h" />
<ClInclude Include="..\client_bw.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="..\types.h" />
<ClInclude Include="windriver.h" />
</ItemGroup>
<ItemGroup>
<None Include="My Amplifier Results\r000hs\r000hs.ampl" />
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
274 changes: 0 additions & 274 deletions PCM_Win/pcm.vcproj

This file was deleted.

181 changes: 181 additions & 0 deletions PCM_Win/pcm.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D919CF99-5D9F-46C9-B6F0-626700E63592}</ProjectGuid>
<RootNamespace>icpm</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)pcm.exe</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\cpucounters.cpp" />
<ClCompile Include="..\freegetopt\getopt.c" />
<ClCompile Include="..\winpmem\winpmem.cpp" />
<ClCompile Include="..\msr.cpp" />
<ClCompile Include="..\pci.cpp" />
<ClCompile Include="..\client_bw.cpp" />
<ClCompile Include="pcm.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="..\utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\cpucounters.h" />
<ClInclude Include="..\msr.h" />
<ClInclude Include="..\pci.h" />
<ClInclude Include="..\client_bw.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="..\types.h" />
<ClInclude Include="windriver.h" />
<ClInclude Include="..\utils.h" />
</ItemGroup>
<ItemGroup>
<None Include="My Amplifier Results\r000hs\r000hs.ampl" />
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
41 changes: 25 additions & 16 deletions PCM_Win/windriver.h
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
The driver is required to access hardware Model Specific Registers (MSRs)
under Windows. Currently only 64-bit Windows 7 has been tested.
*/

class Driver
{
SC_HANDLE hSCManager;
@@ -49,12 +50,12 @@ class Driver
hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
if (hSCManager)
{
hService = CreateService(hSCManager, L"Test MSR 4", L"Test MSR Driver 4", SERVICE_START | DELETE | SERVICE_STOP,
hService = CreateService(hSCManager, L"PCM Test MSR", L"PCM Test MSR Driver", SERVICE_START | DELETE | SERVICE_STOP,
SERVICE_KERNEL_DRIVER, SERVICE_DEMAND_START, SERVICE_ERROR_IGNORE, driverPath, NULL, NULL, NULL, NULL, NULL);

if (!hService)
{
hService = OpenService(hSCManager, L"Test MSR 4", SERVICE_START | DELETE | SERVICE_STOP);
hService = OpenService(hSCManager, L"PCM Test MSR", SERVICE_START | DELETE | SERVICE_STOP);
}

if (hService)
@@ -66,8 +67,10 @@ class Driver
DWORD err = GetLastError();
if (err == ERROR_SERVICE_ALREADY_RUNNING) return true;

_com_error error(err);
std::wcerr << "Starting MSR service failed with error " << err << " " << error.ErrorMessage() << std::endl;
std::wcerr << "Starting MSR service failed with error " << err << " ";
const TCHAR * errorStr = _com_error(err).ErrorMessage();
if (errorStr) std::wcerr << errorStr;
std::wcerr << std::endl;

ControlService(hService, SERVICE_CONTROL_STOP, &ss);

@@ -77,16 +80,20 @@ class Driver
}
else
{
_com_error error(GetLastError());
std::wcerr << "Opening service manager failed with error " << GetLastError() << " " << error.ErrorMessage() << std::endl;
std::wcerr << "Opening service manager failed with error " << GetLastError() << " ";
const TCHAR * errorStr = _com_error(GetLastError()).ErrorMessage();
if (errorStr) std::wcerr << errorStr;
std::wcerr << std::endl;
}

CloseServiceHandle(hSCManager);
}
else
{
_com_error error(GetLastError());
std::wcerr << "Opening service manager failed with error " << GetLastError() << " " << error.ErrorMessage() << std::endl;
std::wcerr << "Opening service manager failed with error " << GetLastError() << " ";
const TCHAR * errorStr = _com_error(GetLastError()).ErrorMessage();
if (errorStr) std::wcerr << errorStr;
std::wcerr << std::endl;
}


@@ -110,8 +117,7 @@ class Driver
hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
if (hSCManager)
{
hService = OpenService(hSCManager, L"Test MSR 4", SERVICE_START | DELETE | SERVICE_STOP);
DWORD res = 0;
hService = OpenService(hSCManager, L"PCM Test MSR", SERVICE_START | DELETE | SERVICE_STOP);
if (hService)
{
ControlService(hService, SERVICE_CONTROL_STOP, &ss);
@@ -122,8 +128,10 @@ class Driver
}
else
{
_com_error error(GetLastError());
std::wcerr << "Opening service manager failed with error " << GetLastError() << " " << error.ErrorMessage() << std::endl;
std::wcerr << "Opening service manager failed with error " << GetLastError() << " ";
const TCHAR * errorStr = _com_error(GetLastError()).ErrorMessage();
if (errorStr) std::wcerr << errorStr;
std::wcerr << std::endl;
}
}

@@ -136,8 +144,7 @@ class Driver
hSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CREATE_SERVICE);
if (hSCManager)
{
hService = OpenService(hSCManager, L"Test MSR 4", SERVICE_START | DELETE | SERVICE_STOP);
DWORD res = 0;
hService = OpenService(hSCManager, L"PCM Test MSR", SERVICE_START | DELETE | SERVICE_STOP);
if (hService)
{
ControlService(hService, SERVICE_CONTROL_STOP, &ss);
@@ -149,8 +156,10 @@ class Driver
}
else
{
_com_error error(GetLastError());
std::wcerr << "Opening service manager failed with error " << GetLastError() << " " << error.ErrorMessage() << std::endl;
std::wcerr << "Opening service manager failed with error " << GetLastError() << " ";
const TCHAR * errorStr = _com_error(GetLastError()).ErrorMessage();
if (errorStr) std::wcerr << errorStr;
std::wcerr << std::endl;
}
}
};
17 changes: 7 additions & 10 deletions build_all.bat
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@

REM change path to your VCVARS.BAT
CALL "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat"
CALL "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"

for %%p in (PCM) do (
@echo Building %%p
chdir %%p_Win
vcupgrade -overwrite %%p.vcproj
msbuild %%p.vcxproj
msbuild %%p.vcxproj /p:Configuration=Release /t:Clean,Build
chdir ..
)

@echo Building Intelpcm.dll
chdir Intelpcm.dll
vcupgrade -overwrite Intelpcm.dll.vcproj
msbuild Intelpcm.dll.vcxproj
msbuild Intelpcm.dll.vcxproj /p:Configuration=Release /t:Clean,Build
chdir ..

@echo Building PCM-Service
chdir PCM-Service_Win
vcupgrade -overwrite PCMService.vcproj
msbuild PCMService.vcxproj
msbuild PCMService.vcxproj /p:Configuration=Release /t:Clean,Build
chdir ..


for %%p in (PCM-MSR PCM-TSX PCM-Memory PCM-NUMA PCM-PCIE PCM-Power) do (
for %%p in (PCM-MSR PCM-TSX PCM-Memory PCM-NUMA PCM-PCIE PCM-Power PCM-Core) do (
@echo Building %%p
chdir %%p_Win
vcupgrade -overwrite %%p-win.vcproj
msbuild %%p-win.vcxproj
msbuild %%p-win.vcxproj /p:Configuration=Release /t:Clean,Build
chdir ..
)

exit


6 changes: 0 additions & 6 deletions check_win_build.sh

This file was deleted.

30 changes: 12 additions & 18 deletions client_bw.cpp
Original file line number Diff line number Diff line change
@@ -15,14 +15,12 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
//

#include <iostream>
#include <sstream>
#include <iomanip>
#include <string.h>
#ifndef _MSC_VER
#include <sys/types.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include "pci.h"
#include "client_bw.h"

@@ -89,39 +87,35 @@ ClientBW::ClientBW() : pmem(new PCMPmem())
throw std::exception();
}
startAddr = imcbar & (~(4096ULL-1ULL)); // round down to 4K

Mutex = CreateMutex(NULL,FALSE,NULL);
}

uint64 ClientBW::getImcReads()
{
WaitForSingleObject(Mutex,INFINITE);
mutex.lock();
uint32 res = pmem->read32(startAddr + PCM_CLIENT_IMC_DRAM_DATA_READS);
ReleaseMutex(Mutex);
return res;
mutex.unlock();
return (uint64)res;
}

uint64 ClientBW::getImcWrites()
{
WaitForSingleObject(Mutex,INFINITE);
mutex.lock();
uint32 res = pmem->read32(startAddr + PCM_CLIENT_IMC_DRAM_DATA_WRITES);
ReleaseMutex(Mutex);
return res;
mutex.unlock();
return (uint64)res;
}

uint64 ClientBW::getIoRequests()
{
WaitForSingleObject(Mutex,INFINITE);
mutex.lock();
uint32 res = pmem->read32(startAddr + PCM_CLIENT_IMC_DRAM_IO_REQESTS);
ReleaseMutex(Mutex);
return res;
mutex.unlock();
return (uint64)res;
}

ClientBW::~ClientBW()
{
pmem->uninstall_driver();
delete pmem;
CloseHandle(Mutex);
}


7 changes: 5 additions & 2 deletions client_bw.h
Original file line number Diff line number Diff line change
@@ -30,6 +30,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include <unistd.h>
#endif

#include "mutex.h"
#include <memory>

#define PCM_CLIENT_IMC_BAR_OFFSET (0x0048)
#define PCM_CLIENT_IMC_DRAM_IO_REQESTS (0x5048)
#define PCM_CLIENT_IMC_DRAM_DATA_READS (0x5050)
@@ -47,9 +50,9 @@ class ClientBW
char * mmapAddr;
#endif
#ifdef _MSC_VER
WinPmem * pmem;
std::shared_ptr<WinPmem> pmem;
uint64 startAddr;
HANDLE Mutex;
PCM_Util::Mutex mutex;
#endif

public:
1,074 changes: 486 additions & 588 deletions cpucounters.cpp

Large diffs are not rendered by default.

191 changes: 134 additions & 57 deletions cpucounters.h

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions gen_new_win_project.sh

This file was deleted.

2 changes: 1 addition & 1 deletion intelpcm.so/Makefile
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ OPT= -g -O3
CXXFLAGS+= -Wall -fPIC $(OPT)
vpath %.cpp ..

libintelpcm.so: msr.o cpucounters.o pci.o client_bw.o
libintelpcm.so: msr.o cpucounters.o pci.o client_bw.o utils.o
$(CXX) $(CXXFLAGS) -shared $^ -lpthread -o $@

clean:
18 changes: 5 additions & 13 deletions msr.cpp
Original file line number Diff line number Diff line change
@@ -14,10 +14,11 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// Austen Ott
// Jim Harris (FreeBSD)

#include <sys/types.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#ifndef _MSC_VER
#include <unistd.h>
#endif
@@ -30,7 +31,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include <windows.h>
#include "utils.h"
#include "Winmsrdriver\win7\msrstruct.h"
#include "winring0/OlsDef.h"
#include "winring0/OlsApiInitExt.h"

extern HMODULE hOpenLibSys;
@@ -67,12 +67,8 @@ int32 MsrHandle::write(uint64 msr_number, uint64 value)
cvt_ds cvt;
cvt.ui64 = value;

#ifdef COMPILE_FOR_WINDOWS_7
ThreadGroupTempAffinity affinity(cpu_id);
BOOL status = Wrmsr((DWORD)msr_number, cvt.ui32.low, cvt.ui32.high);
#else
BOOL status = WrmsrTx((DWORD)msr_number, cvt.ui32.low, cvt.ui32.high,(1UL << cpu_id));
#endif
DWORD status = Wrmsr((DWORD)msr_number, cvt.ui32.low, cvt.ui32.high);

return status?sizeof(uint64):0;
}
@@ -88,18 +84,14 @@ int32 MsrHandle::read(uint64 msr_number, uint64 * value)
req.msr_address = msr_number;
BOOL status = DeviceIoControl(hDriver, IO_CTL_MSR_READ, &req, sizeof(MSR_Request), value, sizeof(uint64), &reslength, NULL);
assert(status && "Error in DeviceIoControl");
return reslength;
return (int32)reslength;
}

cvt_ds cvt;
cvt.ui64 = 0;

#ifdef COMPILE_FOR_WINDOWS_7
ThreadGroupTempAffinity affinity(cpu_id);
BOOL status = Rdmsr((DWORD)msr_number, &(cvt.ui32.low), &(cvt.ui32.high));
#else
BOOL status = RdmsrTx((DWORD)msr_number, &(cvt.ui32.low), &(cvt.ui32.high), (1UL << cpu_id));
#endif
DWORD status = Rdmsr((DWORD)msr_number, &(cvt.ui32.low), &(cvt.ui32.high));

if(status) *value = cvt.ui64;

36 changes: 22 additions & 14 deletions msr.h
Original file line number Diff line number Diff line change
@@ -30,6 +30,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include <MSRAccessor.h>
#endif

#include "mutex.h"
#include <memory>

class MsrHandle
{
@@ -43,13 +45,14 @@ class MsrHandle
#endif
uint32 cpu_id;
MsrHandle(); // forbidden
MsrHandle(MsrHandle &); // forbidden
MsrHandle(const MsrHandle &); // forbidden
MsrHandle & operator = (const MsrHandle &); // forbidden

public:
MsrHandle(uint32 cpu);
int32 read(uint64 msr_number, uint64 * value);
int32 write(uint64 msr_number, uint64 value);
int32 getCoreId() { return cpu_id; }
int32 getCoreId() { return (int32)cpu_id; }
#ifdef __APPLE__
int32 buildTopology(uint32 num_cores, void*);
uint32 getNumInstances();
@@ -61,16 +64,17 @@ class MsrHandle

class SafeMsrHandle
{
MsrHandle * pHandle;
std::shared_ptr<MsrHandle> pHandle;
PCM_Util::Mutex mutex;

SafeMsrHandle(SafeMsrHandle &); // forbidden
SafeMsrHandle(const SafeMsrHandle &); // forbidden
SafeMsrHandle& operator = (const SafeMsrHandle &); // forbidden

public:
SafeMsrHandle() : pHandle(NULL) {}
SafeMsrHandle() {}

SafeMsrHandle(uint32 core_id)
SafeMsrHandle(uint32 core_id) : pHandle(new MsrHandle(core_id))
{
pHandle = new MsrHandle(core_id);
}

int32 read(uint64 msr_number, uint64 * value)
@@ -80,15 +84,15 @@ class SafeMsrHandle

*value = 0;

return sizeof(uint64);
return (int32)sizeof(uint64);
}

int32 write(uint64 msr_number, uint64 value)
{
if(pHandle)
return pHandle->write(msr_number, value);

return sizeof(uint64);
return (int32)sizeof(uint64);
}
int32 getCoreId()
{
@@ -98,6 +102,15 @@ class SafeMsrHandle
throw std::exception();
return -1;
}

void lock() {
mutex.lock();
}

void unlock() {
mutex.unlock();
}

#ifdef __APPLE__
int32 buildTopology(uint32 num_cores, void* p)
{
@@ -134,11 +147,6 @@ class SafeMsrHandle
#endif
virtual ~SafeMsrHandle()
{
if(pHandle)
{
delete pHandle;
pHandle = NULL;
}
}
};

56 changes: 56 additions & 0 deletions mutex.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#ifndef MUTEX_HEADER_
#define MUTEX_HEADER_

#ifdef _MSC_VER
#include <windows.h>
#else
#include <pthread.h>
#endif

#include <stdlib.h>

namespace PCM_Util {

class Mutex {

#ifdef _MSC_VER
HANDLE mutex_;
#else
pthread_mutex_t mutex_;
#endif
public:
Mutex() {
#ifdef _MSC_VER
mutex_ = CreateMutex(NULL, FALSE, NULL);
#else
pthread_mutex_init(&mutex_, NULL);
#endif
}
virtual ~Mutex() {
#ifdef _MSC_VER
CloseHandle(mutex_);
#else
pthread_mutex_destroy(&mutex_);
#endif
}

void lock() {
#ifdef _MSC_VER
WaitForSingleObject(mutex_, INFINITE);
#else
pthread_mutex_lock(&mutex_);
#endif
}
void unlock() {
#ifdef _MSC_VER
ReleaseMutex(mutex_);
#else
pthread_mutex_unlock(&mutex_);
#endif
}
};

};

#endif

51 changes: 30 additions & 21 deletions pci.cpp
Original file line number Diff line number Diff line change
@@ -16,14 +16,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// Jim Harris (FreeBSD)

#include <iostream>
#include <sstream>
#include <iomanip>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include "pci.h"

#ifndef _MSC_VER
@@ -80,25 +76,25 @@ int32 PciHandle::read32(uint64 offset, uint32 * value)
PCICFG_Request req;
ULONG64 result = 0;
DWORD reslength = 0;
req.bus = bus;
req.dev = device;
req.func = function;
req.bus = (ULONG)bus;
req.dev = (ULONG)device;
req.func = (ULONG)function;
req.bytes = sizeof(uint32);
req.reg = (uint32)offset;
req.reg = (ULONG)offset;

BOOL status = DeviceIoControl(hDriver, IO_CTL_PCICFG_READ, &req, sizeof(PCICFG_Request), &result, sizeof(uint64), &reslength, NULL);
BOOL status = DeviceIoControl(hDriver, IO_CTL_PCICFG_READ, &req, (DWORD)sizeof(PCICFG_Request), &result, (DWORD)sizeof(uint64), &reslength, NULL);
*value = (uint32)result;
if (!status)
{
//std::cerr << "Error reading PCI Config space at bus "<<bus<<" dev "<< device<<" function "<< function <<" offset "<< offset << " size "<< req.bytes << ". Windows error: "<<GetLastError()<<std::endl;
}
return reslength;
return (int32)reslength;
}
DWORD result = 0;
if(ReadPciConfigDwordEx(pciAddress,(DWORD)offset,&result))
{
*value = result;
return sizeof(uint32);
return (int32)sizeof(uint32);
}
return 0;
}
@@ -117,12 +113,12 @@ int32 PciHandle::write32(uint64 offset, uint32 value)
req.reg = (uint32)offset;
req.write_value = value;

BOOL status = DeviceIoControl(hDriver, IO_CTL_PCICFG_WRITE, &req, sizeof(PCICFG_Request), &result, sizeof(uint64), &reslength, NULL);
BOOL status = DeviceIoControl(hDriver, IO_CTL_PCICFG_WRITE, &req, (DWORD)sizeof(PCICFG_Request), &result, (DWORD)sizeof(uint64), &reslength, NULL);
if (!status)
{
//std::cerr << "Error writing PCI Config space at bus "<<bus<<" dev "<< device<<" function "<< function <<" offset "<< offset << " size "<< req.bytes << ". Windows error: "<<GetLastError()<<std::endl;
}
return reslength;
return (int32)reslength;
}

return (WritePciConfigDwordEx(pciAddress,(DWORD)offset,value))?sizeof(uint32):0;
@@ -141,12 +137,12 @@ int32 PciHandle::read64(uint64 offset, uint64 * value)
req.bytes = sizeof(uint64);
req.reg = (uint32)offset;

BOOL status = DeviceIoControl(hDriver, IO_CTL_PCICFG_READ, &req, sizeof(PCICFG_Request), value, sizeof(uint64), &reslength, NULL);
BOOL status = DeviceIoControl(hDriver, IO_CTL_PCICFG_READ, &req, (DWORD)sizeof(PCICFG_Request), value, (DWORD)sizeof(uint64), &reslength, NULL);
if (!status)
{
//std::cerr << "Error reading PCI Config space at bus "<<bus<<" dev "<< device<<" function "<< function <<" offset "<< offset << " size "<< req.bytes << ". Windows error: "<<GetLastError()<<std::endl;
}
return reslength;
return (int32)reslength;
}

cvt_ds cvt;
@@ -158,7 +154,7 @@ int32 PciHandle::read64(uint64 offset, uint64 * value)
if(status)
{
*value = cvt.ui64;
return sizeof(uint64);
return (int32)sizeof(uint64);
}
return 0;
}
@@ -456,13 +452,19 @@ bool PciHandleM::exists(uint32 /* bus_*/, uint32 /* device_ */, uint32 /* functi
{
int handle = ::open("/dev/mem", O_RDWR);

if (handle < 0) return false;
if (handle < 0) {
perror("error opening /dev/mem");
return false;
}

::close(handle);

handle = ::open("/sys/firmware/acpi/tables/MCFG", O_RDONLY);

if (handle < 0) return false;
if (handle < 0) {
perror("error opening /sys/firmware/acpi/tables/MCFG");
return false;
}

::close(handle);

@@ -600,19 +602,26 @@ bool PciHandleMM::exists(uint32 bus_, uint32 device_, uint32 function_)
{
int handle = ::open("/dev/mem", O_RDWR);

if (handle < 0) return false;
if (handle < 0) {
perror("error opening /dev/mem");
return false;
}

::close(handle);

handle = ::open("/sys/firmware/acpi/tables/MCFG", O_RDONLY);

if (handle < 0) return false;
if (handle < 0) {
perror("error opening /sys/firmware/acpi/tables/MCFG");
return false;
}

::close(handle);

return true;
}


int32 PciHandleMM::read32(uint64 offset, uint32 * value)
{
*value = *((uint32*)(mmapAddr+offset));
3 changes: 2 additions & 1 deletion pci.h
Original file line number Diff line number Diff line change
@@ -55,7 +55,8 @@ class PciHandle
#endif

PciHandle(); // forbidden
PciHandle(PciHandle &); // forbidden
PciHandle(const PciHandle &); // forbidden
PciHandle& operator = (const PciHandle &); // forbidden

public:
PciHandle(uint32 groupnr_, uint32 bus_, uint32 device_, uint32 function_);
418 changes: 418 additions & 0 deletions pcm-core.cpp

Large diffs are not rendered by default.

345 changes: 273 additions & 72 deletions pcm-memory.cpp

Large diffs are not rendered by default.

29 changes: 18 additions & 11 deletions pcm-msr.cpp
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ void print_usage(const char * progname)
int main(int argc, char * argv[])
{
std::cout << "\n Intel(r) Performance Counter Monitor " << INTEL_PCM_VERSION << std::endl;
std::cout << INTEL_PCM_COPYRIGHT << std::endl;
std::cout << "\n MSR read/write utility\n\n";

uint64 value = 0;
@@ -101,20 +102,26 @@ int main(int argc, char * argv[])
// drv.stop(); // restart driver (usually not needed)
if (!drv.start(driverPath))
{
std::cout << "Can not load MSR driver." << std::endl;
std::cout << "You must have signed msr.sys driver in your current directory and have administrator rights to run this program" << std::endl;
std::cerr << "Can not load MSR driver." << std::endl;
std::cerr << "You must have signed msr.sys driver in your current directory and have administrator rights to run this program" << std::endl;
return -1;
}
#endif

MsrHandle h(core);
if(!dec) std::cout << std::hex << std::showbase;
if(write)
try {
MsrHandle h(core);
if (!dec) std::cout << std::hex << std::showbase;
if (write)
{
std::cout << " Writing " << value << " to MSR " << msr << " on core " << core << std::endl;
h.write(msr, value);
}
value = 0;
h.read(msr, &value);
std::cout << " Read value " << value << " from MSR " << msr << " on core " << core << "\n" << std::endl;
}
catch (std::exception & e)
{
std::cout << " Writing "<< value << " to MSR "<< msr << " on core "<< core << std::endl;
h.write(msr,value);
std::cerr << "Error accessing MSRs: " << e.what() << std::endl;
std::cerr << "Please check if the program can access MSR drivers." << std::endl;
}
value = 0;
h.read(msr,&value);
std::cout << " Read value "<< value << " from MSR "<< msr << " on core "<< core << "\n" << std::endl;
}
7 changes: 3 additions & 4 deletions pcm-numa.cpp
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ void print_usage(const string progname)
cerr << " Examples:" << endl;
cerr << " " << progname << " 1 => print counters every second without core and socket output" << endl;
cerr << " " << progname << " 0.5 -csv=test.log => twice a second save counter values to test.log in CSV format" << endl;
cerr << " " << progname << " /csv 5 2>/dev/null => one sampe every 5 seconds, and discard all diagnostic output" << endl;
cerr << " " << progname << " /csv 5 2>/dev/null => one sample every 5 seconds, and discard all diagnostic output" << endl;
cerr << endl;
}

@@ -106,8 +106,7 @@ int main(int argc, char * argv[])

cerr << endl;
cerr << " Intel(r) Performance Counter Monitor: NUMA monitoring utility "<< endl;
cerr << endl;
cerr << " Copyright (c) 2013-2014 Intel Corporation" << endl;
cerr << INTEL_PCM_COPYRIGHT << std::endl;
cerr << endl;

double delay = -1.0;
@@ -268,7 +267,7 @@ int main(int argc, char * argv[])
m->getAllCounterStates(SysBeforeState, DummySocketStates, BeforeState);

if( sysCmd != NULL ) {
MySystem(sysCmd, sysArgv);
MySystem(sysCmd, sysArgv); delay = 0;
}

while(1)
17 changes: 9 additions & 8 deletions pcm-pcie.cpp
Original file line number Diff line number Diff line change
@@ -84,14 +84,15 @@ void print_events()
cerr << " CRd* - Demand Code Read\n";
cerr << " DRd - Demand Data Read\n";
cerr << " PCIeNSWr - PCIe Non-snoop write transfer (partial cache line)\n";
cerr << " PRd - MMIO Read [Haswell Server only: PL verify this on IVT] (Partial Cache Line)\n";
cerr << " PCIe write events (PCI devices writing to memory - application reads from disk/network/PCIe device):\n";
cerr << " PCIeWiLF - PCIe Write transfer (non-allocating) (full cache line)\n";
cerr << " PCIeItoM - PCIe Write transfer (allocating) (full cache line)\n";
cerr << " PCIeNSWr - PCIe Non-snoop write transfer (partial cache line)\n";
cerr << " PCIeNSWrF - PCIe Non-snoop write transfer (full cache line)\n";
cerr << " ItoM - PCIe write full cache line\n";
cerr << " RFO - PCIe parial Write\n";
cerr << " CPU MMIO events (CPU reading/writing to PCIe devices):\n";
cerr << " PRd - MMIO Read [Haswell Server only] (Partial Cache Line)\n";
cerr << " WiL - MMIO Write (Full/Partial)\n\n";
cerr << " * - NOTE: Depending on the configuration of your BIOS, this tool may report '0' if the message\n";
cerr << " has not been selected.\n\n";
@@ -135,7 +136,7 @@ int main(int argc, char * argv[])
cerr << endl;
cerr << " Intel(r) Performance Counter Monitor: PCIe Bandwidth Monitoring Utility "<< endl;
cerr << endl;
cerr << " Copyright (c) 2013-2014 Intel Corporation" << endl;
cerr << INTEL_PCM_COPYRIGHT << std::endl;
cerr << " This utility measures PCIe bandwidth in real-time" << endl;
cerr << endl;
print_events();
@@ -243,7 +244,7 @@ int main(int argc, char * argv[])
cerr << "\nDetected "<< m->getCPUBrandString() << " \"Intel(r) microarchitecture codename "<<m->getUArchCodename()<<"\""<<endl;
if(!(m->hasPCICFGUncore()))
{
cerr << "Jaketown, Ivytown, Haswell Server CPU is required for this tool! Program aborted" << endl;
cerr << "Jaketown, Ivytown, Haswell, Broadwell-DE Server CPU is required for this tool! Program aborted" << endl;
exit(EXIT_FAILURE);
}

@@ -282,12 +283,12 @@ int main(int argc, char * argv[])

uint32 i;
uint32 delay_ms = uint32(delay * 1000 / num_events / NUM_SAMPLES);
delay_ms * num_events * NUM_SAMPLES < delay * 1000 ? delay_ms += 1 : delay_ms = delay_ms; //Adjust the sleep if it's less than delay time
if(delay_ms * num_events * NUM_SAMPLES < delay * 1000) ++delay_ms; //Adjust the delay_ms if it's less than delay time
sample_t sample[max_sockets];
cerr << "delay_ms: " << delay_ms << endl;

if( sysCmd != NULL ) {
MySystem(sysCmd, sysArgv);
MySystem(sysCmd, sysArgv); delay = 0;
}

// ================================== Begin Printing Output ==================================
@@ -302,7 +303,7 @@ int main(int argc, char * argv[])
memset(sample,0,sizeof(sample));
memset(&aggregate_sample,0,sizeof(aggregate_sample));

if(m->getCPUModel() == PCM::HASWELLX) // Haswell Server
if(m->getCPUModel() == PCM::HASWELLX || m->getCPUModel() == PCM::BDX_DE) // Haswell Server
{
for(i=0;i<NUM_SAMPLES;i++)
{
@@ -607,7 +608,7 @@ int main(int argc, char * argv[])
memset(sample,0,sizeof(sample));
memset(&aggregate_sample,0,sizeof(aggregate_sample));

if(m->getCPUModel() == PCM::HASWELLX) // Haswell Server
if(m->getCPUModel() == PCM::HASWELLX || m->getCPUModel() == PCM::BDX_DE) // Haswell Server
{
for(i=0;i<NUM_SAMPLES;i++)
{
@@ -838,7 +839,7 @@ void getPCIeEvents(PCM *m, PCM::PCIeEventCode opcode, uint32 delay_ms, sample_t
sample[i].total.PCIeNSWr += (sizeof(PCIeEvents_t)/sizeof(uint64)) * getNumberOfEvents(before[i], after[i]);
sample[i].miss.PCIeNSWr += (sizeof(PCIeEvents_t)/sizeof(uint64)) * getNumberOfEvents(before2[i], after2[i]);
sample[i].hit.PCIeNSWr += (sample[i].total.PCIeNSWr > sample[i].miss.PCIeNSWr) ? sample[i].total.PCIeNSWr - sample[i].miss.PCIeNSWr : 0;
aggregate_sample.PCIeItoM += sample[i].total.PCIeItoM;
aggregate_sample.PCIeNSWr += sample[i].total.PCIeNSWr;
break;
case PCM::PCIeNSWrF:
sample[i].total.PCIeNSWrF += (sizeof(PCIeEvents_t)/sizeof(uint64)) * getNumberOfEvents(before[i], after[i]);
23 changes: 15 additions & 8 deletions pcm-power.cpp
Original file line number Diff line number Diff line change
@@ -146,7 +146,8 @@ int main(int argc, char * argv[])
set_signal_handlers();

std::cerr << "\n Intel(r) Performance Counter Monitor " << INTEL_PCM_VERSION << std::endl;
std::cerr << "\n Power Monitoring Utility\n Copyright (c) 2011-2014 Intel Corporation\n";
std::cerr << "\n Power Monitoring Utility\n";
std::cerr << INTEL_PCM_COPYRIGHT << std::endl;

int imc_profile = 0;
int pcu_profile = 0;
@@ -287,8 +288,12 @@ int main(int argc, char * argv[])
std::cout << std::fixed;
std::cerr << "\nMC counter group: "<<imc_profile << std::endl;
std::cerr << "PCU counter group: "<<pcu_profile << std::endl;
if(pcu_profile == 0)
std::cerr << "Freq bands [0/1/2]: "<<freq_band[0]*100 << " MHz; "<< freq_band[1]*100 << " MHz; "<<freq_band[2]*100 << " MHz; "<<std::endl;
if (pcu_profile == 0) {
if (cpu_model == PCM::HASWELLX || cpu_model == PCM::BDX_DE)
std::cerr << "Your processor does not support frequency band statistics" << std::endl;
else
std::cerr << "Freq bands [0/1/2]: " << freq_band[0] * 100 << " MHz; " << freq_band[1] * 100 << " MHz; " << freq_band[2] * 100 << " MHz; " << std::endl;
}
if(sysCmd != NULL)
std::cerr << "Update every "<<delay<<" seconds"<< std::endl;

@@ -309,7 +314,7 @@ int main(int argc, char * argv[])

BeforeTime = m->getTickCount();
if( sysCmd != NULL ) {
MySystem(sysCmd, sysArgv);
MySystem(sysCmd, sysArgv); delay = 0;
}

while(1)
@@ -395,6 +400,8 @@ int main(int argc, char * argv[])
switch(pcu_profile)
{
case 0:
if (cpu_model == PCM::HASWELLX || cpu_model == PCM::BDX_DE)
break;
std::cout << "S"<<socket
<< "; PCUClocks: "<< getPCUClocks(BeforeState[socket],AfterState[socket])
<< "; Freq band 0/1/2 cycles: "<< 100.*getNormalizedPCUCounter(1,BeforeState[socket],AfterState[socket])<<"%"
@@ -451,11 +458,11 @@ int main(int argc, char * argv[])
case 6:
std::cout << "S"<<socket ;

if(cpu_model == PCM::HASWELLX)
if(cpu_model == PCM::HASWELLX || PCM::BDX_DE == cpu_model)
std::cout << "; PC1e+ residency: "<< getNormalizedPCUCounter(0,BeforeState[socket],AfterState[socket], m)*100. <<" %"
"; PC1e+ transition count: "<< getPCUCounter(1,BeforeState[socket],AfterState[socket]) <<" ";

if(cpu_model == PCM::IVYTOWN || cpu_model == PCM::HASWELLX)
if(cpu_model == PCM::IVYTOWN || cpu_model == PCM::HASWELLX || PCM::BDX_DE == cpu_model)
{
std::cout << "; PC2 residency: "<< getPackageCStateResidency(2,BeforeState[socket],AfterState[socket])*100. <<" %";
std::cout << "; PC2 transitions: "<< getPCUCounter(2,BeforeState[socket],AfterState[socket]) <<" ";
@@ -467,7 +474,7 @@ int main(int argc, char * argv[])
std::cout << "\n";
break;
case 7:
if(PCM::HASWELLX == cpu_model) {
if(PCM::HASWELLX == cpu_model || PCM::BDX_DE == cpu_model) {
std::cout << "S"<<socket
<< "; UFS_TRANSITIONS_PERF_P_LIMIT: "<< getNormalizedPCUCounter(0,BeforeState[socket],AfterState[socket], m)*100. <<" %"
<< "; UFS_TRANSITIONS_IO_P_LIMIT: " << getNormalizedPCUCounter(1,BeforeState[socket],AfterState[socket], m)*100. <<" %"
@@ -477,7 +484,7 @@ int main(int argc, char * argv[])
}
break;
case 8:
if(PCM::HASWELLX == cpu_model) {
if(PCM::HASWELLX == cpu_model || PCM::BDX_DE == cpu_model) {
std::cout << "S"<<socket
<< "; UFS_TRANSITIONS_DOWN: "<< getNormalizedPCUCounter(0,BeforeState[socket],AfterState[socket], m)*100. <<" %"
<< "\n";
27 changes: 23 additions & 4 deletions pcm-tsx.cpp
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ TSXEvent eventDefinition[] = {
{"RTM_RETIRED.ABORTED", 0xC9, 0x04, "Number of times an RTM execution aborted due to any reasons (multiple categories may count as one)"},
{"RTM_RETIRED.ABORTED_MISC1", 0xC9, 0x08, "Number of times an RTM execution aborted due to various memory events"},
{"RTM_RETIRED.ABORTED_MISC2", 0xC9, 0x10, "Number of times an RTM execution aborted due to uncommon conditions"},
{"RTM_RETIRED.ABORTED_MISC3", 0xC9, 0x20, "Number of times an RTM execution aborted due to HLE-unfriendly instructions"},
{"RTM_RETIRED.ABORTED_MISC3", 0xC9, 0x20, "Number of times an RTM execution aborted due to Intel TSX-unfriendly instructions"},
{"RTM_RETIRED.ABORTED_MISC4", 0xC9, 0x40, "Number of times an RTM execution aborted due to incompatible memory type"},
{"RTM_RETIRED.ABORTED_MISC5", 0xC9, 0x80, "Number of times an RTM execution aborted due to none of the previous 4 categories (e.g. interrupt)"},

@@ -71,7 +71,7 @@ TSXEvent eventDefinition[] = {
{"HLE_RETIRED.ABORTED", 0xC8, 0x04, "Number of times an HLE execution aborted due to any reasons (multiple categories may count as one)"},
{"HLE_RETIRED.ABORTED_MISC1", 0xC8, 0x08, "Number of times an HLE execution aborted due to various memory events"},
{"HLE_RETIRED.ABORTED_MISC2", 0xC8, 0x10, "Number of times an HLE execution aborted due to uncommon conditions"},
{"HLE_RETIRED.ABORTED_MISC3", 0xC8, 0x20, "Number of times an HLE execution aborted due to HLE-unfriendly instructions"},
{"HLE_RETIRED.ABORTED_MISC3", 0xC8, 0x20, "Number of times an HLE execution aborted due to Intel TSX-unfriendly instructions"},
{"HLE_RETIRED.ABORTED_MISC4", 0xC8, 0x40, "Number of times an HLE execution aborted due to incompatible memory type"},
{"HLE_RETIRED.ABORTED_MISC5", 0xC8, 0x80, "Number of times an HLE execution aborted due to none of the previous 4 categories (e.g. interrupt)"},

@@ -99,6 +99,7 @@ void print_usage(const string progname)
cerr << " will read counters only after external program finishes" << endl;
cerr << " Supported <options> are: " << endl;
cerr << " -h | --help | /h => print this help and exit" << endl;
cerr << " -F | -force => force running this program despite lack of HW RTM support (optional)" << endl;
cerr << " -csv[=file.csv] | /csv[=file.csv] => output compact CSV format to screen or" << endl
<< " to a file, in case filename is provided" << endl;
cerr << " [-e event1] [-e event2] [-e event3]=> optional list of custom TSX events to monitor (up to 4)."
@@ -198,7 +199,7 @@ int main(int argc, char * argv[])
cerr << endl;
cerr << " Intel(r) Performance Counter Monitor: Intel(r) Transactional Synchronization Extensions Monitoring Utility "<< endl;
cerr << endl;
cerr << " Copyright (c) 2013-2014 Intel Corporation" << endl;
cerr << INTEL_PCM_COPYRIGHT << std::endl;
cerr << endl;

double delay = -1.0;
@@ -208,6 +209,7 @@ int main(int argc, char * argv[])
int cur_event;
bool csv = false;
long diff_usec = 0; // deviation of clock is useconds between measurements
bool force = false;
int calibrated = PCM_CALIBRATION_INTERVAL - 2; // keeps track is the clock calibration needed
string program = string(argv[0]);

@@ -258,6 +260,13 @@ int main(int argc, char * argv[])
continue;
}
else
if ( (strncmp(*argv, "-F", 2) == 0) ||
(strncmp(*argv, "-f", 2) == 0) ||
(strncmp(*argv, "-force", 6) == 0) )
{
force = true;
}
else
if (strncmp(*argv, "--", 2) == 0)
{
argv++;
@@ -344,6 +353,16 @@ int main(int argc, char * argv[])

cerr << "\nDetected "<< m->getCPUBrandString() << " \"Intel(r) microarchitecture codename "<<m->getUArchCodename()<<"\""<<endl;

bool rtm_support = m->supportsRTM();

if (!rtm_support) {
if (!force) {
cerr << "No RTM support detected, use -F if you still want to run this program." << endl;
exit(EXIT_FAILURE);
}
cerr << "No RTM support detected, but -F found as argument, running anyway." << endl;
}

uint64 BeforeTime = 0, AfterTime = 0;
SystemCounterState SysBeforeState, SysAfterState;
const uint32 ncores = m->getNumCores();
@@ -376,7 +395,7 @@ int main(int argc, char * argv[])
m->getAllCounterStates(SysBeforeState, DummySocketStates, BeforeState);

if( sysCmd != NULL ) {
MySystem(sysCmd, sysArgv);
MySystem(sysCmd, sysArgv); delay = 0;
}

while(1)
115 changes: 68 additions & 47 deletions pcm.cpp
Original file line number Diff line number Diff line change
@@ -126,8 +126,8 @@ void print_output(PCM * m,
cout << " L2MISS: L2 cache misses (including other core's L2 cache *hits*) " << "\n";
if (cpu_model != PCM::ATOM) cout << " L3HIT : L3 cache hit ratio (0.00-1.00)" << "\n";
cout << " L2HIT : L2 cache hit ratio (0.00-1.00)" << "\n";
if (cpu_model != PCM::ATOM) cout << " L3CLK : ratio of CPU cycles lost due to L3 cache misses (0.00-1.00), in some cases could be >1.0 due to a higher memory latency" << "\n";
if (cpu_model != PCM::ATOM) cout << " L2CLK : ratio of CPU cycles lost due to missing L2 cache but still hitting L3 cache (0.00-1.00)" << "\n";
if (cpu_model != PCM::ATOM) cout << " L3MPI : number of L3 cache misses per instruction\n";
if (cpu_model != PCM::ATOM) cout << " L2MPI : number of L2 cache misses per instruction\n";
if (cpu_model != PCM::ATOM) cout << " READ : bytes read from memory controller (in GBytes)" << "\n";
if (cpu_model != PCM::ATOM) cout << " WRITE : bytes written to memory controller (in GBytes)" << "\n";
if (m->memoryIOTrafficMetricAvailable()) cout << " IO : bytes read/written due to IO requests to memory controller (in GBytes); this may be an over estimate due to same-cache-line partial requests" << "\n";
@@ -141,7 +141,7 @@ void print_output(PCM * m,
cout << " Core (SKT) | EXEC | IPC | FREQ | L2MISS | L2HIT | TEMP" << "\n" << "\n";
else
{
cout << " Core (SKT) | EXEC | IPC | FREQ | AFREQ | L3MISS | L2MISS | L3HIT | L2HIT | L3CLK | L2CLK |";
cout << " Core (SKT) | EXEC | IPC | FREQ | AFREQ | L3MISS | L2MISS | L3HIT | L2HIT | L3MPI | L2MPI |";

if (m->L3CacheOccupancyMetricAvailable())
cout << " L3OCC | READ | WRITE |";
@@ -174,8 +174,8 @@ void print_output(PCM * m,
" " << unit_format(getL2CacheMisses(cstates1[i], cstates2[i])) <<
" " << getL3CacheHitRatio(cstates1[i], cstates2[i]) <<
" " << getL2CacheHitRatio(cstates1[i], cstates2[i]) <<
" " << getCyclesLostDueL3CacheMisses(cstates1[i], cstates2[i]) <<
" " << getCyclesLostDueL2CacheMisses(cstates1[i], cstates2[i]) ;
" " << double(getL3CacheMisses(cstates1[i], cstates2[i])) / getInstructionsRetired(cstates1[i], cstates2[i]) <<
" " << double(getL2CacheMisses(cstates1[i], cstates2[i])) / getInstructionsRetired(cstates1[i], cstates2[i]) ;
if (m->L3CacheOccupancyMetricAvailable())
cout << " " << setw(6) << l3cache_occ_format(getL3CacheOccupancy(cstates2[i])) ;
if (m->memoryIOTrafficMetricAvailable())
@@ -212,8 +212,8 @@ void print_output(PCM * m,
" " << unit_format(getL2CacheMisses(sktstate1[i], sktstate2[i])) <<
" " << getL3CacheHitRatio(sktstate1[i], sktstate2[i]) <<
" " << getL2CacheHitRatio(sktstate1[i], sktstate2[i]) <<
" " << getCyclesLostDueL3CacheMisses(sktstate1[i], sktstate2[i]) <<
" " << getCyclesLostDueL2CacheMisses(sktstate1[i], sktstate2[i]);
" " << double(getL3CacheMisses(sktstate1[i], sktstate2[i])) / getInstructionsRetired(sktstate1[i], sktstate2[i]) <<
" " << double(getL2CacheMisses(sktstate1[i], sktstate2[i])) / getInstructionsRetired(sktstate1[i], sktstate2[i]);
if (m->L3CacheOccupancyMetricAvailable())
cout << " " << setw(6) << l3cache_occ_format(getL3CacheOccupancy(sktstate2[i])) ;
if (m->memoryTrafficMetricsAvailable())
@@ -243,8 +243,8 @@ void print_output(PCM * m,
" " << unit_format(getL2CacheMisses(sstate1, sstate2)) <<
" " << getL3CacheHitRatio(sstate1, sstate2) <<
" " << getL2CacheHitRatio(sstate1, sstate2) <<
" " << getCyclesLostDueL3CacheMisses(sstate1, sstate2) <<
" " << getCyclesLostDueL2CacheMisses(sstate1, sstate2) ;
" " << double(getL3CacheMisses(sstate1, sstate2)) / getInstructionsRetired(sstate1, sstate2) <<
" " << double(getL2CacheMisses(sstate1, sstate2)) / getInstructionsRetired(sstate1, sstate2);
if (m->L3CacheOccupancyMetricAvailable())
cout << " " << " N/A ";
if (m->memoryTrafficMetricsAvailable())
@@ -376,27 +376,42 @@ void print_output(PCM * m,
}
if (show_socket_output)
{
if (m->packageEnergyMetricsAvailable())
cout << "\n";
cout << " package/CPU energy (Joules) DIMM energy (Joules)\n";
cout << "----------------------------------------------------------------------------------------------" << "\n";
for (uint32 i = 0; i < m->getNumSockets(); ++i)
{
cout << "\n";
cout << "----------------------------------------------------------------------------------------------" << "\n";
for (uint32 i = 0; i < m->getNumSockets(); ++i)
{
cout << " SKT " << setw(2) << i << " package consumed " << getConsumedJoules(sktstate1[i], sktstate2[i]) << " Joules\n";
}
cout << "----------------------------------------------------------------------------------------------" << "\n";
cout << " TOTAL: " << getConsumedJoules(sstate1, sstate2) << " Joules\n";
cout << " SKT " << setw(2) << i << " ";
if(m->packageEnergyMetricsAvailable()) {
cout << setw(10) << getConsumedJoules(sktstate1[i], sktstate2[i]);
} else {
cout << " N/A ";
}
cout << " ";
if(m->dramEnergyMetricsAvailable()) {
cout << setw(10) << getDRAMConsumedJoules(sktstate1[i], sktstate2[i]);
} else {
cout << " N/A ";
}
cout << "\n";
}
if (m->dramEnergyMetricsAvailable())
{
cout << "\n";
cout << "----------------------------------------------------------------------------------------------" << "\n";
for (uint32 i = 0; i < m->getNumSockets(); ++i)
{
cout << " SKT " << setw(2) << i << " DIMMs consumed " << getDRAMConsumedJoules(sktstate1[i], sktstate2[i]) << " Joules\n";
cout << "----------------------------------------------------------------------------------------------" << "\n";
if (m->getNumSockets() > 1) {
cout << " * ";
if (m->packageEnergyMetricsAvailable()) {
cout << setw(10) << getConsumedJoules(sstate1, sstate2);
}
cout << "----------------------------------------------------------------------------------------------" << "\n";
cout << " TOTAL: " << getDRAMConsumedJoules(sstate1, sstate2) << " Joules\n";
else {
cout << " N/A ";
}
cout << " ";
if (m->dramEnergyMetricsAvailable()) {
cout << setw(10) << getDRAMConsumedJoules(sstate1, sstate2);
}
else {
cout << " N/A ";
}
cout << "\n";
}
}

@@ -541,9 +556,9 @@ void print_csv_header(PCM * m,
if (cpu_model != PCM::ATOM)
{
if (m->L3CacheOccupancyMetricAvailable())
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3CLK;L2CLK;L3OCC;READ;WRITE;";
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3MPI;L2MPI;L3OCC;READ;WRITE;";
else
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3CLK;L2CLK;READ;WRITE;";
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3MPI;L2MPI;READ;WRITE;";
}
else
{
@@ -581,9 +596,9 @@ void print_csv_header(PCM * m,
else
{
if (m->L3CacheOccupancyMetricAvailable())
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3CLK;L2CLK;L3OCC;READ;WRITE;TEMP;";
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3MPI;L2MPI;L3OCC;READ;WRITE;TEMP;";
else
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3CLK;L2CLK;READ;WRITE;TEMP;";
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3MPI;L2MPI;READ;WRITE;TEMP;";
}
}

@@ -650,9 +665,9 @@ void print_csv_header(PCM * m,
else
{
if (m->L3CacheOccupancyMetricAvailable())
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3CLK;L2CLK;L3OCC;";
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3MPI;L2MPI;L3OCC;";
else
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3CLK;L2CLK;";
cout << "EXEC;IPC;FREQ;AFREQ;L3MISS;L2MISS;L3HIT;L2HIT;L3MPI;L2MPI;";
}


@@ -711,10 +726,10 @@ void print_csv(PCM * m,
';' << float_format(getL2CacheMisses(sstate1, sstate2)) <<
';' << getL3CacheHitRatio(sstate1, sstate2) <<
';' << getL2CacheHitRatio(sstate1, sstate2) <<
';' << getCyclesLostDueL3CacheMisses(sstate1, sstate2) <<
';' << getCyclesLostDueL2CacheMisses(sstate1, sstate2) << ";";
if (m->L3CacheOccupancyMetricAvailable())
cout << "N/A;";
';' << double(getL3CacheMisses(sstate1, sstate2)) / getInstructionsRetired(sstate1, sstate2) <<
';' << double(getL2CacheMisses(sstate1, sstate2)) / getInstructionsRetired(sstate1, sstate2) << ";";
if (m->L3CacheOccupancyMetricAvailable())
cout << "N/A;";
if (!(m->memoryTrafficMetricsAvailable()))
cout << "N/A;N/A;";
else
@@ -758,7 +773,6 @@ void print_csv(PCM * m,

}


if (show_socket_output)
{
{
@@ -779,9 +793,9 @@ void print_csv(PCM * m,
';' << float_format(getL2CacheMisses(sktstate1[i], sktstate2[i])) <<
';' << getL3CacheHitRatio(sktstate1[i], sktstate2[i]) <<
';' << getL2CacheHitRatio(sktstate1[i], sktstate2[i]) <<
';' << getCyclesLostDueL3CacheMisses(sktstate1[i], sktstate2[i]) <<
';' << getCyclesLostDueL2CacheMisses(sktstate1[i], sktstate2[i]);
if (m->L3CacheOccupancyMetricAvailable())
';' << double(getL3CacheMisses(sktstate1[i], sktstate2[i])) / getInstructionsRetired(sktstate1[i], sktstate2[i]) <<
';' << double(getL2CacheMisses(sktstate1[i], sktstate2[i])) / getInstructionsRetired(sktstate1[i], sktstate2[i]) ;
if (m->L3CacheOccupancyMetricAvailable())
cout << ';' << l3cache_occ_format(getL3CacheOccupancy(sktstate2[i]));
if (!(m->memoryTrafficMetricsAvailable()))
cout << ";N/A;N/A";
@@ -859,10 +873,11 @@ void print_csv(PCM * m,
';' << float_format(getL2CacheMisses(cstates1[i], cstates2[i])) <<
';' << getL3CacheHitRatio(cstates1[i], cstates2[i]) <<
';' << getL2CacheHitRatio(cstates1[i], cstates2[i]) <<
';' << getCyclesLostDueL3CacheMisses(cstates1[i], cstates2[i]) <<
';' << getCyclesLostDueL2CacheMisses(cstates1[i], cstates2[i]) ;
';' << double(getL3CacheMisses(cstates1[i], cstates2[i])) / getInstructionsRetired(cstates1[i], cstates2[i]) <<
';' << double(getL2CacheMisses(cstates1[i], cstates2[i])) / getInstructionsRetired(cstates1[i], cstates2[i]);
if (m->L3CacheOccupancyMetricAvailable())
cout << ';' << l3cache_occ_format(getL3CacheOccupancy(cstates2[i])) ;
cout << ';';
}
else
cout << getExecUsage(cstates1[i], cstates2[i]) <<
@@ -896,7 +911,7 @@ int main(int argc, char * argv[])
cerr << endl;
cerr << " Intel(r) Performance Counter Monitor " << INTEL_PCM_VERSION << endl;
cerr << endl;
cerr << " Copyright (c) 2009-2014 Intel Corporation" << endl;
cerr << INTEL_PCM_COPYRIGHT << endl;
cerr << endl;

// if delay is not specified: use either default (1 second),
@@ -1124,7 +1139,7 @@ int main(int argc, char * argv[])
m->getAllCounterStates(sstate1, sktstate1, cstates1);

if (sysCmd != NULL) {
MySystem(sysCmd, sysArgv);
MySystem(sysCmd, sysArgv); delay = 0;
}

unsigned int i = 1;
@@ -1177,8 +1192,14 @@ int main(int argc, char * argv[])
else
{
assert(getNumberOfCustomEvents(0, sstate1, sstate2) == getL3CacheMisses(sstate1, sstate2));
assert(getNumberOfCustomEvents(1, sstate1, sstate2) == getL3CacheHitsNoSnoop(sstate1, sstate2));
assert(getNumberOfCustomEvents(2, sstate1, sstate2) == getL3CacheHitsSnoop(sstate1, sstate2));
if (m->useSkylakeEvents()) {
assert(getNumberOfCustomEvents(1, sstate1, sstate2) == getL3CacheHits(sstate1, sstate2));
assert(getNumberOfCustomEvents(2, sstate1, sstate2) == getL2CacheMisses(sstate1, sstate2));
}
else {
assert(getNumberOfCustomEvents(1, sstate1, sstate2) == getL3CacheHitsNoSnoop(sstate1, sstate2));
assert(getNumberOfCustomEvents(2, sstate1, sstate2) == getL3CacheHitsSnoop(sstate1, sstate2));
}
assert(getNumberOfCustomEvents(3, sstate1, sstate2) == getL2CacheHits(sstate1, sstate2));
}

94 changes: 94 additions & 0 deletions pmu-query.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/usr/bin/python
import urllib2
import json, csv
import subprocess
import sys
import platform
import getopt

all_flag = False
download_flag = False
filename=None
offcore_events=[]

try:
opts, args = getopt.getopt(sys.argv[1:],'a,f:,d',['all','file=','download'])
for o, a in opts:
if o in ('-a','--all'):
all_flag=True
if o in ('-f','--file'):
filename=a
if o in ('-d','--download'):
download_flag=True
except getopt.GetoptError, err:
print("parse error: %s\n" %(str(err)))
exit(-2)

if filename == None:
map_file_raw=urllib2.urlopen('https://download.01.org/perfmon/mapfile.csv')
map_dict = csv.DictReader(map_file_raw)
map_file = []
core_path = ''
offcore_path = ''

while True:
try:
map_file.append(map_dict.next())
except StopIteration:
break

if platform.system() == 'CYGWIN_NT-6.1':
p = subprocess.Popen(['./pcm-core.exe -c'],stdout=subprocess.PIPE,shell=True)
elif platform.system() == 'Windows':
p = subprocess.Popen(['pcm-core.exe -c'],stdout=subprocess.PIPE,shell=True)
else:
p = subprocess.Popen(['./pcm-core.x -c'],stdout=subprocess.PIPE,shell=True)

(output, err) = p.communicate()
p_status = p.wait()
for model in map_file:
if model['Family-model'] in output:
if(model['EventType'] == 'core'):
core_path = model['Filename']
elif(model['EventType'] == 'offcore'):
offcore_path = model['Filename']
print (model)

if core_path != '':
json_core_data=urllib2.urlopen('https://download.01.org/perfmon'+core_path)
core_events=json.load(json_core_data)
if(download_flag == True):
with open(core_path.split('/')[-1],'w') as outfile:
json.dump(core_events, outfile, sort_keys=True, indent=4)
else:
print ('no core event found for %s CPU, program abort...' % (output))
exit(-1)

if offcore_path != '':
json_offcore_data=urllib2.urlopen('https://download.01.org/perfmon'+offcore_path)
offcore_events=json.load(json_offcore_data)
if(download_flag == True):
with open(offcore_path.split('/')[-1],'w') as outfile:
json.dump(offcore_events, outfile, sort_keys=True, indent=4)
else:
core_events=json.load(open(filename))

if all_flag == True:
for event in core_events+offcore_events:
if event.has_key('EventName') and event.has_key('BriefDescription'):
print (event['EventName']+':'+event['BriefDescription'])
sys.exit(0)

name=raw_input("Event to query (empty enter to quit):")
while(name != ''):
for event in core_events+offcore_events:
if event.has_key('EventName') and name.lower() in event['EventName'].lower():
print (event['EventName']+':'+event['BriefDescription'])
for ev_code in event['EventCode'].split(', '):
print ('cpu/umask=%s,event=%s,name=%s%s%s%s%s/' % (
event['UMask'], ev_code, event['EventName'],
(',offcore_rsp=%s' % (event['MSRValue'])) if event['MSRValue'] != '0' else '',
(',inv=%s' % (event['Invert'])) if event['Invert'] != '0' else '',
(',any=%s' % (event['AnyThread'])) if event['AnyThread'] != '0' else '',
(',edge') if event['EdgeDetect'] != '0' else ''))
name=raw_input("Event to query (empty enter to quit):")
17 changes: 14 additions & 3 deletions types.h
Original file line number Diff line number Diff line change
@@ -21,9 +21,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
\brief Internal type and constant definitions
*/

// compile for Windows 7 or Windows Server 2008 R2 (processor group support needed for systems with high core count)
#define COMPILE_FOR_WINDOWS_7

#undef PCM_DEBUG

#include <iostream>
@@ -102,6 +99,20 @@ typedef signed int int32;
#define MEM_LOAD_UOPS_RETIRED_L2_HIT_EVTNR (0xD1)
#define MEM_LOAD_UOPS_RETIRED_L2_HIT_UMASK (0x02)

// Skylake on-core events

#define SKL_MEM_LOAD_RETIRED_L3_MISS_EVTNR (0xD1)
#define SKL_MEM_LOAD_RETIRED_L3_MISS_UMASK (0x20)

#define SKL_MEM_LOAD_RETIRED_L3_HIT_EVTNR (0xD1)
#define SKL_MEM_LOAD_RETIRED_L3_HIT_UMASK (0x04)

#define SKL_MEM_LOAD_RETIRED_L2_MISS_EVTNR (0xD1)
#define SKL_MEM_LOAD_RETIRED_L2_MISS_UMASK (0x10)

#define SKL_MEM_LOAD_RETIRED_L2_HIT_EVTNR (0xD1)
#define SKL_MEM_LOAD_RETIRED_L2_HIT_UMASK (0x02)

// architectural on-core events

#define ARCH_LLC_REFERENCE_EVTNR (0x2E)
20 changes: 9 additions & 11 deletions utils.cpp
Original file line number Diff line number Diff line change
@@ -17,10 +17,8 @@ CT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// written by Andrey Semin

#include <iostream>
#include <fstream>
#include <climits>
#include <cstring>
#include <cassert>
#include <climits>
#ifdef _MSC_VER
#include <process.h>
#include <comdef.h>
@@ -47,17 +45,16 @@ void exit_cleanup(void)

#ifdef _MSC_VER

#ifdef COMPILE_FOR_WINDOWS_7
ThreadGroupTempAffinity::ThreadGroupTempAffinity(uint32 core_id)
{
GROUP_AFFINITY NewGroupAffinity;
memset(&NewGroupAffinity, 0, sizeof(GROUP_AFFINITY));
memset(&PreviousGroupAffinity, 0, sizeof(GROUP_AFFINITY));
uint32 currentGroupSize = 0;
DWORD currentGroupSize = 0;

while (core_id >= (currentGroupSize = GetMaximumProcessorCount(NewGroupAffinity.Group)))
while ((DWORD)core_id >= (currentGroupSize = GetActiveProcessorCount(NewGroupAffinity.Group)))
{
core_id -= currentGroupSize;
core_id -= (uint32)currentGroupSize;
++NewGroupAffinity.Group;
}
NewGroupAffinity.Mask = 1ULL << core_id;
@@ -67,7 +64,6 @@ ThreadGroupTempAffinity::~ThreadGroupTempAffinity()
{
SetThreadGroupAffinity(GetCurrentThread(),&PreviousGroupAffinity,NULL);
}
#endif

LONG unhandled_exception_handler(LPEXCEPTION_POINTERS p)
{
@@ -235,8 +231,10 @@ void set_signal_handlers(void)
// to fix Cygwin/BASH setting Ctrl+C handler need first to restore the default one
handlerStatus = SetConsoleCtrlHandler(NULL, FALSE); // restores normal processing of CTRL+C input
if(handlerStatus == 0) {
_com_error error(GetLastError());
std::wcerr << "Failed to set Ctrl+C hanlder. Error code: " << GetLastError() << " " << error.ErrorMessage() << std::endl;
std::wcerr << "Failed to set Ctrl+C hanlder. Error code: " << GetLastError() << " ";
const TCHAR * errorStr = _com_error(GetLastError()).ErrorMessage();
if (errorStr) std::wcerr << errorStr;
std::wcerr << std::endl;
_exit(EXIT_FAILURE);
}
SetConsoleCtrlHandler((PHANDLER_ROUTINE)sigINT_handler, TRUE);
@@ -256,7 +254,7 @@ void set_signal_handlers(void)
sigaction(SIGTERM, &saINT, NULL);
sigaction(SIGSEGV, &saINT, NULL);

saINT.sa_flags = SA_RESTART || SA_NOCLDSTOP;
saINT.sa_flags = SA_RESTART | SA_NOCLDSTOP;
sigaction(SIGCHLD, &saINT, NULL); // get there is our child exits. do nothing if it stoped/continued

// install SIGHUP handler to restart
14 changes: 10 additions & 4 deletions utils.h
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ inline void win_usleep(int delay_us)
QueryPerformanceCounter((LARGE_INTEGER *) &t1);
do {
QueryPerformanceCounter((LARGE_INTEGER *) &t2);
YieldProcessor();
_mm_pause();
} while ((t2-t1) < wait_tick);
}
#endif
@@ -73,7 +73,7 @@ inline void MySleep(int delay)
inline void MySleepMs(int delay_ms)
{
#ifdef _MSC_VER
if(delay_ms) Sleep(delay_ms);
if(delay_ms) Sleep((DWORD)delay_ms);
#else
struct timespec sleep_intrval;
double complete_seconds;
@@ -95,10 +95,17 @@ inline void MySleepUs(int delay_us)

void MySystem(char * sysCmd, char ** argc);

#ifdef _MSC_VER
#pragma warning (disable : 4068 ) // disable unknown pragma warning
#endif

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
struct null_stream : public std::streambuf
{
void overflow(char) { }
};
#pragma clang diagnostic pop

template <class IntType>
inline std::string unit_format(IntType n)
@@ -137,20 +144,19 @@ inline std::string unit_format(IntType n)
pcm_compile_assert_failed pcm_compile_assert_failed_; \
PCM_UNUSED(pcm_compile_assert_failed_);

#ifdef COMPILE_FOR_WINDOWS_7
#ifdef _MSC_VER
class ThreadGroupTempAffinity
{
GROUP_AFFINITY PreviousGroupAffinity;

ThreadGroupTempAffinity(); // forbidden
ThreadGroupTempAffinity(const ThreadGroupTempAffinity &); // forbidden
ThreadGroupTempAffinity& operator = (const ThreadGroupTempAffinity &); // forbidden
public:
ThreadGroupTempAffinity(uint32 core_id);
~ThreadGroupTempAffinity();
};
#endif
#endif

#endif

74 changes: 48 additions & 26 deletions width_extender.h
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include <stdlib.h>
#include "cpucounters.h"
#include "client_bw.h"
#include "mutex.h"
#include <memory>

#ifdef _MSC_VER
DWORD WINAPI WatchDogProc(LPVOID state);
@@ -47,9 +49,9 @@ class CounterWidthExtender

struct MsrHandleCounter : public AbstractRawCounter
{
SafeMsrHandle * msr;
std::shared_ptr<SafeMsrHandle> msr;
uint64 msr_addr;
MsrHandleCounter(SafeMsrHandle * msr_, uint64 msr_addr_): msr(msr_), msr_addr(msr_addr_) {}
MsrHandleCounter(std::shared_ptr<SafeMsrHandle> msr_, uint64 msr_addr_) : msr(msr_), msr_addr(msr_addr_) {}
uint64 operator() ()
{
uint64 value = 0;
@@ -60,51 +62,78 @@ class CounterWidthExtender

struct ClientImcReadsCounter : public AbstractRawCounter
{
ClientBW * clientBW;
ClientImcReadsCounter(ClientBW * clientBW_): clientBW(clientBW_) {}
std::shared_ptr<ClientBW> clientBW;
ClientImcReadsCounter(std::shared_ptr<ClientBW> clientBW_) : clientBW(clientBW_) {}
uint64 operator() () { return clientBW->getImcReads(); }
};

struct ClientImcWritesCounter : public AbstractRawCounter
{
ClientBW * clientBW;
ClientImcWritesCounter(ClientBW * clientBW_): clientBW(clientBW_) {}
std::shared_ptr<ClientBW> clientBW;
ClientImcWritesCounter(std::shared_ptr<ClientBW> clientBW_) : clientBW(clientBW_) {}
uint64 operator() () { return clientBW->getImcWrites(); }
};

struct ClientIoRequestsCounter : public AbstractRawCounter
{
ClientBW * clientBW;
ClientIoRequestsCounter(ClientBW * clientBW_): clientBW(clientBW_) {}
std::shared_ptr<ClientBW> clientBW;
ClientIoRequestsCounter(std::shared_ptr<ClientBW> clientBW_) : clientBW(clientBW_) {}
uint64 operator() () { return clientBW->getIoRequests(); }
};

struct MBLCounter : public AbstractRawCounter
{
std::shared_ptr<SafeMsrHandle> msr;
MBLCounter(std::shared_ptr<SafeMsrHandle> msr_) : msr(msr_){}
uint64 operator() ()
{
msr->lock();
msr->write(IA32_QM_EVTSEL, 0xdead); // TODO: change 0xdead to MBL event value
uint64 value = 0;
msr->read(IA32_PQR_ASSOC, &value);
msr->unlock();
return value;
}
};

struct MBRCounter : public AbstractRawCounter
{
SafeMsrHandle * msr;
MBRCounter(SafeMsrHandle * msr_) : msr(msr_){}
uint64 operator() ()
{
msr->lock();
msr->write(IA32_QM_EVTSEL, 0xdead); // TODO: change 0xdead to MBR event value
uint64 value = 0;
msr->read(IA32_PQR_ASSOC, &value);
msr->unlock();
return value;
}
};

private:

#ifdef _MSC_VER
HANDLE UpdateThread;
HANDLE CounterMutex;
#else
pthread_t UpdateThread;
pthread_mutex_t CounterMutex;
#endif

PCM_Util::Mutex CounterMutex;

AbstractRawCounter * raw_counter;
uint64 extended_value;
uint64 last_raw_value;

CounterWidthExtender(); // forbidden
CounterWidthExtender(CounterWidthExtender&); // forbidden
CounterWidthExtender & operator = (const CounterWidthExtender &); // forbidden

uint64 internal_read()
{
if (this==NULL) return 0; // to make security check happy
uint64 result = 0, new_raw_value = 0;
#ifdef _MSC_VER
WaitForSingleObject(CounterMutex,INFINITE);
#else
pthread_mutex_lock(&CounterMutex);
#endif
CounterMutex.lock();

new_raw_value = (*raw_counter)();
if(new_raw_value < last_raw_value)
{
@@ -118,11 +147,8 @@ class CounterWidthExtender
last_raw_value = new_raw_value;

result = extended_value;
#ifdef _MSC_VER
ReleaseMutex(CounterMutex);
#else
pthread_mutex_unlock(&CounterMutex);
#endif

CounterMutex.unlock();
return result;
}

@@ -133,22 +159,18 @@ class CounterWidthExtender
extended_value = last_raw_value;

#ifdef _MSC_VER
CounterMutex = CreateMutex(NULL,FALSE,NULL);
UpdateThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)WatchDogProc,this,0,NULL);
#else
pthread_mutex_init(&CounterMutex, NULL);
pthread_create(&UpdateThread, NULL, WatchDogProc, this);
#endif
}
~CounterWidthExtender()
virtual ~CounterWidthExtender()
{
#ifdef _MSC_VER
TerminateThread(UpdateThread,0);
CloseHandle(UpdateThread);
CloseHandle(CounterMutex);
#else
pthread_cancel(UpdateThread);
pthread_mutex_destroy(&CounterMutex);
#endif
if(raw_counter) delete raw_counter;
}
23 changes: 7 additions & 16 deletions winpmem/winpmem.cpp
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ unsigned int WinPmem::read32(__int64 start)
DWORD bytes_read = 0;
large_start.QuadPart = start;

if(0xFFFFFFFF == SetFilePointer(fd_, large_start.LowPart,
if(0xFFFFFFFF == SetFilePointer(fd_, (LONG)large_start.LowPart,
&large_start.HighPart, FILE_BEGIN))
{
LogError(TEXT("Failed to seek in the pmem device.\n"));
@@ -54,7 +54,7 @@ unsigned int WinPmem::read32(__int64 start)

unsigned int result = 0;

if(!ReadFile(fd_, &result, sizeof(unsigned int), &bytes_read, NULL))
if(!ReadFile(fd_, &result, (DWORD)sizeof(unsigned int), &bytes_read, NULL))
{
LogError(TEXT("Failed to Read memory."));
goto error;
@@ -79,23 +79,17 @@ int WinPmem::set_acquisition_mode(__int32 mode) {
};

WinPmem::WinPmem():
fd_(INVALID_HANDLE_VALUE),
buffer_size_(1024*1024),
buffer_(NULL),
suppress_output(FALSE),
fd_(INVALID_HANDLE_VALUE),
out_fd_(INVALID_HANDLE_VALUE),
service_name(PMEM_SERVICE_NAME) {
buffer_ = new char[buffer_size_];
_tcscpy_s(last_error, TEXT(""));
max_physical_memory_ = 0;
}

WinPmem::~WinPmem() {
if (fd_ != INVALID_HANDLE_VALUE) {
CloseHandle(fd_);
};

if (buffer_) {
delete [] buffer_;
}
}

@@ -174,9 +168,9 @@ int WinPmem::install_driver(bool delete_driver) {
if(fd_ == INVALID_HANDLE_VALUE) {
LogError(TEXT("Can not open raw device."));
status = -1;
};

status = 1;
}
else
status = 1;

service_error:
CloseServiceHandle(service);
@@ -206,8 +200,5 @@ int WinPmem::uninstall_driver() {
Log(TEXT("Driver Unloaded.\n"));

return 1;

CloseServiceHandle(scm);
return 0;
}

2 changes: 0 additions & 2 deletions winpmem/winpmem.h
Original file line number Diff line number Diff line change
@@ -37,8 +37,6 @@ class WinPmem {
// The file handle to the image file.
HANDLE out_fd_;
TCHAR *service_name;
char *buffer_;
size_t buffer_size_;
TCHAR driver_filename[MAX_PATH];

// This is the maximum size of memory calculated.

0 comments on commit 382e64a

Please sign in to comment.