mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2026-11-10 22:04:27 +08:00
Run unctustify, fix some Readme wording
This commit is contained in:
1 parent
a2029c781c
commit
0c0333985b
13 files changed
+1589
-1527
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -63,7 +63,7 @@ SOURCE_FILES += ${FREERTOS_PLUS_DIR}/Source/FreeRTOS-Plus-Trace/streamp
|
||||
|
||||
CFLAGS := -ggdb3 -DprojCOVERAGE_TEST=0 -D_WINDOWS_
|
||||
LDFLAGS := -ggdb3 -pthread
|
||||
CPPFLAGS := $(INCLUDE_DIRS) -DBUILD_DIR=\"$(BUILD_DIR_ABS)\"
|
||||
CPPFLAGS := $(INCLUDE_DIRS) -DBUILD_DIR=\"$(BUILD_DIR_ABS)\"
|
||||
|
||||
ifdef PROFILE
|
||||
CFLAGS += -pg -O0
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
## Introduction [(from the official gprof doc)](https://sourceware.org/binutils/docs/gprof/Introduction.html#Introduction)
|
||||
Profiling allows you to learn where your program spent its time and which
|
||||
functions called which other functions while it was executing. This information
|
||||
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
|
||||
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.
|
||||
expected. This may help you spot bugs that had otherwise been unnoticed.
|
||||
|
||||
## Requirements
|
||||
### gprof
|
||||
@@ -25,26 +25,33 @@ Run your application
|
||||
$ ./build/possix_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 indented task. Killing the
|
||||
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
|
||||
```
|
||||
two (2) files *prof_call_graph.txt* and *prof_flat.txt* will be generated in the
|
||||
build directory.
|
||||
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](https://sourceware.org/binutils/docs/gprof/Output.html#Output)
|
||||
official documentation of gprof
|
||||
[here](https://sourceware.org/binutils/docs/gprof/Output.html#Output)
|
||||
|
||||
|
||||
# Run your application with Sanitizers
|
||||
## Introduction
|
||||
* AddressSanitizer, a fast memory error detector. Memory
|
||||
* 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
|
||||
* 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
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -25,8 +25,8 @@
|
||||
*/
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Example console I/O wrappers.
|
||||
*----------------------------------------------------------*/
|
||||
* Example console I/O wrappers.
|
||||
*----------------------------------------------------------*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
@@ -37,22 +37,23 @@
|
||||
SemaphoreHandle_t xStdioMutex;
|
||||
StaticSemaphore_t xStdioMutexBuffer;
|
||||
|
||||
void console_init(void)
|
||||
void console_init( void )
|
||||
{
|
||||
xStdioMutex = xSemaphoreCreateMutexStatic(&xStdioMutexBuffer);
|
||||
xStdioMutex = xSemaphoreCreateMutexStatic( &xStdioMutexBuffer );
|
||||
}
|
||||
|
||||
void console_print(const char *fmt, ...)
|
||||
void console_print( const char * fmt,
|
||||
... )
|
||||
{
|
||||
va_list vargs;
|
||||
|
||||
va_start(vargs, fmt);
|
||||
|
||||
xSemaphoreTake(xStdioMutex, portMAX_DELAY);
|
||||
va_start( vargs, fmt );
|
||||
|
||||
vprintf(fmt, vargs);
|
||||
xSemaphoreTake( xStdioMutex, portMAX_DELAY );
|
||||
|
||||
xSemaphoreGive(xStdioMutex);
|
||||
vprintf( fmt, vargs );
|
||||
|
||||
va_end(vargs);
|
||||
xSemaphoreGive( xStdioMutex );
|
||||
|
||||
va_end( vargs );
|
||||
}
|
||||
@@ -25,21 +25,22 @@
|
||||
*/
|
||||
|
||||
#ifndef CONSOLE_H
|
||||
#define CONSOLE_H
|
||||
#define CONSOLE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Example console I/O wrappers.
|
||||
*----------------------------------------------------------*/
|
||||
* Example console I/O wrappers.
|
||||
*----------------------------------------------------------*/
|
||||
|
||||
void console_init(void);
|
||||
void console_print(const char *fmt, ...);
|
||||
void console_init( void );
|
||||
void console_print( const char * fmt,
|
||||
... );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONSOLE_H */
|
||||
+139
-134
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+589
-581
File diff suppressed because it is too large.
Load diff
@@ -34,7 +34,7 @@
|
||||
*
|
||||
* Also note that it is assumed this demo is going to be used for short periods
|
||||
* of time only, and therefore timer overflows are not handled.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
|
||||
@@ -48,20 +48,20 @@ static unsigned long ulStartTimeNs;
|
||||
|
||||
void vConfigureTimerForRunTimeStats( void )
|
||||
{
|
||||
struct timespec xNow;
|
||||
struct timespec xNow;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &xNow);
|
||||
ulStartTimeNs = xNow.tv_sec * 1000000000ul + xNow.tv_nsec;
|
||||
clock_gettime( CLOCK_MONOTONIC, &xNow );
|
||||
ulStartTimeNs = xNow.tv_sec * 1000000000ul + xNow.tv_nsec;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
unsigned long ulGetRunTimeCounterValue( void )
|
||||
{
|
||||
struct timespec xNow;
|
||||
struct timespec xNow;
|
||||
|
||||
/* Time at start. */
|
||||
clock_gettime(CLOCK_MONOTONIC, &xNow);
|
||||
/* Time at start. */
|
||||
clock_gettime( CLOCK_MONOTONIC, &xNow );
|
||||
|
||||
return xNow.tv_sec * 1000000000ul + xNow.tv_nsec - ulStartTimeNs;
|
||||
return xNow.tv_sec * 1000000000ul + xNow.tv_nsec - ulStartTimeNs;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
+102
-101
File diff suppressed because it is too large.
Load diff
@@ -46,8 +46,8 @@
|
||||
#ifndef TRC_SNAPSHOT_CONFIG_H
|
||||
#define TRC_SNAPSHOT_CONFIG_H
|
||||
|
||||
#define TRC_SNAPSHOT_MODE_RING_BUFFER (0x01)
|
||||
#define TRC_SNAPSHOT_MODE_STOP_WHEN_FULL (0x02)
|
||||
#define TRC_SNAPSHOT_MODE_RING_BUFFER ( 0x01 )
|
||||
#define TRC_SNAPSHOT_MODE_STOP_WHEN_FULL ( 0x02 )
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_SNAPSHOT_MODE
|
||||
@@ -67,7 +67,7 @@
|
||||
* recording is stopped when the buffer becomes full. This is useful for
|
||||
* recording events following a specific state, e.g., the startup sequence.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_SNAPSHOT_MODE TRC_SNAPSHOT_MODE_RING_BUFFER
|
||||
#define TRC_CFG_SNAPSHOT_MODE TRC_SNAPSHOT_MODE_RING_BUFFER
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_EVENT_BUFFER_SIZE
|
||||
@@ -82,7 +82,7 @@
|
||||
* Default value is 1000, which means that 4000 bytes is allocated for the
|
||||
* event buffer.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_EVENT_BUFFER_SIZE 32000
|
||||
#define TRC_CFG_EVENT_BUFFER_SIZE 32000
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_NTASK, TRC_CFG_NISR, TRC_CFG_NQUEUE, TRC_CFG_NSEMAPHORE...
|
||||
@@ -106,15 +106,15 @@
|
||||
* check the actual usage by selecting View menu -> Trace Details ->
|
||||
* Resource Usage -> Object Table.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_NTASK 150
|
||||
#define TRC_CFG_NISR 90
|
||||
#define TRC_CFG_NQUEUE 90
|
||||
#define TRC_CFG_NSEMAPHORE 90
|
||||
#define TRC_CFG_NMUTEX 90
|
||||
#define TRC_CFG_NTIMER 250
|
||||
#define TRC_CFG_NEVENTGROUP 90
|
||||
#define TRC_CFG_NSTREAMBUFFER 100
|
||||
#define TRC_CFG_NMESSAGEBUFFER 100
|
||||
#define TRC_CFG_NTASK 150
|
||||
#define TRC_CFG_NISR 90
|
||||
#define TRC_CFG_NQUEUE 90
|
||||
#define TRC_CFG_NSEMAPHORE 90
|
||||
#define TRC_CFG_NMUTEX 90
|
||||
#define TRC_CFG_NTIMER 250
|
||||
#define TRC_CFG_NEVENTGROUP 90
|
||||
#define TRC_CFG_NSTREAMBUFFER 100
|
||||
#define TRC_CFG_NMESSAGEBUFFER 100
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@@ -133,7 +133,7 @@
|
||||
*
|
||||
* Default value is 0.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_INCLUDE_FLOAT_SUPPORT 0
|
||||
#define TRC_CFG_INCLUDE_FLOAT_SUPPORT 0
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_SYMBOL_TABLE_SIZE
|
||||
@@ -149,10 +149,10 @@
|
||||
*
|
||||
* Default value is 800.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_SYMBOL_TABLE_SIZE 32000
|
||||
#define TRC_CFG_SYMBOL_TABLE_SIZE 32000
|
||||
|
||||
#if (TRC_CFG_SYMBOL_TABLE_SIZE == 0)
|
||||
#error "TRC_CFG_SYMBOL_TABLE_SIZE may not be zero!"
|
||||
#if ( TRC_CFG_SYMBOL_TABLE_SIZE == 0 )
|
||||
#error "TRC_CFG_SYMBOL_TABLE_SIZE may not be zero!"
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
@@ -162,15 +162,15 @@
|
||||
* kernel objects, such as tasks and queues. If longer names are used, they will
|
||||
* be truncated when stored in the recorder.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_NAME_LEN_TASK 15
|
||||
#define TRC_CFG_NAME_LEN_ISR 15
|
||||
#define TRC_CFG_NAME_LEN_QUEUE 15
|
||||
#define TRC_CFG_NAME_LEN_SEMAPHORE 15
|
||||
#define TRC_CFG_NAME_LEN_MUTEX 15
|
||||
#define TRC_CFG_NAME_LEN_TIMER 15
|
||||
#define TRC_CFG_NAME_LEN_EVENTGROUP 15
|
||||
#define TRC_CFG_NAME_LEN_STREAMBUFFER 15
|
||||
#define TRC_CFG_NAME_LEN_MESSAGEBUFFER 15
|
||||
#define TRC_CFG_NAME_LEN_TASK 15
|
||||
#define TRC_CFG_NAME_LEN_ISR 15
|
||||
#define TRC_CFG_NAME_LEN_QUEUE 15
|
||||
#define TRC_CFG_NAME_LEN_SEMAPHORE 15
|
||||
#define TRC_CFG_NAME_LEN_MUTEX 15
|
||||
#define TRC_CFG_NAME_LEN_TIMER 15
|
||||
#define TRC_CFG_NAME_LEN_EVENTGROUP 15
|
||||
#define TRC_CFG_NAME_LEN_STREAMBUFFER 15
|
||||
#define TRC_CFG_NAME_LEN_MESSAGEBUFFER 15
|
||||
|
||||
/******************************************************************************
|
||||
*** ADVANCED SETTINGS ********************************************************
|
||||
@@ -190,7 +190,7 @@
|
||||
*
|
||||
* Default value is 0.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_HEAP_SIZE_BELOW_16M 0
|
||||
#define TRC_CFG_HEAP_SIZE_BELOW_16M 0
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_USE_IMPLICIT_IFE_RULES
|
||||
@@ -222,7 +222,7 @@
|
||||
* For details, see trcSnapshotKernelPort.h and look for references to the
|
||||
* macro trcKERNEL_HOOKS_SET_TASK_INSTANCE_FINISHED.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_USE_IMPLICIT_IFE_RULES 1
|
||||
#define TRC_CFG_USE_IMPLICIT_IFE_RULES 1
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_USE_16BIT_OBJECT_HANDLES
|
||||
@@ -246,7 +246,7 @@
|
||||
* the event buffer whenever the object is referenced. Moreover, some internal
|
||||
* tables in the recorder gets slightly larger when using 16-bit handles.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_USE_16BIT_OBJECT_HANDLES 0
|
||||
#define TRC_CFG_USE_16BIT_OBJECT_HANDLES 0
|
||||
|
||||
/******************************************************************************
|
||||
* TRC_CFG_USE_TRACE_ASSERT
|
||||
@@ -264,7 +264,7 @@
|
||||
* parameters. Can be switched off to reduce the footprint of the tracing, but
|
||||
* we recommend to have it enabled initially.
|
||||
*****************************************************************************/
|
||||
#define TRC_CFG_USE_TRACE_ASSERT 1
|
||||
#define TRC_CFG_USE_TRACE_ASSERT 1
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER
|
||||
@@ -320,9 +320,9 @@
|
||||
*
|
||||
* // Finds the existing UB channel
|
||||
* vTracePrintF(chn2, "%Z: %d", value2);
|
||||
|
||||
*
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER 0
|
||||
#define TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER 0
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE
|
||||
@@ -334,7 +334,7 @@
|
||||
*
|
||||
* Only applicable if TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER is 1.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE 200
|
||||
#define TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE 200
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_UB_CHANNELS
|
||||
@@ -348,7 +348,7 @@
|
||||
*
|
||||
* Only applicable if TRC_CFG_USE_SEPARATE_USER_EVENT_BUFFER is 1.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_UB_CHANNELS 32
|
||||
#define TRC_CFG_UB_CHANNELS 32
|
||||
|
||||
/*******************************************************************************
|
||||
* TRC_CFG_ISR_TAILCHAINING_THRESHOLD
|
||||
@@ -373,6 +373,6 @@
|
||||
* Note: This setting has separate definitions in trcSnapshotConfig.h and
|
||||
* trcStreamingConfig.h, since it is affected by the recorder mode.
|
||||
******************************************************************************/
|
||||
#define TRC_CFG_ISR_TAILCHAINING_THRESHOLD 0
|
||||
#define TRC_CFG_ISR_TAILCHAINING_THRESHOLD 0
|
||||
|
||||
#endif /*TRC_SNAPSHOT_CONFIG_H*/
|
||||
@@ -204,6 +204,7 @@ cg
|
||||
ch
|
||||
chacha
|
||||
chachapoly
|
||||
chdir
|
||||
checklogin
|
||||
checknullarg
|
||||
checktimer
|
||||
@@ -777,6 +778,7 @@ gir
|
||||
girq
|
||||
girqm
|
||||
github
|
||||
gmon
|
||||
gnd
|
||||
gnuc
|
||||
googleapis
|
||||
@@ -2158,6 +2160,7 @@ shouldn
|
||||
shtml
|
||||
sice
|
||||
sifive
|
||||
sigint
|
||||
signalled
|
||||
signatureverificationstate
|
||||
signatureverificationstateptr
|
||||
|
||||
Reference in new issue
Block a user