I am trying to read hardware performance counters/PMC in windows 10.
I am using tracelog and xperf commandline to start the trace.
But pmc counter reading is always 0. (Running as Admin)
It was working fine but after restart the pmc count values is always 0. Do I need to activate some service to give access of pmc to xperf/tracelog.
I figured out the problem.
I installed docker containers which require Hyper-V to be enabled.
Xperf and Tracelog cannot access PMC counters if the hypervisor is enabled.
Related
I am currently running Twincat 3.1..4022.16 on Hyper V virtual machine.
I am able to correctly build my project but when activating configuration I am getting realtime startup isolated cpu fail.
Attached is my Realtime setting and the error.
Any leads to solution will be highly appreciated.
I got the following errors when trying to activate my configuration using TwinCAT 4024.10.
Severity
Description
Error
'TwinCAT System' (10000): Sending ams command >> Init4\RTime: Start Interrupt: Ticker started >> AdsError: 4132 (0x1024, RTIME: incompatible software detected) << failed!
Error
'TCRTIME' (200): start of real-time avoided by "HyperV"
Solution
The issue was caused by the fact that I had earlier tried to get Docker working on my laptop. In order to get Docker to work I had to enable a bunch of Hypervisor options. After realizing this I reverted these by doing the following:
Press the windows key and start typing "Turn Windows features on or off"
In the following menu, make sure "Virtual Machine Platform" and "Windows Hypervisor Platform" are deselected. In case either option was selected, deselect it and restart your computer for it to take effect.
I found this on the Beckhoff website:
The runtime environment cannot be started inside a Hyper-V
environment. This refers in particular to virtual Hyper-V machines,
which are run in a privileged Hyper-V machine. As soon as a component
of the computer uses Hyper-V, only the engineering environment (XAE)
can be used on this computer, not the runtime environment (XAR). Apart
from software solutions for virtual machines, you can also use
operating system means (Device Guard, Credential Guard,
virtualization-based security, etc.) or other Hyper-V programs.
Link
Read available number of CPUs from the Target, then change number of Isolated Cores from 0 to any higher number (most cases 1) and decrease number of Cores that are dedicated to Windows.
After that click Set on target.
Here's link to detailed article about Twincat and Virtualization
alltwincat.com/2018/06/14/twincat-virtualization/
This is a supplement to Roald's answer.
If you already deactivated Virtual Machine Platform, Windows Hypervisor Platform and Microsoft Defender Platform Guard and still doesn't work, chances are you have virtualization-based security enabled. You can check it by typing msinfo on windows search box.
To deactivate it, type Core Isolation on the windows search box and deactivate Memory Integrity. Restart the machine and run ms info again to make sure that VBS is off.
Go to Twincat, activate your project and witness a miracle!
If none of the above solutions worked, try to uncheck the below settings in Windows 11:
Privacy & security > Windows security > device security > core isolation > memory integrity >> off
Supplement to Felipe's and Roald's answer: latest offender prohibiting TwinCAT from starting is yet another virtualization feature: Windows Sandbox. Can be turned toggled in the Windows Features dialog accessible from Start->Turn Windows features on or off.
I am planning to get into windows driver development and start to learn windows wdk
But I know that windows blocks loading unsigned drivers and I have to purchase a digital certificate but it's too expensive for me and I won't be developing drivers that I'll distribute to customers now
I'll be only testing on my home computer
I knew that I could turn off the signature enforcement and restart but the problem is that I am not the only one who uses the computer and can't make the test mode on all the time , and need my driver to be running
So when I load the driver in test mode then restart and go back to default settings will the driver load again ? Or I'll have to be running in test mode all the time ?
I mean with loading it permanently that I don't need to boot in test mode every time I want my driver to be running but load it once and return back with the driver running
My current windows is 8.1 64 bit
I recommend you to use a VM to this, thats how I does it. Enter the VM to TEST MODE and also you can attach WinDbg KD to the VM so you will be able to debug your driver. Without being able to debug your driver it will be very hard for you to write drivers and run them.
TESTMODE - https://technet.microsoft.com/en-us/ff553484%28v=vs.96%29?f=255&MSPPError=-2147217396
VM Kernel Debugging - https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/attaching-to-a-virtual-machine--kernel-mode-
Try to disable integrity check - bcdedit /set nointegritychecks on
I am readiing books and articles on Windows internals. I wanted to launch Kernel Debugger in WinDBG in Windows 7 (32 bit) machine. I tried enabling the machine for Debug by setting bcdedit /debug /on.
After restarting the machine, it just hangs. Then turning off the bcdedit /debug /off in safe mode, make my machine work normally. I searched for the cause in the Internet and stopped Skype as suggested in one of the articles that said is one of the cause of hang.
Doing all these still does not make my machine work in Debug mode. Can anyone help me on this?
Its so frustrating that I have books and videos in which they do kernel debugging in so simple way and I am struggling to launch the debugger :)
I guess the problem is your OS is waiting for being debug, you should use a debugger to attach it and you can see why you OS hang when start up and what's going wrong.That's is the meaning of Debugging :)
Before you're very familiar with the kernel debugging,you should install a virtual machine running Windows 7 on it and take every experiment on that.In that case, you wouldn't take the risk of massing up you machine and it's easy to restore fresh snapshot if some thing wrong.you can follow this Instruction:
How to Debug Kernel-Mode Windows
Drivers Using VirtualBox and WinDBG
Emulator not running
I am using windows phone sdk 8.0 but I am unable to run emulator in visual studio 2012, is there any case to run it,
I checked my machine and its SLAT capable...
I tried using various links provided but IT would be great help if any ne give me a direct solution, I check the Hyper-v also not enabling in the windows turn on and off features.
You probably forgot to enable in the BIOS:
Hardware-assisted virtualization.
Second Level Address Translation (SLAT).
Hardware-based Data Execution Prevention (DEP).
or you don't have:
4 GB or more of RAM.
64-bit version of Windows 8 Pro edition or higher.
Based on the wording of your question I'm guessing you have a problem with enabling Hyper-V. Even if your computer is SLAT capable, you still need to enable it along with DEP and hardware-assisted virtualization in the BIOS like Goran said. This procedure is slightly different for AMD and Intel computers. The full information is here in the "Enabling BIOS settings required by Hyper-V" section.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj863509(v=vs.105).aspx
Also just to be sure you don't actually need 4gb of RAM :). I only have 3.
IF you have gone through this whole procedure, sometimes you will still get an error that you are not part of the local Hyper-V administrators group. Just click retry and enter the admin password and everything should be ok.
I have installed Xperf performance analyzer from Windows SDK and captured a trace as described in the documentation using following command:
xperf -on SysProf -stackwalk profile
Still, the stack trace does not contain any callstack data.
My platform is Vista 64b. Are there any special settings or tricks needed to capture callstacks on 64b Windows?
After some more searching I have found one setting:
Set registry value DisablePagingExecutive = 1 and reboot (see Windows Performance Toolkit FAQ).
While this sounds great, it does not seem to help at my system, still no call-stacks.
After contacting Microsoft support their reply was with x64 Vista you can capture only callstacks of x64 native applications, not 32b ones.
Windows 7 seems to have removed the limitation and it works fine on Win 7 x64, at least this says Valve presentation on Xperf.