Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

Processor occupancy tracing: why isn't it there?

Posted by erupter on June 13, 2014

I'm thinking about using the TASKSWITCHEDIN/OUT macros to record the time spent in processing time by each task. This is something available on every operating system and I wonder why that isn't part of the normal tracing capabilities.

Surely there is a reason for not including such a functionality by default?


Processor occupancy tracing: why isn't it there?

Posted by davedoors on June 13, 2014

http://www.freertos.org/rtos-run-time-stats.html

You just have to fill in the macro that returns the time stamp, which can't be part of the standard kernel code because where it comes from depends on the mcu you are using and which timers are free on that mcu. There are some standard ways of providing the time stamp on Cortex mcus that use raw systick timer values.

you can also look at http://www.freertos.org/uxTaskGetSystemState.html and http://www.freertos.org/FreeRTOS-Plus/FreeRTOSPlusTrace/FreeRTOSPlusTrace.shtml


Processor occupancy tracing: why isn't it there?

Posted by erupter on June 13, 2014

Thanks Dave

I'm again getting up to speed on FreeRTOS after years, and I totally forgot about this -_- By looking into my old code I had the runtime stats setup already, with the core timer and everything.

I'm getting old :P I remember reading something about the impact of the tracing features, but can't find it. Do you know anything about this?


Processor occupancy tracing: why isn't it there?

Posted by davedoors on June 13, 2014

The timing impact? Well, as with all the features that add code (stack overflow detection, assert points, and the like) there is a code size and execution speed impact. The impact of gathering run time information depends on the implementation of the function that returns the time stamp. If it is simply reading a register then the impact will be one read, and one write, per context switch (actually, probably a little more). If the time stamp needs to be pre-processed then the impact will be higher.

Formatting statistical information into human readable table is another matter. That takes a long time and is not really something you want to be doing outside of your debug code.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner