private void profileKernelToolStripMenuItem_Click(object sender, EventArgs e) { IntPtr baseAddress; uint size = this.GetKernelModeCodeRange(out baseAddress); _kernelModules = new Dictionary <IntPtr, KernelModule>(); foreach (var module in Windows.GetKernelModules()) { _kernelModules.Add(module.BaseAddress, module); } _profileBase = baseAddress; _profileSize = size; _bucketSizeLog = 6; // 64 byte bucket size _bucketSize = (uint)(2 << (_bucketSizeLog - 1)); _profileHandle = ProfileHandle.Create( null, baseAddress, size, _bucketSizeLog, KProfileSource.ProfileTime, IntPtr.Zero ); ProfileHandle.SetInterval(KProfileSource.ProfileTime, 1); // 100 nanoseconds this.LoadKernelSymbols(); }
/// <summary> /// Initializes a new instance. /// </summary> /// <param name="profile"></param> /// <param name="metadata"></param> public ProfileCommandHandle(ProfileHandle profile, CommandDescriptor metadata) { Contract.Requires<ArgumentNullException>(profile != null); Contract.Requires<ArgumentNullException>(metadata != null); Profile = profile; Metadata = metadata; }
private void profileKernelToolStripMenuItem_Click(object sender, EventArgs e) { IntPtr baseAddress; uint size = this.GetKernelModeCodeRange(out baseAddress); _kernelModules = new Dictionary<IntPtr,KernelModule>(); foreach (var module in Windows.GetKernelModules()) _kernelModules.Add(module.BaseAddress, module); _profileBase = baseAddress; _profileSize = size; _bucketSizeLog = 6; // 64 byte bucket size _bucketSize = (uint)(2 << (_bucketSizeLog - 1)); _profileHandle = ProfileHandle.Create( null, baseAddress, size, _bucketSizeLog, KProfileSource.ProfileTime, IntPtr.Zero ); ProfileHandle.SetInterval(KProfileSource.ProfileTime, 1); // 100 nanoseconds this.LoadKernelSymbols(); }
public async Task<ProfileRef> ProfileToRef(IContext context, ProfileHandle profile) { return new ProfileRef() { Uri = await profile.GetUri(profileManager, context), FriendlyUri = await profile.GetFriendlyUri(profileManager, context), Id = profile.Metadata.Id, }; }