The intuitive and policy appeal of PbR Models being tested Early results
Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate...
Transcript of Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate...
![Page 1: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/1.jpg)
presented by
Innovative Software Tools & Methods to Profile, Test and Optimize UEFI Firmware
Improving Test Coverage and Debug Results
UEFI US Fall Plugfest – September 20 - 22, 2016Presented by Kevin Davis (Insyde Software)
Updated 2011-06-01
![Page 2: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/2.jpg)
Agenda
• Introduction
• Intel Processor Trace Buffer
• Driver Profiling
• Code Coverage Display
• Questions?
UEFI Plugfest – September 2016 www.uefi.org 2
![Page 3: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/3.jpg)
Debug Models
• Hardware Level Debuggers
– Physical Access to board required
– Complexity of connection to board
– No or minor impact to software execution
• Software Level Debuggers
– No need to have physical access to the board
– Some impact to software execution
– Complexity of sharing a processor
UEFI Plugfest – September 2016 www.uefi.org 3
![Page 4: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/4.jpg)
Define Software Terms
• Host Machine – runs the User Interface of the Software Debugger to the engineer
• Target Platform – runs the BIOS interface of the Software Debugger
UEFI Plugfest – September 2016 www.uefi.org 4
![Page 5: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/5.jpg)
Innovation of Branch Tracing
• Previously to trace, SW debuggers broke on either each instruction or at branches– On each break:
• Transmit data to host or store locally• Check various debug control conditions• Restart next instruction
– Very slow execution
• Now with Branch Tracing– SW debugger stops on a condition– Unwinds execution trace to previous IP or size of the
Trace buffer– Target code executes much faster
UEFI Plugfest – September 2016 www.uefi.org 5
![Page 6: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/6.jpg)
Branch Records
UEFI Plugfest – September 2016 www.uefi.org 6
32-bit Branch Trace Record Format
64-bit Branch Trace Record Format
![Page 7: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/7.jpg)
Solving new problems
• More features can be created in a software debugger –Unravel call trees
–Highlight areas called by Oss
– Find long hardware I/O loops
– Figure out where a crash started
– Test sequence code coverage
–Profile specific drivers
UEFI Plugfest – September 2016 www.uefi.org 7
![Page 8: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/8.jpg)
Profiling Drivers
UEFI Plugfest – September 2016 www.uefi.org 8
![Page 9: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/9.jpg)
Steps to profile a driver
UEFI Plugfest – September 2016 www.uefi.org 9
Setup Profiling buffer size from Project Setting dialog
Update debug engine to support Profiling
Update to Bios Debugger Log Analysis
Enable/Disable Profiling from Profiling menu
Build bios withnon-optimized and generating debug info
Select Profiling Analyzer from Profiling menu to start profiling analysis
The reports will be displayed on Report view after completion
![Page 10: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/10.jpg)
Setup Trace Buffer sizes
UEFI Plugfest – September 2016 www.uefi.org 10
![Page 11: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/11.jpg)
Profiling Execution Flow Example
UEFI Plugfest – September 2016 www.uefi.org 11
Executed code colored in green
Execution path
displayed in
tree view
![Page 12: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/12.jpg)
Code Coverage
UEFI Plugfest – September 2016 www.uefi.org 12
![Page 13: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/13.jpg)
Need for Code Coverage
• Validate that all code is being tested
– If code isn’t being tested during validation, code path is either:
• Unnecessary – remove it!
• Not being tested – probably buggy, might cause problems in the field
– Fix the test & test the code
UEFI Plugfest – September 2016 www.uefi.org 13
![Page 14: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/14.jpg)
Code Coverage Example
UEFI Plugfest – September 2016 www.uefi.org 14
Executed
Not executed
undeterminedCoverage information by module/driver
Summary of functions in a module/driver
![Page 15: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/15.jpg)
Call to action
• Contact your Debugger vendor
–Ask about their support for tracing code execution
• Profile your drivers to understand their execution flow
• Verify that your code is executed during your testing
UEFI Plugfest – September 2016 www.uefi.org 15
![Page 16: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/16.jpg)
Thanks for attending the UEFI US Fall Plugfest 2016
For more information on the Unified EFI Forum and UEFI Specifications, visit http://www.uefi.org
presented by
UEFI Plugfest – September 2016 www.uefi.org 16
![Page 17: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/17.jpg)
References Pointers to more information
Backup
UEFI Plugfest – September 2016 www.uefi.org 17
![Page 18: Innovative Software Tools & Methods to Profile, Test and ... · Need for Code Coverage •Validate that all code is being tested –If code isn’t being tested during validation,](https://reader034.fdocuments.us/reader034/viewer/2022042913/5f4b002fc9090c333f731971/html5/thumbnails/18.jpg)
References
• Material heavily borrowed from:– Intel 64, ia, 32 Architectures Software Developer
Manual #325462
– Insyde Software DDT Developer Manual
• Pointer– http://www.intel.com/content/www/us/en/proce
ssors/architectures-software-developer-manuals.html
– https://www.insyde.com/products/developertools
UEFI Plugfest – September 2016 www.uefi.org 18