![embedded從入門到精通系列課程4windows ce5.0mobile調試與性能優(yōu)化_第1頁](http://file4.renrendoc.com/view/dcfb768ec65f8520a398c7f78339329c/dcfb768ec65f8520a398c7f78339329c1.gif)
![embedded從入門到精通系列課程4windows ce5.0mobile調試與性能優(yōu)化_第2頁](http://file4.renrendoc.com/view/dcfb768ec65f8520a398c7f78339329c/dcfb768ec65f8520a398c7f78339329c2.gif)
![embedded從入門到精通系列課程4windows ce5.0mobile調試與性能優(yōu)化_第3頁](http://file4.renrendoc.com/view/dcfb768ec65f8520a398c7f78339329c/dcfb768ec65f8520a398c7f78339329c3.gif)
![embedded從入門到精通系列課程4windows ce5.0mobile調試與性能優(yōu)化_第4頁](http://file4.renrendoc.com/view/dcfb768ec65f8520a398c7f78339329c/dcfb768ec65f8520a398c7f78339329c4.gif)
![embedded從入門到精通系列課程4windows ce5.0mobile調試與性能優(yōu)化_第5頁](http://file4.renrendoc.com/view/dcfb768ec65f8520a398c7f78339329c/dcfb768ec65f8520a398c7f78339329c5.gif)
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
WindowsEmbedded從 到精通系列課程
WindowsEmbeddedCE
Windows
調試與性能優(yōu)化
JianchaoTengConsultant
ConsultingServices
微軟中文技術
——
生活每一天
本周活動更新:
Top10
暢談我的2007
!
/
與眾不同:
版主:50+微軟最有價值專家(MVP)
涵蓋微軟幾乎所有產品線和知識庫
30+適合開發(fā)人員和IT專業(yè)人員技術板塊
本次課程內容包括
CEand
ArchitectureOverview
DebuggingTips
Performance&Profiler
CEand Overview
MemoryLayout
Hint:RegisterWindow
WindowsCEVirtualMemoryReview
32-bitOS–
possible
TophalfusedbyKernel
BottomhalfusedbyUser
WindowsCEVirtualMemoryReview
Abovetheprocessslotsisasharedareaforlarge
VirtualAllocsandmemorymappedfiles
WindowsCEVirtualMemoryReview
32MBProcessslotstake
thelowestaddresses
Slot32
KernelSpae
Slot2
Slot1
UserProcessSpace
Slot0
ProcessSlot
0x01FFFFFF
DLLVirtualMemoryAllocations
RAMDLL+OverflowROMDLL:Code+Data
GeneralVirtualMemoryAllocations
ThreadStack
ThreadStack
0x00010000
GuardSection(64k)+UserKInfo
0x00000000
ProcessCode+Data
ProcessHeap
ProcessVirtualAlloc()calls
ROMDLLs:R/WData
32MBProcessslotissharedbyDLL,process,andallofitsvirtualallocations
Allvirtualallocationsare
64kB-aligned
Pagesmaybecommittedwithinavirtualallocationonapagegranularity(4kB)
DLLallocationsinaslotstartathighaddressesandgrowdown
Processandgeneralallocationsstartatlowaddressesandgrowup
9
Debuggingtips
Whatdowelearnfromthememorylayout?
HexAddressAnatomy
64KBalignment.
(VirtualAllocs,DLLalignment
andStackslot)
Hexaddresseshaveidentifiablepositions:
High/Low2GBUser“l(fā)essthan”8Kernel“greaterthan”8
MegabyteAlignment
PageAlign
Slotalignment
HexAddressAnatomy
Position1(inyellow) lsyouifitskernel
spaceoruserspace8andaboveiskernelBelow8isUserspace
HexAddressAnatomy
Position2(inred)isprocessslotpositionIfslotnumberisodd,address
islikelyaDLL
Ifslotnumberiseven,
addressislikelyanapp
Slot32
Slot2
Slot1
Slot0
HexAddressAnatomy
32MBinhexis:0x02000000
16MBUpper
32MBslot
MegabyteAlignment 16MBLower
HexAddressAnatomy
Position4(incyan)is64kbalignment
DLLalignment
Stackalignment
64KBalignment.(VirtualAllocs,DLLalignment
andStackslot)
HexAddressAnatomy
Position5(ingray)ispage(4kb)alignment
16pages==64kb
PageAlign
HexAddressAnatomy
64KBalignment.
(VirtualAllocs,DLLalignment
andStackslot)
Letstakeanotherlook
High/Low2GBUser“l(fā)essthan”8Kernel“greaterthan”8
MegabyteAlignment
PageAlign
Slotalignment
ThinkinginHexQuiz1
Whatisthedifferencebetween:
0x
and
0x0A119235??
Extracredit:Whatdoyouthinkitpointsto?
ThinkinginHex(Answer1)
Sameaddress!
Seconditisbeingviewedoutsidetsprocessslot.
0x
0x0A119235
1MB ppe
32MBslot
High/Low2GBUser“l(fā)essthan”8Kernel“greaterthan”8
0x
MegabyteAlignment
PageAlign
1 BLower
64KBalignment.(VirtualAllocs,DLLalignment
Slotalignment andStackslot)
“MostLikely”codeorglobal
ThinkinginHex(Quiz2)
?
Whatis:
0x019ABCDE
ThinkinginHex(Answer2)
0x019ABCDEis“mostlikely”
CODEfromaDLL.
16MBUppe
0x019ABCDE
6MBLowr
32MBslot
VisuallyDebuggingCallStacks
Stacksgrowfromhighertoloweraddresses
DefaultsizeofARMstackis64KBandtheyarealways
64KBaligned.Thismeansthatthe“topfunctions”of
astackwillbelocatedver closetoa64KBboundar.
WindowsCEalsoemlosthenotionoftwosearate
4KBguardpagesthatthrowexceptionsifentered
VisualStackInspection#1
StackPointer“dipped”intofirstguardpage
Stackoverflow
UnderstandingException
AKY"AccessKey“
PC
"ProgramCounter”
ESP/SP“StackPointer”
ESP-EA-RA-FSRareCPUspecifiedregisterorMMUregister
Backtoaddresstopic:0x f
Dataorcodefailed!
Usings
.exetocollect
runtimeInformation
gicommand
gi["proc","thrd","mod","all"]*["<pattern>"]:GetInformation
proc ->Listsallprocessesinthesystem
thrd ->Listsallprocesseswiththeirthreads
delta->ListsonlythreadsthathavechangesinCPUtimes
DEMO
TargetControlDebugging
ProfilerandOptimization
Optimizewhat?
Howcouldwecollectthe
runtimeinformation?
PerformanceOptimization
Whatisbottle-neckofthesystem?
WhichmodulecostmostCPUtime?
Beforeoptimizethesystem,Weneedtoknowhowdoesthesystemrunning
Whicheventcausesystemblocking?
KernelProfiler
Whatistheprofilermean?
DataCollection
TimeBased
– MonteCarlo(time-basedsampling)CallBased
SystemCalls(call-based)
MonteCarlo
Highresolutiontimerasthe“Hit”
InterruptstheOSperiodicallyandsamplesthePC
voidProfilerHit(DWORDra);
SystemCalls
hitsintheObjectCallfunctioninthekernel
SystemcallprofilingmonitorsthisObjectCallfunction
RemoteKerneltracker
CaptureOSeventsastheyhappen
Threadandprocesscreation/execution/PRIO
Synchronizationobjects
Interrupts
Memory,paging,TLBmisses
Loaderevents
Bootevents
ExaminingThreadBehavior
RemoteKerneltracker
DEMO
UsingRemoteKernelTracker
Profilingfunctioncall
PSLhappensonlyinAPIcall
Normallyfunctioncallwon’tcausePSL
Complieraddedfunctionbelowtotrackingfunctioncall
void stdcall_CAP_Enter_Function(void
*pfn);
void stdcall_CAP_Exit_Function(void*pfn);
ProfilingCode
RemoteCallProfiler
DEMO
UsingRemoteCallProfiler
Summary
Makeyourdevicebetter!
嵌入式開發(fā)資源
WindowsEmbedded中文
http:/ / /windows/embedded
.NETMicroFramework
http://m
/embedded/bb267253.aspx
RoboticsStudio
http://m
/robotics/default.aspx
微軟嵌入式開發(fā)者
/ /default.aspx?ForumGroupID=493&
SiteID=15
微軟中國嵌入式開發(fā)者博客
htt /yunxu/
MikeHall的博客
http://m /embedded/
Aa731228.aspx
微軟啟動新一輪“免費重
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年其他計算機信息服務項目申請報告模稿
- 2025年多孔微孔陶瓷材料項目規(guī)劃申請報告模板
- 2025年企業(yè)高校實習生三方協(xié)議
- 2025年人才共享協(xié)議標準化文本
- 2025年合作共管協(xié)議示范文本
- 2025年借款合同范本速覽
- 2025年個人公積金貸款合同調整全覽
- 2025年專利權使用和解協(xié)議指南
- 2025年養(yǎng)老院入住協(xié)議標準
- 2025年供電設施更新改造協(xié)議
- 學校保潔服務投標方案(技術標)
- 青島中國(山東)自由貿易試驗區(qū)青島片區(qū)(青島前灣綜合保稅區(qū))管理委員會選聘35人筆試歷年參考題庫附帶答案詳解
- 《社區(qū)工作者培訓課件 新浪版》
- 教育信息化背景下的學術研究趨勢
- 人教版小學數(shù)學(2024)一年級下冊第五單元100以內的筆算加、減法綜合素養(yǎng)測評 B卷(含答案)
- 電子課件-《飯店服務心理(第四版)》-A11-2549
- 糖基轉移酶和糖苷酶課件(PPT 111頁)
- 部編版五年級語文下冊全冊教材分析
- 自來水業(yè)務辦理授權委托書
- 電子商務客戶服務ppt課件匯總(完整版)
- 2022危險化學品及石化化工項目必須進園區(qū)的規(guī)定文件匯總
評論
0/150
提交評論