public static int GetInterval(KProfileSource profileSource) { int interval; Win32.NtQueryIntervalProfile(profileSource, out interval).ThrowIf(); return(interval); }
public static void SetInterval(KProfileSource profileSource, int interval) { NtStatus status; if ((status = Win32.NtSetIntervalProfile(interval, profileSource)) >= NtStatus.Error) { Win32.Throw(status); } }
public static int GetInterval(KProfileSource profileSource) { NtStatus status; int interval; if ((status = Win32.NtQueryIntervalProfile(profileSource, out interval)) >= NtStatus.Error) { Win32.Throw(status); } return(interval); }
public static ProfileHandle Create( ProcessHandle processHandle, IntPtr rangeBase, uint rangeSize, int bucketSize, KProfileSource profileSource, IntPtr affinity ) { NtStatus status; IntPtr handle; if (bucketSize < 2 || bucketSize > 30) { throw new ArgumentException("Bucket size must be between 2 and 30, inclusive."); } unchecked { uint realBucketSize = (uint)(2 << (bucketSize - 1)); MemoryAlloc buffer = new MemoryAlloc((int)((rangeSize - 1) / realBucketSize + 1) * sizeof(int)); // divide, round up if ((status = Win32.NtCreateProfile( out handle, processHandle ?? IntPtr.Zero, rangeBase, new IntPtr(rangeSize), bucketSize, buffer, buffer.Size, profileSource, affinity )) >= NtStatus.Error) { Win32.Throw(status); } return(new ProfileHandle(handle, true, rangeBase, rangeSize, realBucketSize, buffer)); } }
public static void SetInterval(KProfileSource profileSource, int interval) { Win32.NtSetIntervalProfile(interval, profileSource).ThrowIf(); }