Browse Source

- bug fixes

- added "ProfileExecutable" dialog
- replaced ProfilerService with ProfilerRunner

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3887 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Siegfried Pammer 17 years ago
parent
commit
b2d9c35ccc
  1. 4
      src/AddIns/Misc/Profiler/Controller/Profiler.cs
  2. 2
      src/AddIns/Misc/Profiler/Frontend/AddIn/AddIn.csproj
  3. 4
      src/AddIns/Misc/Profiler/Frontend/AddIn/ICSharpCode.Profiler.AddIn.addin
  4. 2
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/ProfileExecutable.cs
  5. 72
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/ProfileProject.cs
  6. 45
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml
  7. 129
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml.cs
  8. 4
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/OptionsPanels/GeneralOptionsPanel.xaml
  9. 121
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/ProfilerRunner.cs
  10. 91
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/ProfilerService.cs
  11. 2
      src/AddIns/Misc/Profiler/Frontend/Gui/Window1.xaml.cs
  12. 36
      src/AddIns/Misc/Profiler/Profiler.sln

4
src/AddIns/Misc/Profiler/Controller/Profiler.cs

@ -203,7 +203,7 @@ namespace ICSharpCode.Profiler.Controller @@ -203,7 +203,7 @@ namespace ICSharpCode.Profiler.Controller
}
/// <summary>
/// Creates a new profiler using the path to an executable to profile and a data provider.
/// Creates a new profiler using the path to an executable to profile and a data writer.
/// </summary>
public Profiler(string pathToExecutable, IProfilingDataWriter dataWriter)
: this(new ProcessStartInfo(pathToExecutable), dataWriter)
@ -215,7 +215,7 @@ namespace ICSharpCode.Profiler.Controller @@ -215,7 +215,7 @@ namespace ICSharpCode.Profiler.Controller
}
/// <summary>
/// Creates a new profiler using a process start info of an executable and a data provider.
/// Creates a new profiler using a process start info of an executable and a data writer.
/// </summary>
public Profiler(ProcessStartInfo info, IProfilingDataWriter dataWriter)
{

2
src/AddIns/Misc/Profiler/Frontend/AddIn/AddIn.csproj

@ -107,7 +107,7 @@ @@ -107,7 +107,7 @@
<DependentUpon>GeneralOptionsPanel.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\ProfilerService.cs" />
<Compile Include="Src\ProfilerRunner.cs" />
<Compile Include="Src\Views\ProfilerView.xaml.cs">
<DependentUpon>ProfilerView.xaml</DependentUpon>
</Compile>

4
src/AddIns/Misc/Profiler/Frontend/AddIn/ICSharpCode.Profiler.AddIn.addin

@ -19,11 +19,11 @@ @@ -19,11 +19,11 @@
label="Profile current project ..."
/>
</ComplexCondition>
<!-- <MenuItem
<MenuItem
id="ProfileExecutable"
class="ICSharpCode.Profiler.AddIn.Commands.ProfileExecutable"
label="Select executable to profile"
/>-->
/>
</Path>
<Path name = "/SharpDevelop/Workbench/DisplayBindings">

2
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/ProfileExecutable.cs

@ -33,7 +33,7 @@ namespace ICSharpCode.Profiler.AddIn.Commands @@ -33,7 +33,7 @@ namespace ICSharpCode.Profiler.AddIn.Commands
{
ProfileExecutableForm form = new ProfileExecutableForm();
form.Show();
form.ShowDialog();
}
}
}

72
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Commands/ProfileProject.cs

@ -5,12 +5,14 @@ @@ -5,12 +5,14 @@
// <version>$Revision$</version>
// </file>
using ICSharpCode.Profiler.Controller.Data;
using System;
using System.Globalization;
using System.IO;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.Profiler.AddIn.Views;
using ICSharpCode.Profiler.Controller.Data;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Project;
@ -30,26 +32,58 @@ namespace ICSharpCode.Profiler.AddIn.Commands @@ -30,26 +32,58 @@ namespace ICSharpCode.Profiler.AddIn.Commands
/// </summary>
public override void Run()
{
string outputPath;
Profiler profiler = ProfilerService.RunCurrentProject(out outputPath);
IProject selectedProject = ProjectService.CurrentProject;
if (profiler != null) {
profiler.SessionEnded += delegate {
string title = Path.GetFileName(outputPath);
profiler.DataWriter.Close();
ProfilingDataProvider provider = new ProfilingDataSQLiteProvider(outputPath);
WorkbenchSingleton.CallLater(20,
() => {
WorkbenchSingleton.Workbench.ShowView(new WpfViewer(provider, title));
FileProjectItem file = new FileProjectItem(selectedProject, ItemType.Content, "ProfilingSessions\\" + title);
ProjectService.AddProjectItem(selectedProject, file);
ProjectBrowserPad.Instance.ProjectBrowserControl.RefreshView();
selectedProject.Save();
}
);
AbstractProject currentProj = ProjectService.CurrentProject as AbstractProject;
string filePart = @"ProfilingSessions\Session" +
DateTime.Now.ToString("yyyyMMdd_HHmmss", CultureInfo.InvariantCulture) +
".sdps";
string path = Path.Combine(currentProj.Directory, filePart);
Directory.CreateDirectory(Path.GetDirectoryName(path));
IProfilingDataWriter writer = new ProfilingDataSQLiteWriter(path);
ProfilerRunner runner = CreateRunner(writer);
if (runner != null) {
runner.RunFinished += delegate {
string title = Path.GetFileName(path);
ProfilingDataProvider provider = new ProfilingDataSQLiteProvider(path);
Action updater = () => {
WorkbenchSingleton.Workbench.ShowView(new WpfViewer(provider, title));
FileProjectItem file = new FileProjectItem(currentProj, ItemType.Content, "ProfilingSessions\\" + title);
ProjectService.AddProjectItem(currentProj, file);
ProjectBrowserPad.Instance.ProjectBrowserControl.RefreshView();
currentProj.Save();
};
WorkbenchSingleton.CallLater(20, updater);
};
}
runner.Run();
}
static ProfilerRunner CreateRunner(IProfilingDataWriter writer)
{
AbstractProject currentProj = ProjectService.CurrentProject as AbstractProject;
if (currentProj == null)
return null;
if (!currentProj.IsStartable) {
MessageService.ShowError("This project cannot be started, please select a startable project for Profiling!");
return null;
}
if (!File.Exists(currentProj.OutputAssemblyFullPath)) {
MessageService.ShowError("This project cannot be started because the executable file was not found, " +
"please ensure that the project and all its depencies are built correctly!");
return null;
}
ProfilerRunner runner = new ProfilerRunner(currentProj.CreateStartInfo(), true, writer);
return runner;
}
}
}

45
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml

@ -1,34 +1,19 @@ @@ -1,34 +1,19 @@
<Window x:Class="ICSharpCode.Profiler.AddIn.Dialogs.ProfileExecutableForm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="510" Width="621" Title="Profile executable">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<Expander Header="General Information" Name="expander1">
<Grid Height="103">
<Label HorizontalAlignment="Left" Margin="6,6,0,0" Name="label1" Width="112" Height="24" VerticalAlignment="Top">Path to executable:</Label>
<TextBox Margin="124,6,50,0" Name="textBox1" Height="26" VerticalAlignment="Top" />
<Button Height="26" Margin="0,6,6,0" Name="button1" VerticalAlignment="Top" HorizontalAlignment="Right" Width="38">...</Button>
<Label Height="26" HorizontalAlignment="Left" Margin="6,36,0,0" Name="label2" VerticalAlignment="Top" Width="112">Working directory:</Label>
<TextBox Height="26" Margin="124,36,50,0" Name="textBox2" VerticalAlignment="Top" />
<Button Height="26" HorizontalAlignment="Right" Margin="0,36,6,0" Name="button2" VerticalAlignment="Top" Width="38">...</Button>
<Label Height="26" HorizontalAlignment="Left" Margin="6,68,0,0" Name="label3" VerticalAlignment="Top" Width="112">Arguments:</Label>
<TextBox Height="26" Margin="124,68,6,0" Name="textBox3" VerticalAlignment="Top" />
</Grid>
</Expander>
<Expander Header="Select Profiler Mode" Name="expander2">
<Grid Height="60">
<RadioButton HorizontalAlignment="Left" Margin="6,6,0,0" Name="radioButton1" Width="175" Height="20" VerticalAlignment="Top">Performance Profiling</RadioButton>
<RadioButton HorizontalAlignment="Left" Margin="6,0,0,6" Name="radioButton2" Width="175" Height="22" VerticalAlignment="Bottom" IsEnabled="False">Memory Profiling</RadioButton>
</Grid>
</Expander>
<Expander Header="Choose Output" Name="expander3">
<Grid Height="226">
<RadioButton Margin="6,6,134,201" Name="radioButton3">Use custom directory:</RadioButton>
<TextBox Height="26" Margin="21,31,0,0" Name="textBox4" VerticalAlignment="Top" HorizontalAlignment="Left" Width="526" IsEnabled="{Binding IsChecked, ElementName=radioButton3}" />
<Button Height="26" HorizontalAlignment="Right" Margin="0,31,6,0" Name="button3" VerticalAlignment="Top" Width="38">...</Button>
</Grid>
</Expander>
</StackPanel>
</ScrollViewer>
Height="195" Width="609" Title="Profile executable" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow" ShowInTaskbar="False" ResizeMode="NoResize">
<Grid Background="#FFD4D0C8">
<Label HorizontalAlignment="Left" Margin="12,46,0,0" Width="145" Height="24" VerticalAlignment="Top">Path to executable:</Label>
<TextBox Margin="163,44,56,0" Name="txtExePath" Height="26" VerticalAlignment="Top" />
<Button Height="26" Margin="0,45.138,12,0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="38" Click="btnSelectFileClick">...</Button>
<Label Height="26" HorizontalAlignment="Left" Margin="12,76,0,0" VerticalAlignment="Top" Width="145">Working directory:</Label>
<TextBox Height="26" Margin="163,77,56,0" Name="txtWorkingDir" VerticalAlignment="Top" />
<Button Height="26" HorizontalAlignment="Right" Margin="0,76,12,0" VerticalAlignment="Top" Width="38" Click="btnSelectDirClick">...</Button>
<Label Height="26" HorizontalAlignment="Left" Margin="12,108,0,0" VerticalAlignment="Top" Width="145">Command-Line Arguments:</Label>
<TextBlock Height="36" Margin="12,12,12,0" VerticalAlignment="Top"
Text="Select the path of the executable you want to profile. Optionally you can specify working directory and command line arguments to start the process." TextWrapping="Wrap" />
<TextBox Margin="163,109,12,0" Name="txtArgs" VerticalAlignment="Top" Height="24" />
<Button Height="27" HorizontalAlignment="Left" Margin="173,0,0,6" VerticalAlignment="Bottom" Width="105" Click="btnStartClick">Start Profiling</Button>
<Button Height="27" Margin="0,0,204,6" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="99" Click="btnCancelClick">Cancel</Button>
</Grid>
</Window>

129
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Dialogs/ProfileExecutableForm.xaml.cs

@ -1,27 +1,114 @@ @@ -1,27 +1,114 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ICSharpCode.Core;
using ICSharpCode.Profiler.AddIn.OptionsPanels;
using ICSharpCode.Profiler.AddIn.Views;
using ICSharpCode.Profiler.Controller.Data;
using ICSharpCode.SharpDevelop.Gui;
using Microsoft.Win32;
namespace ICSharpCode.Profiler.AddIn.Dialogs
{
/// <summary>
/// Interaktionslogik für ProfileExecutableForm.xaml
/// </summary>
public partial class ProfileExecutableForm : Window
{
public ProfileExecutableForm()
{
InitializeComponent();
}
}
/// <summary>
/// Interaktionslogik für ProfileExecutableForm.xaml
/// </summary>
public partial class ProfileExecutableForm : Window
{
public ProfileExecutableForm()
{
InitializeComponent();
}
void btnCancelClick(object sender, RoutedEventArgs e)
{
this.Close();
}
void btnStartClick(object sender, RoutedEventArgs e)
{
try {
if (!File.Exists(txtExePath.Text))
throw new FileNotFoundException("file '" + txtExePath.Text + "' was not found!");
if (!Directory.Exists(txtWorkingDir.Text))
throw new DirectoryNotFoundException("directory '" + txtWorkingDir.Text + "' was not found!");
string outputPath = Path.Combine(
Path.GetDirectoryName(txtExePath.Text),
@"ProfilingSessions\Session" +
DateTime.Now.ToString("yyyyMMdd_HHmmss", CultureInfo.InvariantCulture) + ".sdps");
Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
var runner = CreateRunner(txtExePath.Text, txtWorkingDir.Text, txtArgs.Text, new ProfilingDataSQLiteWriter(outputPath));
if (runner != null) {
runner.RunFinished += delegate {
string title = Path.GetFileName(outputPath);
ProfilingDataProvider provider = new ProfilingDataSQLiteProvider(outputPath);
WorkbenchSingleton.CallLater(20, () => WorkbenchSingleton.Workbench.ShowView(new WpfViewer(provider, title)));
};
runner.Run();
}
this.Close();
} catch (ArgumentNullException) {
MessageService.ShowError("Invalid data, please try again!");
} catch (FileNotFoundException ex) {
MessageService.ShowError(ex.Message);
} catch (DirectoryNotFoundException ex2) {
MessageService.ShowError(ex2.Message);
} catch (Exception ex3) {
MessageService.ShowError(ex3);
}
}
void btnSelectFileClick(object sender, RoutedEventArgs e)
{
var dlg = new OpenFileDialog();
dlg.Filter = "Programs|*.exe|All files|*.*";
dlg.DefaultExt = ".exe";
if (!(dlg.ShowDialog() ?? false))
return;
txtExePath.Text = dlg.FileName;
if (File.Exists(dlg.FileName))
txtWorkingDir.Text = Path.GetDirectoryName(dlg.FileName);
}
void btnSelectDirClick(object sender, RoutedEventArgs e)
{
var dlg = new System.Windows.Forms.FolderBrowserDialog();
if (!(dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK))
return;
txtWorkingDir.Text = dlg.SelectedPath;
}
ProfilerRunner CreateRunner(string path, string workingDirectory, string args, IProfilingDataWriter writer)
{
if (args == null)
throw new ArgumentNullException("args");
if (workingDirectory == null)
throw new ArgumentNullException("workingdirectory");
if (path == null)
throw new ArgumentNullException("path");
if (!File.Exists(path))
throw new FileNotFoundException("file '" + path + "' was not found!");
if (!Directory.Exists(workingDirectory))
throw new DirectoryNotFoundException("directory '" + workingDirectory + "' was not found!");
ProcessStartInfo info = new ProcessStartInfo(path, args);
info.WorkingDirectory = workingDirectory;
ProfilerRunner runner = new ProfilerRunner(info, true, writer);
return runner;
}
}
}

4
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/OptionsPanels/GeneralOptionsPanel.xaml

@ -5,9 +5,9 @@ @@ -5,9 +5,9 @@
<GroupBox Header="Data Collection" Margin="0,0,0,0" Name="groupBox1">
<Grid>
<CheckBox Height="14" Margin="6,6,6,0" Name="chkEnableDC" VerticalAlignment="Top">Only collect data at the end of the session.</CheckBox>
<Slider Margin="161,26,94,0" Name="slSharedMemorySize" IsDirectionReversed="False" TickPlacement="Both" Minimum="64" Maximum="512" TickFrequency="64" SmallChange="64" LargeChange="128" IsSnapToTickEnabled="True" />
<Slider Margin="170,26,94,0" Name="slSharedMemorySize" IsDirectionReversed="False" TickPlacement="Both" Minimum="64" Maximum="512" TickFrequency="64" SmallChange="64" LargeChange="128" IsSnapToTickEnabled="True" />
<Label Margin="6,26,0,0" Name="label1" Height="33.723" HorizontalAlignment="Left" VerticalAlignment="Top" Width="163">Size of temporary storage file:</Label>
<TextBlock HorizontalAlignment="Right" Margin="0,35,24,5" Width="64" Text="{Binding Value, ElementName=slSharedMemorySize, StringFormat=\{0\} MB}" />
<TextBlock HorizontalAlignment="Left" Margin="250,35,24,5" Width="50" Text="{Binding Value, ElementName=slSharedMemorySize, StringFormat=\{0\} MB}" />
</Grid>
</GroupBox>
</Grid>

121
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/ProfilerRunner.cs

@ -0,0 +1,121 @@ @@ -0,0 +1,121 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Siegfried Pammer" email="sie_pam@gmx.at"/>
// <version>$Revision$</version>
// </file>
using ICSharpCode.Core;
using System;
using System.Diagnostics;
using ICSharpCode.Profiler.AddIn.OptionsPanels;
using ICSharpCode.Profiler.Controller.Data;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Profiler.AddIn
{
/// <summary>
/// Description of ProfilerRunner.
/// </summary>
public class ProfilerRunner
{
public event EventHandler RunFinished;
protected virtual void OnRunFinished(EventArgs e)
{
if (RunFinished != null) {
RunFinished(this, e);
}
}
Controller.Profiler profiler;
IProfilingDataWriter writer;
TempFileDatabase database;
public ICSharpCode.Profiler.Controller.Profiler Profiler {
get { return profiler; }
}
/// <summary>
/// Creates a new ProfilerRunner using a ProcessStartInfo and a data writer.
/// </summary>
public ProfilerRunner(ProcessStartInfo startInfo, bool useTempFileDatabase, IProfilingDataWriter writer)
{
if (writer == null)
throw new ArgumentNullException("writer");
if (startInfo == null)
throw new ArgumentNullException("startInfo");
if (useTempFileDatabase) {
this.database = new TempFileDatabase();
this.writer = writer;
this.profiler = new Controller.Profiler(startInfo, this.database.GetWriter());
} else {
this.database = null;
this.writer = writer;
this.profiler = new Controller.Profiler(startInfo, writer);
}
this.profiler.ProfilerOptions = General.CreateProfilerOptions();
this.profiler.RegisterFailed += delegate { MessageService.ShowError("Could not register the profiler into COM Registry. Cannot start profiling!"); };
this.profiler.DeregisterFailed += delegate { MessageService.ShowError("Could not unregister the profiler from COM Registry!"); };
this.profiler.OutputUpdated += delegate { SetOutputText(profiler.ProfilerOutput); };
this.profiler.SessionEnded += delegate { FinishSession(); };
}
void FinishSession()
{
profiler.DataWriter.Close();
if (database != null) {
database.WriteTo(writer, progress => true); // TODO : change default impl to good user interface notification
writer.Close();
database.Close();
} else {
writer.Close();
}
OnRunFinished(EventArgs.Empty);
}
public void Run()
{
profiler.Start();
}
public void Stop()
{
throw new NotImplementedException();
}
#region MessageView Management
static MessageViewCategory profileCategory = null;
static void EnsureProfileCategory()
{
if (profileCategory == null) {
MessageViewCategory.Create(ref profileCategory, "Profile", "Profile");
}
}
public static void SetOutputText(string text)
{
EnsureProfileCategory();
profileCategory.SetText(text);
}
public static void AppendOutputText(string text)
{
EnsureProfileCategory();
profileCategory.AppendText(text);
}
public static void AppendOutputLine(string text)
{
EnsureProfileCategory();
profileCategory.AppendLine(text);
}
#endregion
}
}

91
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/ProfilerService.cs

@ -1,91 +0,0 @@ @@ -1,91 +0,0 @@
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using ICSharpCode.Core;
using ICSharpCode.Profiler.AddIn.OptionsPanels;
using ICSharpCode.Profiler.Controller;
using ICSharpCode.Profiler.Controller.Data;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.Profiler.AddIn
{
/// <summary>
/// Provides methods for initialisation and control of the current profiling session.
/// </summary>
public static class ProfilerService
{
public static Profiler.Controller.Profiler RunCurrentProject(out string profilerSessionFilePath)
{
AbstractProject currentProj = ProjectService.CurrentProject as AbstractProject;
profilerSessionFilePath = Path.Combine(currentProj.Directory, @"ProfilingSessions\Session" + DateTime.Now.ToString("yyyyMMdd_HHmmss", CultureInfo.InvariantCulture) + ".sdps");
Directory.CreateDirectory(Path.GetDirectoryName(profilerSessionFilePath));
if (currentProj == null)
return null;
if (!currentProj.IsStartable) {
MessageService.ShowError("This project cannot be started, please select a startable project for Profiling!");
return null;
}
if (!File.Exists(currentProj.OutputAssemblyFullPath)) {
MessageService.ShowError("This project cannot be started because the executable file was not found, " +
"please ensure that the project and all its depencies are built correctly!");
return null;
}
Profiler.Controller.Profiler profiler = InitProfiler(currentProj.CreateStartInfo(), profilerSessionFilePath);
profiler.ProfilerOptions = General.CreateProfilerOptions();
profiler.Start();
return profiler;
}
static Profiler.Controller.Profiler InitProfiler(string path, string outputFilePath)
{
return InitProfiler(new ProcessStartInfo(path), outputFilePath);
}
static Profiler.Controller.Profiler InitProfiler(ProcessStartInfo startInfo, string outputFilePath)
{
Profiler.Controller.Profiler profiler = new Profiler.Controller.Profiler(startInfo, new ProfilingDataSQLiteWriter(outputFilePath));
profiler.RegisterFailed += delegate { MessageService.ShowError("Could not register the profiler into COM Registry. Cannot start profiling!"); };
profiler.DeregisterFailed += delegate { MessageService.ShowError("Could not unregister the profiler from COM Registry!"); };
profiler.OutputUpdated += delegate { SetOutputText(profiler.ProfilerOutput); };
return profiler;
}
static MessageViewCategory profileCategory = null;
static void EnsureProfileCategory()
{
if (profileCategory == null) {
MessageViewCategory.Create(ref profileCategory, "Profile", "Profile");
}
}
public static void SetOutputText(string text)
{
EnsureProfileCategory();
profileCategory.SetText(text);
}
public static void AppendOutputText(string text)
{
EnsureProfileCategory();
profileCategory.AppendText(text);
}
public static void AppendOutputLine(string text)
{
EnsureProfileCategory();
profileCategory.AppendLine(text);
}
}
}

2
src/AddIns/Misc/Profiler/Frontend/Gui/Window1.xaml.cs

@ -90,7 +90,7 @@ namespace ICSharpCode.Profiler.Frontend @@ -90,7 +90,7 @@ namespace ICSharpCode.Profiler.Frontend
string pathToDb = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(typeof(Profiler.Controller.Profiler).Assembly.Location), "output.sdps");
profiler.DataWriter.Close();
ProfilingDataSQLiteWriter writer = new ProfilingDataSQLiteWriter(pathToDb);
this.database.WriteTo(writer, progress => false);
this.database.WriteTo(writer, progress => true);
writer.Close();
this.database.Close();
this.provider = new ProfilingDataSQLiteProvider(pathToDb);

36
src/AddIns/Misc/Profiler/Profiler.sln

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
# SharpDevelop 3.1.0.3821
# SharpDevelop 3.1.0.3882
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5147BA25-8362-481D-8CF9-450096595B7A}"
ProjectSection(SolutionItems) = preProject
TODO.txt = TODO.txt
@ -13,6 +13,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Frontend", "Frontend", "{E0 @@ -13,6 +13,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Frontend", "Frontend", "{E0
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controls", "Frontend\Controls\Controls.csproj", "{BDA49550-5ED1-4C6B-B648-657B2CACD8E0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddIn", "Frontend\AddIn\AddIn.csproj", "{D294A12D-4B38-4F25-9AA6-3D4A6CE26E7B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BenchmarkRunner", "Frontend\BenchmarkRunner\BenchmarkRunner.csproj", "{DBEF953E-F7BC-4D54-8A27-B758EC875C49}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gui", "Frontend\Gui\Gui.csproj", "{FF09FBA1-86DA-4D8D-B549-A4FC70FC5AE9}"
ProjectSection(ProjectDependencies) = postProject
{D294A12D-4B38-4F25-9AA6-3D4A6CE26E7B} = {D294A12D-4B38-4F25-9AA6-3D4A6CE26E7B}
@ -21,25 +27,19 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gui", "Frontend\Gui\Gui.csp @@ -21,25 +27,19 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gui", "Frontend\Gui\Gui.csp
{778BA9AE-EE77-444F-A0C9-D795BB977C1A} = {778BA9AE-EE77-444F-A0C9-D795BB977C1A}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BenchmarkRunner", "Frontend\BenchmarkRunner\BenchmarkRunner.csproj", "{DBEF953E-F7BC-4D54-8A27-B758EC875C49}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddIn", "Frontend\AddIn\AddIn.csproj", "{D294A12D-4B38-4F25-9AA6-3D4A6CE26E7B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controls", "Frontend\Controls\Controls.csproj", "{BDA49550-5ED1-4C6B-B648-657B2CACD8E0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{791AE00B-AD96-410A-AAA8-957DDD83C57A}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmark", "Tests\Benchmark\Benchmark.csproj", "{F09B6132-5DF9-4E63-BA23-EE82D75CD5B9}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnicodeTest", "Tests\UnicodeTest\UnicodeTest.csproj", "{D336926C-6180-4F62-B88D-E366B240127B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "Tests\HelloWorld\HelloWorld.csproj", "{778BA9AE-EE77-444F-A0C9-D795BB977C1A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Profiler.Tests", "Tests\Profiler.Tests\Profiler.Tests.csproj", "{068F9531-5D29-49E0-980E-59982A3A0469}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PauseTest", "Tests\PauseTest\PauseTest.csproj", "{650AEAA0-0678-4A75-A1CC-F46DC4E44D2A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Profiler.Tests", "Tests\Profiler.Tests\Profiler.Tests.csproj", "{068F9531-5D29-49E0-980E-59982A3A0469}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "Tests\HelloWorld\HelloWorld.csproj", "{778BA9AE-EE77-444F-A0C9-D795BB977C1A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnicodeTest", "Tests\UnicodeTest\UnicodeTest.csproj", "{D336926C-6180-4F62-B88D-E366B240127B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmark", "Tests\Benchmark\Benchmark.csproj", "{F09B6132-5DF9-4E63-BA23-EE82D75CD5B9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hook", "Hook\Hook.vcproj", "{68D5EE3B-0C35-4DF1-BD29-6606851A02C1}"
EndProject
@ -173,14 +173,14 @@ Global @@ -173,14 +173,14 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BDA49550-5ED1-4C6B-B648-657B2CACD8E0} = {E06867E9-6942-4DB6-89F5-DE0BF56C44DE}
{D294A12D-4B38-4F25-9AA6-3D4A6CE26E7B} = {E06867E9-6942-4DB6-89F5-DE0BF56C44DE}
{DBEF953E-F7BC-4D54-8A27-B758EC875C49} = {E06867E9-6942-4DB6-89F5-DE0BF56C44DE}
{FF09FBA1-86DA-4D8D-B549-A4FC70FC5AE9} = {E06867E9-6942-4DB6-89F5-DE0BF56C44DE}
{D336926C-6180-4F62-B88D-E366B240127B} = {791AE00B-AD96-410A-AAA8-957DDD83C57A}
{068F9531-5D29-49E0-980E-59982A3A0469} = {791AE00B-AD96-410A-AAA8-957DDD83C57A}
{650AEAA0-0678-4A75-A1CC-F46DC4E44D2A} = {791AE00B-AD96-410A-AAA8-957DDD83C57A}
{778BA9AE-EE77-444F-A0C9-D795BB977C1A} = {791AE00B-AD96-410A-AAA8-957DDD83C57A}
{DBEF953E-F7BC-4D54-8A27-B758EC875C49} = {E06867E9-6942-4DB6-89F5-DE0BF56C44DE}
{D294A12D-4B38-4F25-9AA6-3D4A6CE26E7B} = {E06867E9-6942-4DB6-89F5-DE0BF56C44DE}
{BDA49550-5ED1-4C6B-B648-657B2CACD8E0} = {E06867E9-6942-4DB6-89F5-DE0BF56C44DE}
{F09B6132-5DF9-4E63-BA23-EE82D75CD5B9} = {791AE00B-AD96-410A-AAA8-957DDD83C57A}
{778BA9AE-EE77-444F-A0C9-D795BB977C1A} = {791AE00B-AD96-410A-AAA8-957DDD83C57A}
{650AEAA0-0678-4A75-A1CC-F46DC4E44D2A} = {791AE00B-AD96-410A-AAA8-957DDD83C57A}
{068F9531-5D29-49E0-980E-59982A3A0469} = {791AE00B-AD96-410A-AAA8-957DDD83C57A}
{D336926C-6180-4F62-B88D-E366B240127B} = {791AE00B-AD96-410A-AAA8-957DDD83C57A}
EndGlobalSection
EndGlobal

Loading…
Cancel
Save