SlideShare ist ein Scribd-Unternehmen logo
1 von 47
ID 720C: SH7724 starting a QT application with minimal boot Andrew Murray (amurray@mpcdata.com) Embedded Linux Consultant Engineer 13 October 2010 Version: 1.0
2 Mr. Andrew Murray Embedded Linux Consultant Engineer, MPC Data Driver and kernel development Embedded applications development Windows driver development Education MEng in Software Engineering from University of Wales, Aberystwyth, UK Member of the IET working towards CEng professional accreditation Work Experience 4+ years of experience working with embedded Linux devices Taking a key role in developing the swiftBoot service for optimizing boot times in embedded devices 2
3 Innovative devices often require complex functionality and minimal boot times - for minimum power consumption or maximum user experience 3 Innovation
4 Innovative devices usually require Lots of complex functionality Minimal boot times Meeting the needs of innovative devices is a challenge Complex functionality is difficult without an operating system Minimal boot time is typically difficult with an operating system Where should you spend your time? It’s my view that with the right approach complex functionality can be achieved with embedded Linux in minimal time We’re going to examine how this is possible 4 Minimal Boot Times are Achievable with Linux!
5 Who are MPC Data? Why does embedded Linux take so long to boot? Best approach to boot time reduction Case Study: MS7724 ‘Ecovec’ Demonstration Conclusion and Q&A						 5 Agenda
6 MPC Data is a well established embedded systems integrator with a strong focus on platform development 55 strong team serving North America & Europe Experts in embedded development and optimization Contributors to the open source community Technical focus and track record backed-up by numerous successful products in a wide variety of markets Renesas Alliance Platinum Partner Provides the unique swiftBoot boot time reduction service Contact: business@mpc-data.comhttp://www.mpcdata.com/ 6 MPC Data
7 Why so long anyway? Embedded Linux is: General purpose Likely to contain functionality your device doesn’t require which will result in more initialisation and a larger image size Convenient and flexible Likely to probe and detect hardware which you know will always be there which will contribute to boot delays Boot speed isn’t seen as the highest priority A lot of duplication between boot-loader and kernel There are many approaches to overcome large boot delays such as hibernation, stand-by and similar technologies, This presentation describes how boot times can be drastically reduced by specialising Linux to your device’s needs and product requirements 7
8 The                   Approach 8
9 The                   Approach ,[object Object]
Immediately after boot
Sometime after
The better your understanding the more able you are to specialise Linux and thus improve boot time9
10 The                   Approach ,[object Object]
Measuring boot time across the entire software stack is essential
Without tools, gauging small boot delays can be impossible
Being able to accurately measure boot time across the board will allow you to measure the effect of any changes you make


otherwise you’ll be lost in the dark10
11 The                   Approach ,[object Object]
Increased image size (flash transfer time)
Time spent initialization during start up
“But I might use this feature in the future, it’s nice to have” – Be strict!
Don’t dive into the kernel’s KConfig system – consider your boot loader, application and libraries
Some functionality may have little effect11
12 The                   Approach ,[object Object]
It may already be optimised in a later version of sources
This may involve:
Optimising flash timings
Removing unnecessary probing
Refactoring code
Taking a new approach to problems12
13 The                   Approach ,[object Object]
Parallelisation
Deferred loading of less important features
Re-ordering13
14 Case Study Use the MS7724 ‘EcoVec’ as a case study for a home automation system Boot time functionality:  Responsive QT user interface Additional functionality:  Video capture/render (representing a security camera) Will describe tools and techniques along the way 14
15 MS7724 15
16 SH7724 16
17 Case Study Use the MS7724 ‘EcoVec’ as a case study for a home automation system Boot time functionality:  Responsive QT user interface Additional functionality:  Video capture/render (representing a security camera) Will describe tools and techniques along the way 17
18 Case Study 18
19 Case Study Use the MS7724 ‘EcoVec’ as a case study for a home automation system Boot time functionality:  Responsive QT user interface Additional functionality:  Video capture/render (representing a security camera) Will describe tools and techniques along the way 19
20 Case Study Typical Starting Point: BootLoader: UBoot (2009-01) OS: Linux (2.6.31-rc7) Filesystem: Buildroot (2010.05) Application: QT Embedded Opensource 4.6.2 20
21 MS7724 Boot Process Boot process: UBoot loads compressed kernel into RAM, Kernel mounts root filesystem and starts init process, Init scripts start GUI application Component times measured using GPIO and a logic analyser, UBoot time measured time between reset and GPIO line being asserted Sources modified to toggle GPIO Time to required boot time functionality: > 19 seconds! 21
22 Before Optimization Boot Time = 19.44 seconds
23 Demonstration: After Optimization Boot Time = 0.77 seconds!
24 UBoot
25 UBoot (Before and After) Before (136 kB) After (94 kB)
26 Compressed Kernel Images The purpose of the boot loader is to jump to an uncompressed kernel image (usually in RAM) A number of factors should be considered If Flash throughput is greater than decompression throughput then an uncompressed image is quicker 26

Weitere Àhnliche Inhalte

Was ist angesagt?

3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_k3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_k
IBM
 
Daniel dauwe ece 561 Benchmarking Results
Daniel dauwe   ece 561 Benchmarking ResultsDaniel dauwe   ece 561 Benchmarking Results
Daniel dauwe ece 561 Benchmarking Results
cinedan
 
How we test tvideo at skype
How we test tvideo at skypeHow we test tvideo at skype
How we test tvideo at skype
QA Club Kiev
 
The Cortex-A15 Verification Story
The Cortex-A15 Verification StoryThe Cortex-A15 Verification Story
The Cortex-A15 Verification Story
DVClub
 
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...
Sangwook Kim
 

Was ist angesagt? (19)

The Andc Cluster
The Andc ClusterThe Andc Cluster
The Andc Cluster
 
WALT vs PELT : Redux - SFO17-307
WALT vs PELT : Redux  - SFO17-307WALT vs PELT : Redux  - SFO17-307
WALT vs PELT : Redux - SFO17-307
 
Sw update elce2017
Sw update elce2017Sw update elce2017
Sw update elce2017
 
Software update for embedded systems - elce2014
Software update for embedded systems - elce2014Software update for embedded systems - elce2014
Software update for embedded systems - elce2014
 
3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_k3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_k
 
OpenCV for Embedded: Lessons Learned
OpenCV for Embedded: Lessons LearnedOpenCV for Embedded: Lessons Learned
OpenCV for Embedded: Lessons Learned
 
FUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGN
FUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGNFUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGN
FUSION APU & TRENDS/ CHALLENGES IN FUTURE SoC DESIGN
 
Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40
 
Lec 9-os-review
Lec 9-os-reviewLec 9-os-review
Lec 9-os-review
 
AMD_11th_Intl_SoC_Conf_UCI_Irvine
AMD_11th_Intl_SoC_Conf_UCI_IrvineAMD_11th_Intl_SoC_Conf_UCI_Irvine
AMD_11th_Intl_SoC_Conf_UCI_Irvine
 
A short Intro. to Java Mission Control
A short Intro. to Java Mission ControlA short Intro. to Java Mission Control
A short Intro. to Java Mission Control
 
Daniel dauwe ece 561 Benchmarking Results
Daniel dauwe   ece 561 Benchmarking ResultsDaniel dauwe   ece 561 Benchmarking Results
Daniel dauwe ece 561 Benchmarking Results
 
Java Mission Control: Java Flight Recorder Deep Dive
Java Mission Control: Java Flight Recorder Deep DiveJava Mission Control: Java Flight Recorder Deep Dive
Java Mission Control: Java Flight Recorder Deep Dive
 
OSSA17 - Live patch, VMI, Security Mgmt (50 mins, no embedded demos)
OSSA17 - Live patch, VMI, Security Mgmt (50 mins, no embedded demos)OSSA17 - Live patch, VMI, Security Mgmt (50 mins, no embedded demos)
OSSA17 - Live patch, VMI, Security Mgmt (50 mins, no embedded demos)
 
How we test tvideo at skype
How we test tvideo at skypeHow we test tvideo at skype
How we test tvideo at skype
 
The Cortex-A15 Verification Story
The Cortex-A15 Verification StoryThe Cortex-A15 Verification Story
The Cortex-A15 Verification Story
 
Getput suite
Getput suiteGetput suite
Getput suite
 
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...
Virtual Asymmetric Multiprocessor for Interactive Performance of Consolidated...
 
Optimize Your Computer
Optimize Your ComputerOptimize Your Computer
Optimize Your Computer
 

Ähnlich wie Renesas DevCon 2010: Starting a QT Application with Minimal Boot

A framework for optimization of the boot time on embedded linux environment w...
A framework for optimization of the boot time on embedded linux environment w...A framework for optimization of the boot time on embedded linux environment w...
A framework for optimization of the boot time on embedded linux environment w...
BouchraBourass
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
Kan-Ru Chen
 
TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6
Sravanthi N
 

Ähnlich wie Renesas DevCon 2010: Starting a QT Application with Minimal Boot (20)

A framework for optimization of the boot time on embedded linux environment w...
A framework for optimization of the boot time on embedded linux environment w...A framework for optimization of the boot time on embedded linux environment w...
A framework for optimization of the boot time on embedded linux environment w...
 
Improving User Experience with Ubiquitous QuickBoot
 Improving User Experience with Ubiquitous QuickBoot Improving User Experience with Ubiquitous QuickBoot
Improving User Experience with Ubiquitous QuickBoot
 
Reducing the boot time of Linux devices
Reducing the boot time of Linux devicesReducing the boot time of Linux devices
Reducing the boot time of Linux devices
 
Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation Systems
 
Reproducibility in artificial intelligence
Reproducibility in artificial intelligenceReproducibility in artificial intelligence
Reproducibility in artificial intelligence
 
Reducing boot time in embedded Linux
Reducing boot time in embedded LinuxReducing boot time in embedded Linux
Reducing boot time in embedded Linux
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Document 14 (6).pdf
Document 14 (6).pdfDocument 14 (6).pdf
Document 14 (6).pdf
 
Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike MullerFaster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
 
TestCon Vilnius 2017 - Stating the obvious
TestCon Vilnius 2017 - Stating the obviousTestCon Vilnius 2017 - Stating the obvious
TestCon Vilnius 2017 - Stating the obvious
 
Using Embedded Linux for Infrastructure Systems
Using Embedded Linux for Infrastructure SystemsUsing Embedded Linux for Infrastructure Systems
Using Embedded Linux for Infrastructure Systems
 
Bring-your-ML-Project-into-Production-v2.pdf
Bring-your-ML-Project-into-Production-v2.pdfBring-your-ML-Project-into-Production-v2.pdf
Bring-your-ML-Project-into-Production-v2.pdf
 
TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6TechTalk_Cloud Performance Testing_0.6
TechTalk_Cloud Performance Testing_0.6
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016
 
Linux-Based Data Acquisition and Processing On Palmtop Computer
Linux-Based Data Acquisition and Processing On Palmtop ComputerLinux-Based Data Acquisition and Processing On Palmtop Computer
Linux-Based Data Acquisition and Processing On Palmtop Computer
 
Linux-Based Data Acquisition and Processing On Palmtop Computer
Linux-Based Data Acquisition and Processing On Palmtop ComputerLinux-Based Data Acquisition and Processing On Palmtop Computer
Linux-Based Data Acquisition and Processing On Palmtop Computer
 
How To Build Efficient ML Pipelines From The Startup Perspective (GTC Silicon...
How To Build Efficient ML Pipelines From The Startup Perspective (GTC Silicon...How To Build Efficient ML Pipelines From The Startup Perspective (GTC Silicon...
How To Build Efficient ML Pipelines From The Startup Perspective (GTC Silicon...
 
HiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOSHiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOS
 
Integrating Puppet and Gitolite for sysadmins cooperations
Integrating Puppet and Gitolite for sysadmins cooperationsIntegrating Puppet and Gitolite for sysadmins cooperations
Integrating Puppet and Gitolite for sysadmins cooperations
 
Why software performance reduces with time?.pdf
Why software performance reduces with time?.pdfWhy software performance reduces with time?.pdf
Why software performance reduces with time?.pdf
 

KĂŒrzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

KĂŒrzlich hochgeladen (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

Renesas DevCon 2010: Starting a QT Application with Minimal Boot

  • 1. ID 720C: SH7724 starting a QT application with minimal boot Andrew Murray (amurray@mpcdata.com) Embedded Linux Consultant Engineer 13 October 2010 Version: 1.0
  • 2. 2 Mr. Andrew Murray Embedded Linux Consultant Engineer, MPC Data Driver and kernel development Embedded applications development Windows driver development Education MEng in Software Engineering from University of Wales, Aberystwyth, UK Member of the IET working towards CEng professional accreditation Work Experience 4+ years of experience working with embedded Linux devices Taking a key role in developing the swiftBoot service for optimizing boot times in embedded devices 2
  • 3. 3 Innovative devices often require complex functionality and minimal boot times - for minimum power consumption or maximum user experience 3 Innovation
  • 4. 4 Innovative devices usually require Lots of complex functionality Minimal boot times Meeting the needs of innovative devices is a challenge Complex functionality is difficult without an operating system Minimal boot time is typically difficult with an operating system Where should you spend your time? It’s my view that with the right approach complex functionality can be achieved with embedded Linux in minimal time We’re going to examine how this is possible 4 Minimal Boot Times are Achievable with Linux!
  • 5. 5 Who are MPC Data? Why does embedded Linux take so long to boot? Best approach to boot time reduction Case Study: MS7724 ‘Ecovec’ Demonstration Conclusion and Q&A 5 Agenda
  • 6. 6 MPC Data is a well established embedded systems integrator with a strong focus on platform development 55 strong team serving North America & Europe Experts in embedded development and optimization Contributors to the open source community Technical focus and track record backed-up by numerous successful products in a wide variety of markets Renesas Alliance Platinum Partner Provides the unique swiftBoot boot time reduction service Contact: business@mpc-data.comhttp://www.mpcdata.com/ 6 MPC Data
  • 7. 7 Why so long anyway? Embedded Linux is: General purpose Likely to contain functionality your device doesn’t require which will result in more initialisation and a larger image size Convenient and flexible Likely to probe and detect hardware which you know will always be there which will contribute to boot delays Boot speed isn’t seen as the highest priority A lot of duplication between boot-loader and kernel There are many approaches to overcome large boot delays such as hibernation, stand-by and similar technologies, This presentation describes how boot times can be drastically reduced by specialising Linux to your device’s needs and product requirements 7
  • 8. 8 The Approach 8
  • 9.
  • 12. The better your understanding the more able you are to specialise Linux and thus improve boot time9
  • 13.
  • 14. Measuring boot time across the entire software stack is essential
  • 15. Without tools, gauging small boot delays can be impossible
  • 16. Being able to accurately measure boot time across the board will allow you to measure the effect of any changes you make

  • 17. 
otherwise you’ll be lost in the dark10
  • 18.
  • 19. Increased image size (flash transfer time)
  • 20. Time spent initialization during start up
  • 21. “But I might use this feature in the future, it’s nice to have” – Be strict!
  • 22. Don’t dive into the kernel’s KConfig system – consider your boot loader, application and libraries
  • 23. Some functionality may have little effect11
  • 24.
  • 25. It may already be optimised in a later version of sources
  • 30. Taking a new approach to problems12
  • 31.
  • 33. Deferred loading of less important features
  • 35. 14 Case Study Use the MS7724 ‘EcoVec’ as a case study for a home automation system Boot time functionality: Responsive QT user interface Additional functionality: Video capture/render (representing a security camera) Will describe tools and techniques along the way 14
  • 38. 17 Case Study Use the MS7724 ‘EcoVec’ as a case study for a home automation system Boot time functionality: Responsive QT user interface Additional functionality: Video capture/render (representing a security camera) Will describe tools and techniques along the way 17
  • 40. 19 Case Study Use the MS7724 ‘EcoVec’ as a case study for a home automation system Boot time functionality: Responsive QT user interface Additional functionality: Video capture/render (representing a security camera) Will describe tools and techniques along the way 19
  • 41. 20 Case Study Typical Starting Point: BootLoader: UBoot (2009-01) OS: Linux (2.6.31-rc7) Filesystem: Buildroot (2010.05) Application: QT Embedded Opensource 4.6.2 20
  • 42. 21 MS7724 Boot Process Boot process: UBoot loads compressed kernel into RAM, Kernel mounts root filesystem and starts init process, Init scripts start GUI application Component times measured using GPIO and a logic analyser, UBoot time measured time between reset and GPIO line being asserted Sources modified to toggle GPIO Time to required boot time functionality: > 19 seconds! 21
  • 43. 22 Before Optimization Boot Time = 19.44 seconds
  • 44. 23 Demonstration: After Optimization Boot Time = 0.77 seconds!
  • 46. 25 UBoot (Before and After) Before (136 kB) After (94 kB)
  • 47. 26 Compressed Kernel Images The purpose of the boot loader is to jump to an uncompressed kernel image (usually in RAM) A number of factors should be considered If Flash throughput is greater than decompression throughput then an uncompressed image is quicker 26
  • 49. 28 Linux Kernel (Before and After)
  • 50. 29 Userspace (Mount and Init scripts) Example of a bootchart graphic
  • 51. 30 QT Reducing the boot time of the QT application was the biggest challenge and very time consuming Un-optimized QT application was large and took 7.4 seconds to reach it’s main function! Improvements reduce time to 0.3 seconds: Measurements show incremental effects against original binary (from left to right)
  • 52. 31 Why does QT take so long to start? Only a portion of the QT application is required to display a UI to the user Event handling, additional forms, etc come later As Linux uses Demand Paging - when an executable is run only parts of the executable used are read from flash This reduces unnecessary flash accesses and decreases application start up time However the application is on a block filesystem so when an entire block is retrieved at a time
 
This results in unnecessary flash access time if the required executable code is spread over the entire image
  • 53. 32 Function Reordering and Block Sizes Sections highlighted in red represent parts of executable required at start up Most of these parts could fit in a single file-system block I.e. we could optimise the application such that only 2 blocks of flash are accessed rather than 4 Thus the executable can be optimised by: Reducing block size Eliminating FS readahead Reordering executable
  • 54. 33 Function Reordering GCC compiler features can be used to assist: --finstrument-functions --ffunction-sections Before the entry and after the exit of every function call – GCC will call two new functions when –finstrument-functions is used: void __cyg_profile_func_enter (
.) void __cyg_profile_func_exit (
.) These calls can be implemented to find out which functions are called when This information can be used to generate a custom linker script – when –function-sections is used each function lives in its own section. This way we can ensure all the required sections for startup are contained contiguously in flash
  • 55. 34 Function Reordering and Block Sizes Before: After:
  • 56. 35 Essential tools Discrete events can be measured by toggling GPIO outputs and utilising a logic analyser, Kernel events can be measured with: Printk timings, Initcall_debug and bootchart scripts, Userspace events can be measured with ubootchart http://code.google.com/p/ubootchart/ http://www.bootchart.org/ These are just some of the many tools available
  • 57. 36 Case Study: Before and After A reduction of 96%!
  • 58. 37 Demonstration: After Optimization Boot Time = 0.77 seconds!
  • 59. 38 Guiding Principles Observe and Record Measuring boot times is the only way to form a clear picture of what is contributing to boot time, Keep copious notes Tackle the biggest delays in the system first, Identify the largest delays and remove them to be most effective Be aware and try to understand varying boot times Remember the uncertainty principle Don’t forget testing Remember – you can change any of the source code
  • 60.
  • 61. 40 Minimal Boot Times are Achievable with Linux! Complex functionality with short boot times (< 5 seconds) are certainly achievable with Embedded Linux (with the right approach), Boot time reductions can be achieved by specialising Linux (and friends) to your device’s boot time functionality needs: E.g. Removal of unnecessary functionality, optimisation and re-ordering, Other functionality can come later The internet covers many techniques for reducing boot speed but to make a big difference you need the right approach, Observe, record, remove, optimise and re-order Everything you require to make an improvement is freely availably online Requires time and in-depth knowledge of the kernel and software components...
  • 62. 41 Other Solutions MPC Data offer fixed price packaged services from $8,000 Input: Your new or existing embedded Linux product, Process: Identification of required boot time functionality, Extensive and holistic investigation into boot delays of your product including all our areas of our expertise Output: swiftBoot report Approximately 20 pages, Documents boot process including narration on boot delays and mitigations, Enough information for your engineers to act on – though we can also help with implementation, Typically provide recommendations to reduce boot time in excess of > 50%! Visit http://www.swiftBoot.com/
  • 63. 42 or contact amurray@mpcdata.com 42 Questions?
  • 64. 43 43 Feedback Form Please fill out the feedback form! If you do not have one, please raise your hand
  • 65. 44 44 Thank You!
  • 67. 46 Initcall Debug Add the following to your kernel command line: initcall_debug(to add debug) loglevel=0 (to reduce the impact this has on boot time) Ensure the following are set in your kernel configuration: CONFIG_PRINTK_TIME (add timings to printks) CONFIG_KALLSYMS (ensure symbols are there) CONFIG_LOGBUF_SHIFT = 18 (ensure there is room in the log buffer) Copy the output of ‘dmesg’ Type ‘cat output | ./scripts/bootgraph.pl > graph.svg’