SlideShare a Scribd company logo
How to Measure
   RTOS Performance

                               Colin Walls
                  colin_walls@mentor.com

with acknowledgement to Faheem Sheikh & Dan Driscoll




                           mentor.com/embedded
Agenda
Introduction
RTOS Metrics
Memory Footprint
Interrupt Latency
Scheduling Latency
Timing Kernel Services
Conclusions
Agenda
Introduction
RTOS Metrics
Memory Footprint
Interrupt Latency
Scheduling Latency
Timing Kernel Services
Conclusions
Introduction – Why?




 Desktop computers         Embedded systems
    – Infinite CPU power      – Enough CPU power – just
    – Infinite memory         – Adequate memory – none to spare
    – Costs nothing           – Power consumption an issue
                              – Cost normally critical
Introduction – Choosing an RTOS
RTOS solutions
  – Proprietary [in-house; home brew]
  – Commercial
     –   At least 200 product available
  – Open source
Asking the right questions is important
Understanding the answers is critical
  – Pitfalls with misinterpretation
Agenda
Introduction
RTOS Metrics
Memory Footprint
Interrupt Latency
Scheduling Latency
Timing Kernel Services
Conclusions
RTOS Metrics
Three common categories:
  – Memory footprint
     –   Program and data
  – Latency
     –   Interrupt and scheduling
  – Services performance
No real standardization
  – Embedded Microprocessor Benchmark Consortium
    (EEMBC) not widely adopted
     –   Oriented towards CPU benchmarking
Agenda
Introduction
RTOS Metrics
Memory Footprint
Interrupt Latency
Scheduling Latency
Timing Kernel Services
Conclusions
Memory Footprint
RAM and ROM requirements of RTOS
  – On a specific platform


 ROM size:                   RAM size:
  – Kernel code                – Kernel data structures
  – Read-only data             – Global variables
  – Runtime library code       – May need
  – Maybe in flash;              accommodate “ROM”
    possibly copied to
    RAM
Memory Footprint – Dependencies
Key factors affect the footprint calculation


CPU architecture
   – Huge effect on number of instructions
Software configuration
   – Which kernel components are included
   – Scalability ...
Compiler optimization
   – Reduces code size, but may adversely affect performance
Memory Footprint – Scalability

    RTOS            Application     Memory
   Service #1    …
                 rtos_call_1();
   Service #2
                 …
                 rtos_call_3();     Application
   Service #3
                 …                    Code
   Service #4    rtos_call_157();
                 …


                                      RTOS
  Service #271
                                       core
                                     Service #1

                                     Service #3

                                    Service #157
Memory Footprint – Measurement
Making measurement need not be difficult
Two key methods:
  – Memory MAP file
     –   Generated by standard linkers
     –   Quality and detail varies between tools
  – Specific tool
     –   Shows footprint information for selected executable image
     –   Example: objdump
Memory Footprint – Importance
Limited memory availability
  – Small on-chip memory
  – No external memory option
  – Application code is priority
Larger systems
  – Kernel performance a priority
  – Place in on-chip memory
  – Lock into cache
Using a bootloader
  – Non-volatile memory and RAM space used
Memory Footprint – Pitfalls
Vendor data can be readily misinterpreted

Look at minimum configuration definition
  – It may be a tiny, impractical subset
Runtime library functions are often not included
RAM/ROM sizes should have a min/max range
  – RAM is likely to be application dependent
  – ROM driven by kernel configuration
     – Need minimum “useable” size
     – Also maximum measure with all services

  – Scalability variable – may be different kernel versions
Memory Footprint – Example
Nucleus RTOS kernel is fully scalable
Example: ARM Cortex A8 in ARM mode
Built with Mentor Sourcery CodeBench toolchain
Full optimization for size


ROM = 12-30 Kbytes
RAM = 500 bytes
Memory Footprint – Example
Min has essential kernel services [dynamic memory,
 threads, semaphores, events, queues]
  – Runtime library excluded
Max includes all kernel services


Compiling for Thumb-2 mode reduces ROM by 35%
  – So Nucleus kernel can use 7.8 Kbytes on a Cortex-M
    based controller
Agenda
Introduction
RTOS Metrics
Memory Footprint
Interrupt Latency
Scheduling Latency
Timing Kernel Services
Conclusions
Interrupt Latency




         Definitions of interrupt latency
Interrupt Latency – Definition
Different definitions


System: Time between interrupt assertion and the
 instant an observable response happens
OS: Duration of when the CPU was interrupted until
 the start of the corresponding interrupt service
 routine (ISR)
   – This is really OS overhead
   – Many vendors refer to this as the latency
   – Hence often report zero latency
Interrupt Latency – Measurement
Interrupt response is the sum of two distinct times:

                             ƮIL = ƮH + ƮOS

where:
   ƮH is the hardware dependent time
      –   depends on the interrupt controller on the board as well as the type
          of the interrupt
   ƮOS is the OS induced overhead
      –   Best and worst case scenarios
      –   Worst when kernel disables interrupts
Interrupt Latency – Measurement
Best approach is to record time between interrupts
 source and response
  – Use an oscilloscope
  – For example:
     –   One GPIO pin can generate an interrupt
     –   Another pin toggled at the start of the ISR
Interrupt Latency – Importance
Specific types of designs rely on this metric:
   – Time critical
   – Fault tolerant
If high I/O bandwidth is needed, measure the latency of
   a particular interrupt
Most systems can tolerate interrupt latency of tens of
 microseconds
Interrupt Latency – Pitfalls
Main danger is interpretation of published figures


Key factors to check:

Hardware configuration           OS configuration
  – Which platform?                – Where is code running
  – CPU speed?                       from? [Flash, SDRAM ...]
  – Cache configuration?           – Which interrupt used?
  – Timer frequency?               – Code optimized for speed?
  – Interrupt controller type?     – Is metric best or average
                                     case?
Interrupt Latency – Example
Nucleus RTOS
  – ARM Cortex A8
  – 600MHz
  – Running from SRAM
Average interrupt latency of less than 0.5
 microseconds
Agenda
Introduction
RTOS Metrics
Memory Footprint
Interrupt Latency
Scheduling Latency
Timing Kernel Services
Conclusions
Scheduling Latency – Definition
Performance of RTOS thread scheduler
Very wide variation in measurement technique and
 interpretation
Two distinct related quantities:
   – Context switch time
   – Scheduling overhead
Scheduling Latency – Definition
Context switch time
Scheduling Latency – Definition
Scheduling overhead
Scheduling Latency – Measurement
Scheduling latency is the maximum of two times:

                       ƮSL = MAX(ƮSO, ƮCS)



where:
  ƮSO is the scheduling overhead
     –   End of ISR to start of task schedule
  ƮCS is the time taken to save and restore thread context
Scheduling Latency – Importance
Most systems that have stringent interrupt latency
 demands also need low scheduling latency
Broadly, systems that are:
  – Time critical
  – Fault tolerant
Scheduling Latency – Pitfalls
Ignoring initial system state
   – If system is idle, there is no time taken saving context


Key factors to check:
Hardware configuration             OS configuration
   – Which platform?                  – Where is code running
   – CPU speed?                         from? [Flash, SDRAM ...]
   – Cache configuration?             – Which interrupt used?
   – Timer frequency?                 – Code optimized for speed?
   – Interrupt controller type?       – Is metric best or average
                                        case?
Scheduling Latency – Example
Nucleus RTOS
  – ARM Cortex A8
  – 600MHz
  – Running from SRAM
Scheduling latency is 1.3 microseconds
Agenda
Introduction
RTOS Metrics
Memory Footprint
Interrupt Latency
Scheduling Latency
Timing Kernel Services
Conclusions
Timing Kernel Services
RTOS may have a great many API calls
Timing of keys ones may be of interest
  – Focus on frequently used API calls
Four key categories:
  – Threading services
  – Synchronization services
  – Inter-process communication services
  – Memory services
Timing Kernel Services
Threading Services
  – Control of fundamental kernel functionality:
     –   Create thread
     –   Start thread
     –   Resume thread
     –   Stop thread
  – Many multi-taking applications make heavy use of these
    calls
Timing Kernel Services
Synchronization Services
  – Services to synchronize between contexts, like an ISR and
    a thread
  – Also protection of critical code sections from concurrent
    access
     –   e.g. Semaphore may be used by Ethernet ISR to write data into
         shared memory that is also used by a task
  – Timing is important is the application has numerous shared
    resources or peripherals
Timing Kernel Services
Inter-process Communication Services
  – Services to share data between multiple threads
  – Examples:
     –   FIFOs
     –   Queues
     –   Mailboxes
     –   Event flags
  – Many multi-taking applications make heavy use of this type
    of service
Timing Kernel Services
Memory Services
  – In a multi-threaded context, kernel is used to manage
    dynamic memory
  – Allocation and de-allocation times are important
     –   Applications with large data throughput are particularly sensitive
Timing Kernel Services – Pitfalls
Hardware configuration
  – Which platform?
  – CPU speed?
  – Cache configuration?
OS configuration
  – Where is code running from? [Flash, SDRAM ...]
  – Code optimized for speed?
  – Is metric best or average case?
  – Is kernel configured for reduced error checking?
Timing Kernel Services – Example

      Nucleus RTOS Kernel Service   Time in µS
      Task resumption                  0.3
      Task suspension                  0.3
      Obtaining a semaphore            0.5
      Set an event                     0.4
      Send message to queue            0.9
      Allocate memory                  0.2
      De-allocate memory               0.7
      Allocate partition               0.4
Agenda
Introduction
RTOS Metrics
Memory Footprint
Interrupt Latency
Scheduling Latency
Timing Kernel Services
Conclusions
Conclusions
RTOS performance data provided by vendors can be
 useful
It can also be misleading if it is misinterpreted
Need a thorough understanding of:
   – Measurement techniques
   – Terminology
   – Trade-offs
      to conduct fair comparison
Recommendation is to rely on holistic or application-
 oriented measurements
Thank you

                         Colin Walls
              colin_walls@mentor.com
   http://blogs.mentor.com/colinwalls



                              See white paper:
"Measuring RTOS Performance: What? Why? How?"

                      mentor.com/embedded

More Related Content

What's hot

Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
Ashwani Garg
 
Rtos by shibu
Rtos by shibuRtos by shibu
Rtos by shibu
Shibu Krishnan
 
Intro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication ProtocolsIntro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication Protocols
Emertxe Information Technologies Pvt Ltd
 
Rtos concepts
Rtos conceptsRtos concepts
Rtos concepts
anishgoel
 
REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1
Embeddedcraft Craft
 
Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1
Abu Bakr Ramadan
 
Real Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded SystemsReal Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded Systems
Aditya Vichare
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
Khuram Shahzad
 
Real time scheduling - basic concepts
Real time scheduling - basic conceptsReal time scheduling - basic concepts
Real time scheduling - basic concepts
Student
 
VLIW Processors
VLIW ProcessorsVLIW Processors
VLIW Processors
Sudhanshu Janwadkar
 
Vx works RTOS
Vx works RTOSVx works RTOS
Vx works RTOS
Sai Malleswar
 
Design of embedded systems
Design of embedded systemsDesign of embedded systems
Design of embedded systemsPradeep Kumar TS
 
Real Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsReal Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systems
Hariharan Ganesan
 
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-1 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
FastBit Embedded Brain Academy
 
Arm processor
Arm processorArm processor
Arm processor
SHREEHARI WADAWADAGI
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
Sudhanshu Janwadkar
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
Kamran Khan
 
Hardware-Software Codesign
Hardware-Software CodesignHardware-Software Codesign
Hardware-Software Codesign
Sudhanshu Janwadkar
 
Introduction to RTOS
Introduction to RTOSIntroduction to RTOS
Introduction to RTOS
Yong Heui Cho
 
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
FastBit Embedded Brain Academy
 

What's hot (20)

Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
Rtos by shibu
Rtos by shibuRtos by shibu
Rtos by shibu
 
Intro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication ProtocolsIntro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication Protocols
 
Rtos concepts
Rtos conceptsRtos concepts
Rtos concepts
 
REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1REAL TIME OPERATING SYSTEM PART 1
REAL TIME OPERATING SYSTEM PART 1
 
Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1Real time operating systems (rtos) concepts 1
Real time operating systems (rtos) concepts 1
 
Real Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded SystemsReal Time Operating Systems for Embedded Systems
Real Time Operating Systems for Embedded Systems
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
 
Real time scheduling - basic concepts
Real time scheduling - basic conceptsReal time scheduling - basic concepts
Real time scheduling - basic concepts
 
VLIW Processors
VLIW ProcessorsVLIW Processors
VLIW Processors
 
Vx works RTOS
Vx works RTOSVx works RTOS
Vx works RTOS
 
Design of embedded systems
Design of embedded systemsDesign of embedded systems
Design of embedded systems
 
Real Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsReal Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systems
 
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-1 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-1 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
 
Arm processor
Arm processorArm processor
Arm processor
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
Real time operating system
Real time operating systemReal time operating system
Real time operating system
 
Hardware-Software Codesign
Hardware-Software CodesignHardware-Software Codesign
Hardware-Software Codesign
 
Introduction to RTOS
Introduction to RTOSIntroduction to RTOS
Introduction to RTOS
 
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with DebuggingPART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
PART-3 : Mastering RTOS FreeRTOS and STM32Fx with Debugging
 

Viewers also liked

INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLSINTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
JOLLUSUDARSHANREDDY
 
FreeRTOS
FreeRTOSFreeRTOS
FreeRTOS
Ankita Tiwari
 
Free rtos seminar
Free rtos seminarFree rtos seminar
Free rtos seminar
Cho Daniel
 
Representation image
Representation imageRepresentation image
Representation image
Zena Abo-Altaheen
 
Rtos ameba
Rtos amebaRtos ameba
Rtos ameba
Jou Neo
 
FreeRTOS
FreeRTOSFreeRTOS
FreeRTOSquakke
 
comparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithmcomparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithm
chezhiyan chezhiyan
 
Introduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical ApproachIntroduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical Approach
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Actuators er.sanyam s. saini (me regular)
Actuators er.sanyam s. saini  (me regular)Actuators er.sanyam s. saini  (me regular)
Actuators er.sanyam s. saini (me regular)Sanyam Singh
 
Image compression
Image compressionImage compression
Image compression
Ale Johnsan
 
Sensors & Actuators
Sensors & Actuators Sensors & Actuators
Sensors & Actuators
Abdul Abbasi
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
Tawose Olamide Timothy
 
Sensors and actuators
Sensors and actuatorsSensors and actuators
Sensors and actuatorsnazibhmd
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation pptGichelle Amon
 

Viewers also liked (20)

INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLSINTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
INTERRUPT ROUTINES IN RTOS EN VIRONMENT HANDELING OF INTERRUPT SOURCE CALLS
 
FreeRTOS Course - Queue Management
FreeRTOS Course - Queue ManagementFreeRTOS Course - Queue Management
FreeRTOS Course - Queue Management
 
FreeRTOS
FreeRTOSFreeRTOS
FreeRTOS
 
Free FreeRTOS Course-Task Management
Free FreeRTOS Course-Task ManagementFree FreeRTOS Course-Task Management
Free FreeRTOS Course-Task Management
 
Free rtos seminar
Free rtos seminarFree rtos seminar
Free rtos seminar
 
Representation image
Representation imageRepresentation image
Representation image
 
Rtos ameba
Rtos amebaRtos ameba
Rtos ameba
 
FreeRTOS
FreeRTOSFreeRTOS
FreeRTOS
 
comparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithmcomparision of lossy and lossless image compression using various algorithm
comparision of lossy and lossless image compression using various algorithm
 
Introduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical ApproachIntroduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical Approach
 
Actuators er.sanyam s. saini (me regular)
Actuators er.sanyam s. saini  (me regular)Actuators er.sanyam s. saini  (me regular)
Actuators er.sanyam s. saini (me regular)
 
Dip Image Segmentation
Dip Image SegmentationDip Image Segmentation
Dip Image Segmentation
 
Image compression
Image compressionImage compression
Image compression
 
Sensors & Actuators
Sensors & Actuators Sensors & Actuators
Sensors & Actuators
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
 
Sensors and actuators
Sensors and actuatorsSensors and actuators
Sensors and actuators
 
Image segmentation ppt
Image segmentation pptImage segmentation ppt
Image segmentation ppt
 
Actuators.ppt
Actuators.pptActuators.ppt
Actuators.ppt
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 

Similar to How to Measure RTOS Performance

2 colin walls - how to measure rtos performance
2    colin walls - how to measure rtos performance2    colin walls - how to measure rtos performance
2 colin walls - how to measure rtos performance
Ievgenii Katsan
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
Pratik Gohel
 
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.
Atollic
 
Lecture10_RealTimeOperatingSystems.pptx
Lecture10_RealTimeOperatingSystems.pptxLecture10_RealTimeOperatingSystems.pptx
Lecture10_RealTimeOperatingSystems.pptx
SekharSankuri1
 
OpenPOWER Webinar
OpenPOWER Webinar OpenPOWER Webinar
OpenPOWER Webinar
Ganesan Narayanasamy
 
Unit 2 processor&memory-organisation
Unit 2 processor&memory-organisationUnit 2 processor&memory-organisation
Unit 2 processor&memory-organisation
Pavithra S
 
Unit 1 processormemoryorganisation
Unit 1 processormemoryorganisationUnit 1 processormemoryorganisation
Unit 1 processormemoryorganisation
Karunamoorthy B
 
Ec8791 unit 5 processes and operating systems
Ec8791 unit 5 processes and operating systemsEc8791 unit 5 processes and operating systems
Ec8791 unit 5 processes and operating systems
RajalakshmiSermadurai
 
Real-Time Operating Systems Real-Time Operating Systems RTOS .ppt
Real-Time Operating Systems Real-Time Operating Systems RTOS .pptReal-Time Operating Systems Real-Time Operating Systems RTOS .ppt
Real-Time Operating Systems Real-Time Operating Systems RTOS .ppt
lematadese670
 
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Amazon Web Services
 
MCI-Unit_1.PPTX electronics communication Engineering
MCI-Unit_1.PPTX electronics communication EngineeringMCI-Unit_1.PPTX electronics communication Engineering
MCI-Unit_1.PPTX electronics communication Engineering
KongaMadhukar
 
CPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performance
Coburn Watson
 
Embedded systems-unit-1
Embedded systems-unit-1Embedded systems-unit-1
Embedded systems-unit-1
Prabhu Mali
 
SECURITY SOFTWARE RESOLIUTIONS (SSR) .docx
SECURITY SOFTWARE RESOLIUTIONS (SSR)                              .docxSECURITY SOFTWARE RESOLIUTIONS (SSR)                              .docx
SECURITY SOFTWARE RESOLIUTIONS (SSR) .docx
bagotjesusa
 
esunit1.pptx
esunit1.pptxesunit1.pptx
esunit1.pptx
AmitKumar7572
 
Autosar Basics hand book_v1
Autosar Basics  hand book_v1Autosar Basics  hand book_v1
Autosar Basics hand book_v1
Keroles karam khalil
 
Hyper Threading Technology
Hyper Threading TechnologyHyper Threading Technology
Hyper Threading Technologynayakslideshare
 
Basics of embedded system design
Basics of embedded system designBasics of embedded system design
Basics of embedded system design
K Senthil Kumar
 

Similar to How to Measure RTOS Performance (20)

2 colin walls - how to measure rtos performance
2    colin walls - how to measure rtos performance2    colin walls - how to measure rtos performance
2 colin walls - how to measure rtos performance
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
 
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.
Advanced debugging on ARM Cortex devices such as STM32, Kinetis, LPC, etc.
 
Lecture10_RealTimeOperatingSystems.pptx
Lecture10_RealTimeOperatingSystems.pptxLecture10_RealTimeOperatingSystems.pptx
Lecture10_RealTimeOperatingSystems.pptx
 
OpenPOWER Webinar
OpenPOWER Webinar OpenPOWER Webinar
OpenPOWER Webinar
 
Unit 2 processor&memory-organisation
Unit 2 processor&memory-organisationUnit 2 processor&memory-organisation
Unit 2 processor&memory-organisation
 
Unit 1 processormemoryorganisation
Unit 1 processormemoryorganisationUnit 1 processormemoryorganisation
Unit 1 processormemoryorganisation
 
Rtos 2
Rtos 2Rtos 2
Rtos 2
 
Ec8791 unit 5 processes and operating systems
Ec8791 unit 5 processes and operating systemsEc8791 unit 5 processes and operating systems
Ec8791 unit 5 processes and operating systems
 
Real-Time Operating Systems Real-Time Operating Systems RTOS .ppt
Real-Time Operating Systems Real-Time Operating Systems RTOS .pptReal-Time Operating Systems Real-Time Operating Systems RTOS .ppt
Real-Time Operating Systems Real-Time Operating Systems RTOS .ppt
 
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013
 
MCI-Unit_1.PPTX electronics communication Engineering
MCI-Unit_1.PPTX electronics communication EngineeringMCI-Unit_1.PPTX electronics communication Engineering
MCI-Unit_1.PPTX electronics communication Engineering
 
CPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performanceCPN302 your-linux-ami-optimization-and-performance
CPN302 your-linux-ami-optimization-and-performance
 
Embedded systems-unit-1
Embedded systems-unit-1Embedded systems-unit-1
Embedded systems-unit-1
 
SECURITY SOFTWARE RESOLIUTIONS (SSR) .docx
SECURITY SOFTWARE RESOLIUTIONS (SSR)                              .docxSECURITY SOFTWARE RESOLIUTIONS (SSR)                              .docx
SECURITY SOFTWARE RESOLIUTIONS (SSR) .docx
 
esunit1.pptx
esunit1.pptxesunit1.pptx
esunit1.pptx
 
Autosar Basics hand book_v1
Autosar Basics  hand book_v1Autosar Basics  hand book_v1
Autosar Basics hand book_v1
 
Hyper Threading Technology
Hyper Threading TechnologyHyper Threading Technology
Hyper Threading Technology
 
Basics of embedded system design
Basics of embedded system designBasics of embedded system design
Basics of embedded system design
 
Coa presentation3
Coa presentation3Coa presentation3
Coa presentation3
 

More from mentoresd

Getting Your Medical Device FDA Approved
Getting Your Medical Device FDA ApprovedGetting Your Medical Device FDA Approved
Getting Your Medical Device FDA Approved
mentoresd
 
Security for io t apr 29th mentor embedded hangout
Security for io t apr 29th mentor embedded hangoutSecurity for io t apr 29th mentor embedded hangout
Security for io t apr 29th mentor embedded hangout
mentoresd
 
Internet of Things Connectivity for Embedded Devices
Internet of Things Connectivity for Embedded DevicesInternet of Things Connectivity for Embedded Devices
Internet of Things Connectivity for Embedded Devices
mentoresd
 
Technology, Business and Regulation of the Connected Car
Technology, Business and Regulation of the Connected CarTechnology, Business and Regulation of the Connected Car
Technology, Business and Regulation of the Connected Car
mentoresd
 
Meeting SEP 2.0 Compliance: Developing Power Aware Embedded Systems for the M...
Meeting SEP 2.0 Compliance: Developing Power Aware Embedded Systems for the M...Meeting SEP 2.0 Compliance: Developing Power Aware Embedded Systems for the M...
Meeting SEP 2.0 Compliance: Developing Power Aware Embedded Systems for the M...
mentoresd
 
Profiling Multicore Systems to Maximize Core Utilization
Profiling Multicore Systems to Maximize Core Utilization Profiling Multicore Systems to Maximize Core Utilization
Profiling Multicore Systems to Maximize Core Utilization
mentoresd
 
Developing the Next Generation Embedded HMIs
Developing the Next Generation Embedded HMIs Developing the Next Generation Embedded HMIs
Developing the Next Generation Embedded HMIs
mentoresd
 
Simultaneously Leveraging Linux and Android in a GENIVI compliant IVI System
Simultaneously Leveraging Linux and Android in a GENIVI compliant IVI System Simultaneously Leveraging Linux and Android in a GENIVI compliant IVI System
Simultaneously Leveraging Linux and Android in a GENIVI compliant IVI System
mentoresd
 
Power Management in Embedded Systems
Power Management in Embedded Systems Power Management in Embedded Systems
Power Management in Embedded Systems
mentoresd
 

More from mentoresd (9)

Getting Your Medical Device FDA Approved
Getting Your Medical Device FDA ApprovedGetting Your Medical Device FDA Approved
Getting Your Medical Device FDA Approved
 
Security for io t apr 29th mentor embedded hangout
Security for io t apr 29th mentor embedded hangoutSecurity for io t apr 29th mentor embedded hangout
Security for io t apr 29th mentor embedded hangout
 
Internet of Things Connectivity for Embedded Devices
Internet of Things Connectivity for Embedded DevicesInternet of Things Connectivity for Embedded Devices
Internet of Things Connectivity for Embedded Devices
 
Technology, Business and Regulation of the Connected Car
Technology, Business and Regulation of the Connected CarTechnology, Business and Regulation of the Connected Car
Technology, Business and Regulation of the Connected Car
 
Meeting SEP 2.0 Compliance: Developing Power Aware Embedded Systems for the M...
Meeting SEP 2.0 Compliance: Developing Power Aware Embedded Systems for the M...Meeting SEP 2.0 Compliance: Developing Power Aware Embedded Systems for the M...
Meeting SEP 2.0 Compliance: Developing Power Aware Embedded Systems for the M...
 
Profiling Multicore Systems to Maximize Core Utilization
Profiling Multicore Systems to Maximize Core Utilization Profiling Multicore Systems to Maximize Core Utilization
Profiling Multicore Systems to Maximize Core Utilization
 
Developing the Next Generation Embedded HMIs
Developing the Next Generation Embedded HMIs Developing the Next Generation Embedded HMIs
Developing the Next Generation Embedded HMIs
 
Simultaneously Leveraging Linux and Android in a GENIVI compliant IVI System
Simultaneously Leveraging Linux and Android in a GENIVI compliant IVI System Simultaneously Leveraging Linux and Android in a GENIVI compliant IVI System
Simultaneously Leveraging Linux and Android in a GENIVI compliant IVI System
 
Power Management in Embedded Systems
Power Management in Embedded Systems Power Management in Embedded Systems
Power Management in Embedded Systems
 

Recently uploaded

20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 

Recently uploaded (20)

20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 

How to Measure RTOS Performance

  • 1. How to Measure RTOS Performance Colin Walls colin_walls@mentor.com with acknowledgement to Faheem Sheikh & Dan Driscoll mentor.com/embedded
  • 2. Agenda Introduction RTOS Metrics Memory Footprint Interrupt Latency Scheduling Latency Timing Kernel Services Conclusions
  • 3. Agenda Introduction RTOS Metrics Memory Footprint Interrupt Latency Scheduling Latency Timing Kernel Services Conclusions
  • 4. Introduction – Why? Desktop computers Embedded systems – Infinite CPU power – Enough CPU power – just – Infinite memory – Adequate memory – none to spare – Costs nothing – Power consumption an issue – Cost normally critical
  • 5. Introduction – Choosing an RTOS RTOS solutions – Proprietary [in-house; home brew] – Commercial – At least 200 product available – Open source Asking the right questions is important Understanding the answers is critical – Pitfalls with misinterpretation
  • 6. Agenda Introduction RTOS Metrics Memory Footprint Interrupt Latency Scheduling Latency Timing Kernel Services Conclusions
  • 7. RTOS Metrics Three common categories: – Memory footprint – Program and data – Latency – Interrupt and scheduling – Services performance No real standardization – Embedded Microprocessor Benchmark Consortium (EEMBC) not widely adopted – Oriented towards CPU benchmarking
  • 8. Agenda Introduction RTOS Metrics Memory Footprint Interrupt Latency Scheduling Latency Timing Kernel Services Conclusions
  • 9. Memory Footprint RAM and ROM requirements of RTOS – On a specific platform  ROM size:  RAM size: – Kernel code – Kernel data structures – Read-only data – Global variables – Runtime library code – May need – Maybe in flash; accommodate “ROM” possibly copied to RAM
  • 10. Memory Footprint – Dependencies Key factors affect the footprint calculation CPU architecture – Huge effect on number of instructions Software configuration – Which kernel components are included – Scalability ... Compiler optimization – Reduces code size, but may adversely affect performance
  • 11. Memory Footprint – Scalability RTOS Application Memory Service #1 … rtos_call_1(); Service #2 … rtos_call_3(); Application Service #3 … Code Service #4 rtos_call_157(); … RTOS Service #271 core Service #1 Service #3 Service #157
  • 12. Memory Footprint – Measurement Making measurement need not be difficult Two key methods: – Memory MAP file – Generated by standard linkers – Quality and detail varies between tools – Specific tool – Shows footprint information for selected executable image – Example: objdump
  • 13. Memory Footprint – Importance Limited memory availability – Small on-chip memory – No external memory option – Application code is priority Larger systems – Kernel performance a priority – Place in on-chip memory – Lock into cache Using a bootloader – Non-volatile memory and RAM space used
  • 14. Memory Footprint – Pitfalls Vendor data can be readily misinterpreted Look at minimum configuration definition – It may be a tiny, impractical subset Runtime library functions are often not included RAM/ROM sizes should have a min/max range – RAM is likely to be application dependent – ROM driven by kernel configuration – Need minimum “useable” size – Also maximum measure with all services – Scalability variable – may be different kernel versions
  • 15. Memory Footprint – Example Nucleus RTOS kernel is fully scalable Example: ARM Cortex A8 in ARM mode Built with Mentor Sourcery CodeBench toolchain Full optimization for size ROM = 12-30 Kbytes RAM = 500 bytes
  • 16. Memory Footprint – Example Min has essential kernel services [dynamic memory, threads, semaphores, events, queues] – Runtime library excluded Max includes all kernel services Compiling for Thumb-2 mode reduces ROM by 35% – So Nucleus kernel can use 7.8 Kbytes on a Cortex-M based controller
  • 17. Agenda Introduction RTOS Metrics Memory Footprint Interrupt Latency Scheduling Latency Timing Kernel Services Conclusions
  • 18. Interrupt Latency Definitions of interrupt latency
  • 19. Interrupt Latency – Definition Different definitions System: Time between interrupt assertion and the instant an observable response happens OS: Duration of when the CPU was interrupted until the start of the corresponding interrupt service routine (ISR) – This is really OS overhead – Many vendors refer to this as the latency – Hence often report zero latency
  • 20. Interrupt Latency – Measurement Interrupt response is the sum of two distinct times: ƮIL = ƮH + ƮOS where: ƮH is the hardware dependent time – depends on the interrupt controller on the board as well as the type of the interrupt ƮOS is the OS induced overhead – Best and worst case scenarios – Worst when kernel disables interrupts
  • 21. Interrupt Latency – Measurement Best approach is to record time between interrupts source and response – Use an oscilloscope – For example: – One GPIO pin can generate an interrupt – Another pin toggled at the start of the ISR
  • 22. Interrupt Latency – Importance Specific types of designs rely on this metric: – Time critical – Fault tolerant If high I/O bandwidth is needed, measure the latency of a particular interrupt Most systems can tolerate interrupt latency of tens of microseconds
  • 23. Interrupt Latency – Pitfalls Main danger is interpretation of published figures Key factors to check: Hardware configuration OS configuration – Which platform? – Where is code running – CPU speed? from? [Flash, SDRAM ...] – Cache configuration? – Which interrupt used? – Timer frequency? – Code optimized for speed? – Interrupt controller type? – Is metric best or average case?
  • 24. Interrupt Latency – Example Nucleus RTOS – ARM Cortex A8 – 600MHz – Running from SRAM Average interrupt latency of less than 0.5 microseconds
  • 25. Agenda Introduction RTOS Metrics Memory Footprint Interrupt Latency Scheduling Latency Timing Kernel Services Conclusions
  • 26. Scheduling Latency – Definition Performance of RTOS thread scheduler Very wide variation in measurement technique and interpretation Two distinct related quantities: – Context switch time – Scheduling overhead
  • 27. Scheduling Latency – Definition Context switch time
  • 28. Scheduling Latency – Definition Scheduling overhead
  • 29. Scheduling Latency – Measurement Scheduling latency is the maximum of two times: ƮSL = MAX(ƮSO, ƮCS) where: ƮSO is the scheduling overhead – End of ISR to start of task schedule ƮCS is the time taken to save and restore thread context
  • 30. Scheduling Latency – Importance Most systems that have stringent interrupt latency demands also need low scheduling latency Broadly, systems that are: – Time critical – Fault tolerant
  • 31. Scheduling Latency – Pitfalls Ignoring initial system state – If system is idle, there is no time taken saving context Key factors to check: Hardware configuration OS configuration – Which platform? – Where is code running – CPU speed? from? [Flash, SDRAM ...] – Cache configuration? – Which interrupt used? – Timer frequency? – Code optimized for speed? – Interrupt controller type? – Is metric best or average case?
  • 32. Scheduling Latency – Example Nucleus RTOS – ARM Cortex A8 – 600MHz – Running from SRAM Scheduling latency is 1.3 microseconds
  • 33. Agenda Introduction RTOS Metrics Memory Footprint Interrupt Latency Scheduling Latency Timing Kernel Services Conclusions
  • 34. Timing Kernel Services RTOS may have a great many API calls Timing of keys ones may be of interest – Focus on frequently used API calls Four key categories: – Threading services – Synchronization services – Inter-process communication services – Memory services
  • 35. Timing Kernel Services Threading Services – Control of fundamental kernel functionality: – Create thread – Start thread – Resume thread – Stop thread – Many multi-taking applications make heavy use of these calls
  • 36. Timing Kernel Services Synchronization Services – Services to synchronize between contexts, like an ISR and a thread – Also protection of critical code sections from concurrent access – e.g. Semaphore may be used by Ethernet ISR to write data into shared memory that is also used by a task – Timing is important is the application has numerous shared resources or peripherals
  • 37. Timing Kernel Services Inter-process Communication Services – Services to share data between multiple threads – Examples: – FIFOs – Queues – Mailboxes – Event flags – Many multi-taking applications make heavy use of this type of service
  • 38. Timing Kernel Services Memory Services – In a multi-threaded context, kernel is used to manage dynamic memory – Allocation and de-allocation times are important – Applications with large data throughput are particularly sensitive
  • 39. Timing Kernel Services – Pitfalls Hardware configuration – Which platform? – CPU speed? – Cache configuration? OS configuration – Where is code running from? [Flash, SDRAM ...] – Code optimized for speed? – Is metric best or average case? – Is kernel configured for reduced error checking?
  • 40. Timing Kernel Services – Example Nucleus RTOS Kernel Service Time in µS Task resumption 0.3 Task suspension 0.3 Obtaining a semaphore 0.5 Set an event 0.4 Send message to queue 0.9 Allocate memory 0.2 De-allocate memory 0.7 Allocate partition 0.4
  • 41. Agenda Introduction RTOS Metrics Memory Footprint Interrupt Latency Scheduling Latency Timing Kernel Services Conclusions
  • 42. Conclusions RTOS performance data provided by vendors can be useful It can also be misleading if it is misinterpreted Need a thorough understanding of: – Measurement techniques – Terminology – Trade-offs to conduct fair comparison Recommendation is to rely on holistic or application- oriented measurements
  • 43. Thank you Colin Walls colin_walls@mentor.com http://blogs.mentor.com/colinwalls See white paper: "Measuring RTOS Performance: What? Why? How?" mentor.com/embedded