Browse Source

cleaned up profiler code

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5225 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Siegfried Pammer 16 years ago
parent
commit
6cdad57758
  1. 2
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Views/ProfilerView.xaml
  2. 20
      src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Views/ProfilerView.xaml.cs
  3. 2
      src/AddIns/Misc/Profiler/Frontend/Controls/TimeLineControl.cs
  4. 2
      src/AddIns/Misc/Profiler/Hook/Profiler.cpp

2
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Views/ProfilerView.xaml

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Grid.Row="1">
<controls:ExtendedTimeLineControl x:Name="timeLine2" RangeChanged="TimeLineRangeChanged" />
<controls:ExtendedTimeLineControl x:Name="timeLine" RangeChanged="TimeLineRangeChanged" />
</StackPanel>
<ToolBar Height="27" x:Name="toolBar1" VerticalAlignment="Top">
<Menu>

20
src/AddIns/Misc/Profiler/Frontend/AddIn/Src/Views/ProfilerView.xaml.cs

@ -31,10 +31,10 @@ namespace ICSharpCode.Profiler.AddIn.Views @@ -31,10 +31,10 @@ namespace ICSharpCode.Profiler.AddIn.Views
this.provider = provider;
this.timeLine2.IsEnabled = true;
this.timeLine2.Provider = provider;
this.timeLine2.SelectedStartIndex = 0;
this.timeLine2.SelectedEndIndex = provider.DataSets.Count;
this.timeLine.IsEnabled = true;
this.timeLine.Provider = provider;
this.timeLine.SelectedStartIndex = 0;
this.timeLine.SelectedEndIndex = provider.DataSets.Count - 1;
var translation = new SharpDevelopTranslation();
@ -44,7 +44,7 @@ namespace ICSharpCode.Profiler.AddIn.Views @@ -44,7 +44,7 @@ namespace ICSharpCode.Profiler.AddIn.Views
view.Reporter = new ErrorReporter(UpdateErrorList);
view.Provider = provider;
view.Translation = translation;
view.SetRange(this.timeLine2.SelectedStartIndex, this.timeLine2.SelectedEndIndex);
view.SetRange(this.timeLine.SelectedStartIndex, this.timeLine.SelectedEndIndex);
view.ContextMenuOpening += delegate(object sender, ContextMenuEventArgs e) {
object source = (e.OriginalSource is Shape) ? e.OriginalSource : view;
MenuService.CreateContextMenu(source, "/AddIns/Profiler/QueryView/ContextMenu").IsOpen = true;
@ -84,9 +84,9 @@ namespace ICSharpCode.Profiler.AddIn.Views @@ -84,9 +84,9 @@ namespace ICSharpCode.Profiler.AddIn.Views
void DoSelectAll()
{
if (this.timeLine2.IsEnabled) {
this.timeLine2.SelectedStartIndex = 0;
this.timeLine2.SelectedEndIndex = this.timeLine2.Provider.DataSets.Count;
if (this.timeLine.IsEnabled) {
this.timeLine.SelectedStartIndex = 0;
this.timeLine.SelectedEndIndex = this.timeLine.Provider.DataSets.Count - 1;
}
}
@ -98,7 +98,7 @@ namespace ICSharpCode.Profiler.AddIn.Views @@ -98,7 +98,7 @@ namespace ICSharpCode.Profiler.AddIn.Views
void CanDoSelectAll(CanExecuteRoutedEventArgs e)
{
e.CanExecute = this.timeLine2.IsEnabled && this.timeLine2.Provider.DataSets.Count > 0;
e.CanExecute = this.timeLine.IsEnabled && this.timeLine.Provider.DataSets.Count > 0;
}
void CloseButtonClick(object sender, RoutedEventArgs e)
@ -191,7 +191,7 @@ namespace ICSharpCode.Profiler.AddIn.Views @@ -191,7 +191,7 @@ namespace ICSharpCode.Profiler.AddIn.Views
view.Provider = this.provider;
view.Reporter = new ErrorReporter(UpdateErrorList);
view.SetRange(this.timeLine2.SelectedStartIndex, this.timeLine2.SelectedEndIndex);
view.SetRange(this.timeLine.SelectedStartIndex, this.timeLine.SelectedEndIndex);
view.CurrentQuery = query;
view.ShowQueryItems = true;

2
src/AddIns/Misc/Profiler/Frontend/Controls/TimeLineControl.cs

@ -291,7 +291,7 @@ namespace ICSharpCode.Profiler.Controls @@ -291,7 +291,7 @@ namespace ICSharpCode.Profiler.Controls
int TransformToIndex(Point point, out bool valid)
{
int value = (int)Math.Floor(point.X / this.pieceWidth);
valid = (0 <= value && value <= this.valuesList.Count - 1);
valid = (0 >= value && value <= this.valuesList.Count - 1);
return Math.Min(Math.Max(0, value), this.valuesList.Count - 1);
}

2
src/AddIns/Misc/Profiler/Hook/Profiler.cpp

@ -615,7 +615,7 @@ void CProfiler::Rewrite(FunctionID functionID, int type, int nameId) @@ -615,7 +615,7 @@ void CProfiler::Rewrite(FunctionID functionID, int type, int nameId)
byte *codeBuf = 0;
codeBuf = (byte *)allocator->Alloc(length + 64);
codeBuf = (byte *)allocator->Alloc(length + 128);
allocator->Release();
if (codeBuf == nullptr)

Loading…
Cancel
Save