Hi @Issam Khalil ,
Is this just a way to read the current counter value on the core the hardware is running on? Or is this really a per-thread counter?
According to another function EnableThreadProfiling:
To profile hardware performance counters, you need a driver to configure the counters. The performance counters are configured globally for the system, so every thread has access to the same hardware counter data. The counters must be configured before you enable profiling. For information on configuring hardware performance counters, see the KeSetHardwareCounterConfiguration function in the Windows Driver Kit (WDK).
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.