public void StartProfiling(ProfilerSession session) { OnStatusUpdated(ProfilerState.Deploying, "Deploying the profiler and your session information to the device..."); InstallProfiler(); GenerateProfilerTasks(session); InstallProfilerTasks(); OnStatusUpdated(ProfilerState.Profiling, "Connecting to profiler..."); ConnectProfiler(); OnStatusUpdated(ProfilerState.Profiling, "Profiling..."); LaunchProfiler(session.TargetApp.RemoteApplication.ProductID); }
private static void GenerateProfilerTasks(ProfilerSession session) { var tasks = session.GenerateTasks(); XmlSerializer serializer = new XmlSerializer(typeof(ProfilingTasksType)); if (!Directory.Exists(WPTOOLS_PROFILER_DATA_PATH)) { Directory.CreateDirectory(WPTOOLS_PROFILER_DATA_PATH); } using (var writer = new StreamWriter(Path.Combine(WPTOOLS_PROFILER_DATA_PATH, WPTOOLS_PROFILER_DATA_FILE))) { serializer.Serialize(writer, tasks); writer.Flush(); writer.Close(); } }
private static void InitPredefinedScenarios() { // TODO: there has to be a better way (xml file?) to define these sessions _predefinedScenarios["Standard"] = new ProfilerSession(); var standard = _predefinedScenarios["Standard"]; standard.KernelFlags["PROC_THREAD"].IsEnabled = true; standard.KernelFlags["LOADER"].IsEnabled = true; standard.KernelFlags["DISK_IO"].IsEnabled = true; standard.KernelFlags["DISK_IO_INIT"].IsEnabled = true; standard.KernelFlags["HARD_FAULTS"].IsEnabled = true; standard.KernelFlags["PROFILE"].IsEnabled = true; standard.KernelFlags["MEMORY"].IsEnabled = true; standard.KernelFlags["CSWITCH"].IsEnabled = true; standard.KernelFlags["DISPATCHER"].IsEnabled = true; standard.KernelFlags["INTERRUPT"].IsEnabled = true; standard.KernelStackFlags["PROC_THREAD"].IsEnabled = true; standard.KernelStackFlags["LOADER"].IsEnabled = true; standard.KernelStackFlags["DISK_IO"].IsEnabled = true; standard.KernelStackFlags["HARD_FAULTS"].IsEnabled = true; standard.KernelStackFlags["PROFILE"].IsEnabled = true; standard.KernelStackFlags["CSWITCH"].IsEnabled = true; standard.KernelStackFlags["INTERRUPT"].IsEnabled = true; standard.Providers["3rd Party Developer Provider"].IsEnabled = true; standard.Providers["TaskHost"].IsEnabled = true; standard.Providers["Microsoft-Windows-D3D10Level9"].IsEnabled = true; standard.Providers["Microsoft-Windows-DirectWrite"].IsEnabled = true; standard.Providers["Microsoft-Windows-Direct3D11"].IsEnabled = true; standard.Providers["Microsoft-WindowsMobile-Compositor"].IsEnabled = true; standard.Providers["DX"].IsEnabled = true; standard.Providers["Microsoft-Windows-DXGI"].IsEnabled = true; standard.Providers["Microsoft-WindowsPhone-Silverlight"].IsEnabled = true; standard.Providers["Microsoft-Windows-WinHttp"].IsEnabled = true; standard.Providers["Microsoft-WindowsPhone-Input"].IsEnabled = true; _predefinedScenarios["Custom"] = new ProfilerSession(isCustom: true); }
private static void InitPredefinedScenarios() { // TODO: there has to be a better way (xml file?) to define these sessions _predefinedScenarios["Standard"] = new ProfilerSession(); var standard = _predefinedScenarios["Standard"]; standard.KernelFlags["PROC_THREAD"].IsEnabled = true; standard.KernelFlags["LOADER"].IsEnabled = true; standard.KernelFlags["DISK_IO"].IsEnabled = true; standard.KernelFlags["DISK_IO_INIT"].IsEnabled = true; standard.KernelFlags["HARD_FAULTS"].IsEnabled = true; standard.KernelFlags["PROFILE"].IsEnabled = true; standard.KernelFlags["MEMORY"].IsEnabled = true; standard.KernelFlags["CSWITCH"].IsEnabled = true; standard.KernelFlags["DISPATCHER"].IsEnabled = true; standard.KernelFlags["INTERRUPT"].IsEnabled = true; standard.KernelStackFlags["PROC_THREAD"].IsEnabled = true; standard.KernelStackFlags["LOADER"].IsEnabled = true; standard.KernelStackFlags["DISK_IO"].IsEnabled = true; standard.KernelStackFlags["HARD_FAULTS"].IsEnabled = true; standard.KernelStackFlags["PROFILE"].IsEnabled = true; standard.KernelStackFlags["CSWITCH"].IsEnabled = true; standard.KernelStackFlags["INTERRUPT"].IsEnabled = true; standard.Providers["3rd Party Developer Provider"].IsEnabled = true; standard.Providers["TaskHost"].IsEnabled = true; standard.Providers["Microsoft-Windows-D3D10Level9"].IsEnabled = true; standard.Providers["Microsoft-Windows-DirectWrite"].IsEnabled = true; standard.Providers["Microsoft-Windows-Direct3D11"].IsEnabled = true; standard.Providers["Microsoft-WindowsMobile-Compositor"].IsEnabled = true; standard.Providers["DX"].IsEnabled = true; standard.Providers["Microsoft-Windows-DXGI"].IsEnabled = true; standard.Providers["Microsoft-WindowsPhone-Silverlight"].IsEnabled = true; standard.Providers["Microsoft-Windows-WinHttp"].IsEnabled = true; standard.Providers["Microsoft-WindowsPhone-Input"].IsEnabled = true; _predefinedScenarios["Custom"] = new ProfilerSession(isCustom: true); }
private static void GenerateProfilerTasks(ProfilerSession session) { var tasks = session.GenerateTasks(); XmlSerializer serializer = new XmlSerializer(typeof(ProfilingTasksType)); if (!Directory.Exists(WPTOOLS_PROFILER_DATA_PATH)) Directory.CreateDirectory(WPTOOLS_PROFILER_DATA_PATH); using (var writer = new StreamWriter(Path.Combine(WPTOOLS_PROFILER_DATA_PATH, WPTOOLS_PROFILER_DATA_FILE))) { serializer.Serialize(writer, tasks); writer.Flush(); writer.Close(); } }
public void StartProfiling(ProfilerSession session) { OnStatusUpdated(ProfilerState.Deploying, "Deploying the profiler and your session information to the device..."); InstallProfiler(); GenerateProfilerTasks(session); InstallProfilerTasks(); OnStatusUpdated(ProfilerState.Profiling, "Connecting to profiler..."); ConnectProfiler(); OnStatusUpdated(ProfilerState.Profiling, "Profiling..."); LaunchProfiler(session.TargetApp.RemoteApplication.ProductID); }