Skip to content

Commit ca637b8

Browse files
AdministratorAdministrator
Administrator
authored and
Administrator
committed
Only sample when UI is busy for more than X ms
1 parent 8aa0ae5 commit ca637b8

11 files changed

+352
-15
lines changed

Source/EXT/jcl/JclSysUtils.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2747,7 +2747,7 @@ procedure InternalExecuteProcessBuffer(var PipeInfo: TPipeInfo; PipeBytesRead: C
27472747

27482748
procedure InternalExecuteReadPipe(var PipeInfo: TPipeInfo; var Overlapped: TOverlapped);
27492749
var
2750-
NullDWORD: PDWORD;
2750+
NullDWORD: ^Cardinal;
27512751
Res: DWORD;
27522752
begin
27532753
NullDWORD := nil;
-4.05 MB
Binary file not shown.
-448 Bytes
Binary file not shown.
Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<ProjectGuid>{5F80A7FF-B0E2-40BB-8486-6ABDC7F21B89}</ProjectGuid>
4+
<MainSource>AsmProfiler_Sampling.dpr</MainSource>
5+
<Base>True</Base>
6+
<Config Condition="'$(Config)'==''">Release</Config>
7+
<TargetedPlatforms>1</TargetedPlatforms>
8+
<AppType>Application</AppType>
9+
<FrameworkType>VCL</FrameworkType>
10+
<ProjectVersion>15.4</ProjectVersion>
11+
<Platform Condition="'$(Platform)'==''">Win32</Platform>
12+
</PropertyGroup>
13+
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
14+
<Base>true</Base>
15+
</PropertyGroup>
16+
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
17+
<Base_Win32>true</Base_Win32>
18+
<CfgParent>Base</CfgParent>
19+
<Base>true</Base>
20+
</PropertyGroup>
21+
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
22+
<Base_Win64>true</Base_Win64>
23+
<CfgParent>Base</CfgParent>
24+
<Base>true</Base>
25+
</PropertyGroup>
26+
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
27+
<Cfg_1>true</Cfg_1>
28+
<CfgParent>Base</CfgParent>
29+
<Base>true</Base>
30+
</PropertyGroup>
31+
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
32+
<Cfg_1_Win32>true</Cfg_1_Win32>
33+
<CfgParent>Cfg_1</CfgParent>
34+
<Cfg_1>true</Cfg_1>
35+
<Base>true</Base>
36+
</PropertyGroup>
37+
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
38+
<Cfg_2>true</Cfg_2>
39+
<CfgParent>Base</CfgParent>
40+
<Base>true</Base>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
43+
<Cfg_2_Win32>true</Cfg_2_Win32>
44+
<CfgParent>Cfg_2</CfgParent>
45+
<Cfg_2>true</Cfg_2>
46+
<Base>true</Base>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Base)'!=''">
49+
<VerInfo_MinorVer>1</VerInfo_MinorVer>
50+
<DCC_MapFile>3</DCC_MapFile>
51+
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
52+
<VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion>
53+
<VerInfo_Release>6</VerInfo_Release>
54+
<Icon_MainIcon>AsmProfiler_Sampling_Icon.ico</Icon_MainIcon>
55+
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
56+
<DCC_UnitSearchPath>..\EXT\jcl\;..\EXT\jvcl\;..\EXT\win32api;..\EXT\gpsync;..\EXT\Virtual Treeview\Source\;..\Src;..\ProfilerResultViewer\;..\DllVersion\;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
57+
<DCC_DcuOutput>.\dcu</DCC_DcuOutput>
58+
<SanitizedProjectName>AsmProfiler_Sampling</SanitizedProjectName>
59+
<VerInfo_Locale>1043</VerInfo_Locale>
60+
<DCC_F>false</DCC_F>
61+
<DCC_E>false</DCC_E>
62+
<DCC_S>false</DCC_S>
63+
<DCC_N>false</DCC_N>
64+
<DCC_K>false</DCC_K>
65+
<VerInfo_Keys>CompanyName=A. Mussche;FileDescription=AsmProfiler (sampling mode);FileVersion=1.1.6.0;InternalName=;LegalCopyright=2007-2016, [email protected];LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;CFBundleExecutable=</VerInfo_Keys>
66+
<DCC_ImageBase>00400000</DCC_ImageBase>
67+
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;VCLTee;$(DCC_Namespace)</DCC_Namespace>
68+
</PropertyGroup>
69+
<PropertyGroup Condition="'$(Base_Win32)'!=''">
70+
<VerInfo_MinorVer>0</VerInfo_MinorVer>
71+
<VerInfo_Release>0</VerInfo_Release>
72+
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
73+
<VerInfo_Locale>1033</VerInfo_Locale>
74+
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
75+
</PropertyGroup>
76+
<PropertyGroup Condition="'$(Base_Win64)'!=''">
77+
<Icon_MainIcon>AsmProfiler_Sampling_Icon.ico</Icon_MainIcon>
78+
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
79+
</PropertyGroup>
80+
<PropertyGroup Condition="'$(Cfg_1)'!=''">
81+
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
82+
<DCC_DebugInformation>false</DCC_DebugInformation>
83+
<DCC_SymbolReferenceInfo>false</DCC_SymbolReferenceInfo>
84+
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
85+
</PropertyGroup>
86+
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
87+
<VerInfo_Build>1</VerInfo_Build>
88+
<VerInfo_Keys>CompanyName=A. Mussche;FileDescription=AsmProfiler (sampling mode);FileVersion=1.1.6.1;InternalName=;LegalCopyright=2007-2016, [email protected];LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
89+
<VerInfo_Locale>1033</VerInfo_Locale>
90+
</PropertyGroup>
91+
<PropertyGroup Condition="'$(Cfg_2)'!=''">
92+
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
93+
<DCC_Optimize>false</DCC_Optimize>
94+
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
95+
</PropertyGroup>
96+
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
97+
<VerInfo_MinorVer>0</VerInfo_MinorVer>
98+
<VerInfo_Release>0</VerInfo_Release>
99+
<VerInfo_Locale>1033</VerInfo_Locale>
100+
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
101+
</PropertyGroup>
102+
<ItemGroup>
103+
<DelphiCompile Include="$(MainSource)">
104+
<MainSource>MainSource</MainSource>
105+
</DelphiCompile>
106+
<DCCReference Include="mcThreadUtils.pas"/>
107+
<DCCReference Include="mcThreadSampler.pas"/>
108+
<DCCReference Include="mcProcessSampler.pas"/>
109+
<DCCReference Include="mcSamplingThread.pas"/>
110+
<DCCReference Include="mcTestThread.pas"/>
111+
<DCCReference Include="mcSamplingResult.pas"/>
112+
<DCCReference Include="ProcessesFrame.pas">
113+
<Form>framProcesses</Form>
114+
<DesignClass>TFrame</DesignClass>
115+
</DCCReference>
116+
<DCCReference Include="LiveViewFrame.pas">
117+
<Form>framLiveView</Form>
118+
<DesignClass>TFrame</DesignClass>
119+
</DCCReference>
120+
<DCCReference Include="ProfilingFrame.pas">
121+
<Form>framProfiling</Form>
122+
<DesignClass>TFrame</DesignClass>
123+
</DCCReference>
124+
<DCCReference Include="SamplingResultsFrame.pas">
125+
<Form>framSamplingResults</Form>
126+
<DesignClass>TFrame</DesignClass>
127+
</DCCReference>
128+
<DCCReference Include="muExactTiming.pas"/>
129+
<DCCReference Include="ResultsForm.pas">
130+
<Form>frmSamplingResults</Form>
131+
</DCCReference>
132+
<DCCReference Include="BaseTreeFrame.pas">
133+
<Form>framBaseTree</Form>
134+
<DesignClass>TFrame</DesignClass>
135+
</DCCReference>
136+
<DCCReference Include="ResultsFunctionOverviewFrame.pas">
137+
<Form>framFunctionOverview</Form>
138+
<DesignClass>TFrame</DesignClass>
139+
</DCCReference>
140+
<DCCReference Include="ResultsDetailedViewFrame.pas">
141+
<Form>framDetailedView</Form>
142+
<DesignClass>TFrame</DesignClass>
143+
</DCCReference>
144+
<DCCReference Include="FunctionListFrame.pas">
145+
<Form>framFunctionList</Form>
146+
<DesignClass>TFrame</DesignClass>
147+
</DCCReference>
148+
<DCCReference Include="ChoiceMainForm.pas">
149+
<Form>frmChoiceMainForm</Form>
150+
</DCCReference>
151+
<DCCReference Include="BaseActionForm.pas">
152+
<Form>frmAction</Form>
153+
</DCCReference>
154+
<DCCReference Include="uOfflineDebugInfo.pas"/>
155+
<DCCReference Include="uResultTypes.pas"/>
156+
<DCCReference Include="frThreadCharts.pas">
157+
<Form>framThreadCharts</Form>
158+
<DesignClass>TFrame</DesignClass>
159+
</DCCReference>
160+
<DCCReference Include="uDllInjection.pas"/>
161+
<DCCReference Include="..\DllVersion\_uAsmProfDllInterface.pas"/>
162+
<DCCReference Include="uDebugUtils.pas"/>
163+
<DCCReference Include="RawStacksFrame.pas">
164+
<Form>framRawStacks</Form>
165+
<DesignClass>TFrame</DesignClass>
166+
</DCCReference>
167+
<DCCReference Include="..\EXT\Virtual Treeview\Source\VirtualTrees.pas"/>
168+
<BuildConfiguration Include="Debug">
169+
<Key>Cfg_2</Key>
170+
<CfgParent>Base</CfgParent>
171+
</BuildConfiguration>
172+
<BuildConfiguration Include="Base">
173+
<Key>Base</Key>
174+
</BuildConfiguration>
175+
<BuildConfiguration Include="Release">
176+
<Key>Cfg_1</Key>
177+
<CfgParent>Base</CfgParent>
178+
</BuildConfiguration>
179+
</ItemGroup>
180+
<ProjectExtensions>
181+
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
182+
<Borland.ProjectType/>
183+
<BorlandProject>
184+
<Delphi.Personality>
185+
<Source>
186+
<Source Name="MainSource">AsmProfiler_Sampling.dpr</Source>
187+
</Source>
188+
<VersionInfo>
189+
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
190+
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
191+
<VersionInfo Name="MajorVer">1</VersionInfo>
192+
<VersionInfo Name="MinorVer">0</VersionInfo>
193+
<VersionInfo Name="Release">0</VersionInfo>
194+
<VersionInfo Name="Build">0</VersionInfo>
195+
<VersionInfo Name="Debug">False</VersionInfo>
196+
<VersionInfo Name="PreRelease">False</VersionInfo>
197+
<VersionInfo Name="Special">False</VersionInfo>
198+
<VersionInfo Name="Private">False</VersionInfo>
199+
<VersionInfo Name="DLL">False</VersionInfo>
200+
<VersionInfo Name="Locale">1043</VersionInfo>
201+
<VersionInfo Name="CodePage">1252</VersionInfo>
202+
</VersionInfo>
203+
<VersionInfoKeys>
204+
<VersionInfoKeys Name="CompanyName"/>
205+
<VersionInfoKeys Name="FileDescription"/>
206+
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
207+
<VersionInfoKeys Name="InternalName"/>
208+
<VersionInfoKeys Name="LegalCopyright"/>
209+
<VersionInfoKeys Name="LegalTrademarks"/>
210+
<VersionInfoKeys Name="OriginalFilename"/>
211+
<VersionInfoKeys Name="ProductName"/>
212+
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
213+
<VersionInfoKeys Name="Comments"/>
214+
</VersionInfoKeys>
215+
<Excluded_Packages>
216+
</Excluded_Packages>
217+
</Delphi.Personality>
218+
<Platforms>
219+
<Platform value="Win32">True</Platform>
220+
<Platform value="Win64">False</Platform>
221+
</Platforms>
222+
</BorlandProject>
223+
<ProjectFileVersion>12</ProjectFileVersion>
224+
</ProjectExtensions>
225+
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
226+
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
227+
</Project>
-476 Bytes
Binary file not shown.
2.19 KB
Binary file not shown.

Source/Sampling/ProcessesFrame.pas

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ interface
44

55
uses
66
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7-
Dialogs, StdCtrls, ExtCtrls, Buttons, ActnList;
7+
Dialogs, StdCtrls, ExtCtrls, Buttons, ActnList, System.Actions;
88

99
type
1010
TLiveViewNotify = procedure(aProcessId: Integer) of object;
@@ -32,11 +32,9 @@ TframProcesses = class(TFrame)
3232
private
3333
FOnProfileItClick: TProfileNotify;
3434
FOnLiveViewClick: TLiveViewNotify;
35-
{ Private declarations }
3635
protected
3736
procedure ProfileItClicked(aProcessId: Integer);
3837
public
39-
{ Public declarations }
4038
procedure AfterConstruction;override;
4139

4240
property OnLiveViewClick: TLiveViewNotify read FOnLiveViewClick write FOnLiveViewClick;

Source/Sampling/ProfilingFrame.dfm

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ object framProfiling: TframProfiling
203203
Left = 0
204204
Top = 236
205205
Width = 618
206-
Height = 67
206+
Height = 93
207207
Align = alTop
208208
Caption = ' Options '
209209
Font.Charset = DEFAULT_CHARSET
@@ -217,7 +217,7 @@ object framProfiling: TframProfiling
217217
Left = 2
218218
Top = 15
219219
Width = 614
220-
Height = 50
220+
Height = 76
221221
Align = alClient
222222
BevelOuter = bvNone
223223
Font.Charset = DEFAULT_CHARSET
@@ -289,11 +289,31 @@ object framProfiling: TframProfiling
289289
Style = csDropDownList
290290
TabOrder = 1
291291
end
292+
object chkSampleWhenUIisBusy: TCheckBox
293+
Left = 100
294+
Top = 52
295+
Width = 381
296+
Height = 17
297+
Caption = 'Only sample when UI is busy for more than ms'
298+
TabOrder = 2
299+
OnClick = chkSampleWhenUIisBusyClick
300+
end
301+
object edtUIWaitTime: TSpinEdit
302+
Left = 326
303+
Top = 50
304+
Width = 53
305+
Height = 22
306+
MaxValue = 1000
307+
MinValue = -1
308+
TabOrder = 3
309+
Value = 50
310+
OnChange = edtUIWaitTimeChange
311+
end
292312
end
293313
end
294314
object Panel1: TPanel
295315
Left = 0
296-
Top = 317
316+
Top = 343
297317
Width = 618
298318
Height = 35
299319
Align = alTop
@@ -432,7 +452,7 @@ object framProfiling: TframProfiling
432452
end
433453
object Panel2: TPanel
434454
Left = 0
435-
Top = 426
455+
Top = 452
436456
Width = 618
437457
Height = 14
438458
Align = alTop
@@ -640,7 +660,7 @@ object framProfiling: TframProfiling
640660
end
641661
object GroupBox4: TGroupBox
642662
Left = 0
643-
Top = 352
663+
Top = 378
644664
Width = 618
645665
Height = 74
646666
Align = alTop
@@ -734,7 +754,7 @@ object framProfiling: TframProfiling
734754
end
735755
object Panel3: TPanel
736756
Left = 0
737-
Top = 303
757+
Top = 329
738758
Width = 618
739759
Height = 14
740760
Align = alTop

0 commit comments

Comments
 (0)