FreeRTOS-Kernel/FreeRTOS/Demo/Posix_GCC
johnrhen 43defa566c
Apply release changes to main branch (#759)
* Update History.txt and README.md for December release (#744)

* Update History.txt and README.md for release

* Bump mbedtls submodule to v2.28.0 (#745)

* Patch project files for mbedtls (#751)

* Apply group 1 patches

* Apply patches for group 2

* Update project files for mbedTLS new version

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Fix warnings in projects

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Fix warnings in HTTP_S3_Download demo

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>

* Update changelog and history for corePKCS11 update (#752)

* Update submodule pointer and manifest.yml for corePKCS11 (#754)

* Update readme and history.txt to show that Sigv4 is a newly added library (#756)

* Revert update to v143 of VS toolset (#757)

* [AUTO][RELEASE]: Bump file header version to "202112.00"

* Update file headers to satisfy core checks

Co-authored-by: Muneeb Ahmed <54290492+muneebahmed10@users.noreply.github.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: johnrhen <johnrhen@users.noreply.github.com>
2021-12-23 10:16:27 -08:00
..
.gitignore Demo/Posix_GCC: add demo application for Posix port using GCC 2020-03-24 13:46:18 -07:00
code_coverage_additions.c Apply release changes to main branch (#759) 2021-12-23 10:16:27 -08:00
console.c Apply release changes to main branch (#759) 2021-12-23 10:16:27 -08:00
console.h Apply release changes to main branch (#759) 2021-12-23 10:16:27 -08:00
FreeRTOS-simulator-for-Linux.url Added some URL files and move submodule pointer along (#254) 2020-09-09 14:31:07 -07:00
FreeRTOSConfig.h Apply release changes to main branch (#759) 2021-12-23 10:16:27 -08:00
main.c Apply release changes to main branch (#759) 2021-12-23 10:16:27 -08:00
main_blinky.c Apply release changes to main branch (#759) 2021-12-23 10:16:27 -08:00
main_full.c Apply release changes to main branch (#759) 2021-12-23 10:16:27 -08:00
Makefile Demo: fix trace vs coverage options, add option no trace on enter 2021-06-09 16:08:24 -07:00
Readme.md Fixed some typos in the readme in the Posix_GCC demo (#697) 2021-11-03 14:25:38 -07:00
run-time-stats-utils.c Apply release changes to main branch (#759) 2021-12-23 10:16:27 -08:00
trcConfig.h Run unctustify, fix some Readme wording 2021-05-27 20:07:54 -07:00
trcSnapshotConfig.h Run unctustify, fix some Readme wording 2021-05-27 20:07:54 -07:00

Profiling your application

Introduction (from the official gprof doc)

Profiling allows you to learn where your program spent its time and which functions called which other functions while it was executing. This information can show you which pieces of your program are slower than you expected, and might be candidates for rewriting to make your program execute faster. It can also tell you which functions are being called more or less often than you expected. This may help you spot bugs that had otherwise been unnoticed.

Requirements

gprof

Version as tested: GNU gprof (GNU Binutils) 2.36

make

Version as tested: GNU Make 3.82

gcc

Version as tested: gcc (GCC) 11.0.0

Generating Profiles

$ make PROFILE=1

Run your application

$ ./build/posix_demo

Since FreeRTOS and its application never come to an end and typically run forever. The user has to kill the application with Ctrl_C when they feel satisfied that the application achieved its intented task. Killing the application will force the profiling file gmon.out to be generated automatically. In order to make sense of this file, the user has to convert the file with:

$ make profile

After running the previous command, two (2) profiling files prof_call_graph.txt and prof_flat.txt will be generated and placed in the build directory.

  • prof_call_graph.txt: The call graph shows which functions called which others, and how much time each function used when its subroutine calls are included.
  • prof_flat.txt: The flat profile shows how much time was spent executing directly in each function. In order to understand the outputs generated, the best way is to read the official documentation of gprof here

Run your application with Sanitizers

Introduction

  • AddressSanitizer, a fast memory error detector. Memory access instructions are instrumented to detect out-of-bounds and use-after-free bugs
  • LeakSanitizer, a memory leak detector. This option only matters for linking of executables and the executable is linked against a library that overrides malloc and other allocator functions

Requirements

gcc

Version as tested: gcc (GCC) 11.0.0

Building and Running the Application

$ make SANITIZE_ADDRESS=1
or
$ make SANITIZE_LEAK=1

Then run your program normally.

$ ./build/posix_demo

If an error is detected by the sanitizer, a report showing the error will be printed to stdout.