What syscalls should I use on Windows to obtain CPU event counters?
Perfect for me would be something close to Linux's perf_event_open syscall.
For example: How would I count L2-cache-misses and branch-misses of some random function f() inside huge application via syscall?