Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit 20d60b7

Browse files
RTX5: update configuration (Event Recorder)
Event Recorder filter setup can be enabled or disabled per group.
1 parent 88f2b4f commit 20d60b7

4 files changed

Lines changed: 91 additions & 102 deletions

File tree

ARM.CMSIS.pdsc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2936,7 +2936,7 @@ and 8-bit Java bytecodes in Jazelle state.
29362936
<file category="header" name="CMSIS/RTOS2/RTX/Include/rtx_os.h"/>
29372937

29382938
<!-- RTX configuration -->
2939-
<file category="header" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.h" version="5.5.1"/>
2939+
<file category="header" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.h" version="5.5.2"/>
29402940
<file category="source" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.c" version="5.1.1"/>
29412941

29422942
<!-- RTX templates -->
@@ -3027,7 +3027,7 @@ and 8-bit Java bytecodes in Jazelle state.
30273027
<file category="header" name="CMSIS/RTOS2/RTX/Include/rtx_os.h"/>
30283028

30293029
<!-- RTX configuration -->
3030-
<file category="header" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.h" version="5.5.1"/>
3030+
<file category="header" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.h" version="5.5.2"/>
30313031
<file category="source" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.c" version="5.1.1"/>
30323032

30333033
<!-- RTX templates -->
@@ -3097,7 +3097,7 @@ and 8-bit Java bytecodes in Jazelle state.
30973097
<file category="header" name="CMSIS/RTOS2/RTX/Include/rtx_os.h"/>
30983098

30993099
<!-- RTX configuration -->
3100-
<file category="header" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.h" version="5.5.1"/>
3100+
<file category="header" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.h" version="5.5.2"/>
31013101
<file category="source" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.c" version="5.1.1"/>
31023102

31033103
<!-- RTX templates -->
@@ -3204,7 +3204,7 @@ and 8-bit Java bytecodes in Jazelle state.
32043204
<file category="header" name="CMSIS/RTOS2/RTX/Include/rtx_os.h"/>
32053205

32063206
<!-- RTX configuration -->
3207-
<file category="header" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.h" version="5.5.1"/>
3207+
<file category="header" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.h" version="5.5.2"/>
32083208
<file category="source" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.c" version="5.1.1"/>
32093209

32103210
<file category="source" attr="config" name="CMSIS/RTOS2/RTX/Config/handlers.c" version="5.1.0"/>
@@ -3262,7 +3262,7 @@ and 8-bit Java bytecodes in Jazelle state.
32623262
<file category="header" name="CMSIS/RTOS2/RTX/Include/rtx_os.h"/>
32633263

32643264
<!-- RTX configuration -->
3265-
<file category="header" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.h" version="5.5.1"/>
3265+
<file category="header" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.h" version="5.5.2"/>
32663266
<file category="source" attr="config" name="CMSIS/RTOS2/RTX/Config/RTX_Config.c" version="5.1.1"/>
32673267

32683268
<!-- RTX templates -->

CMSIS/DoxyGen/RTOS2/src/history.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
- CVE-2021-27431 vulnerability mitigation.
105105
- Added OS Initialization for IAR.
106106
- Enhanced stack overrun checking.
107+
- Updated configuration (Event Recorder).
107108
- Reorganized and optimized IRQ modules.
108109
</td>
109110
</tr>

CMSIS/RTOS2/RTX/Config/RTX_Config.h

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013-2020 Arm Limited. All rights reserved.
2+
* Copyright (c) 2013-2021 Arm Limited. All rights reserved.
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -17,7 +17,7 @@
1717
*
1818
* -----------------------------------------------------------------------------
1919
*
20-
* $Revision: V5.5.1
20+
* $Revision: V5.5.2
2121
*
2222
* Project: CMSIS-RTOS RTX
2323
* Title: RTX Configuration definitions
@@ -367,125 +367,125 @@
367367
// <i> Recording levels for RTX components.
368368
// <i> Only applicable if events for the respective component are generated.
369369

370-
// <h>Memory Management
370+
// <e.7>Memory Management
371371
// <i> Recording level for Memory Management events.
372372
// <o.0>Error events
373373
// <o.1>API function call events
374374
// <o.2>Operation events
375375
// <o.3>Detailed operation events
376-
// </h>
377-
#ifndef OS_EVR_MEMORY_LEVEL
378-
#define OS_EVR_MEMORY_LEVEL 0x01U
376+
// </e>
377+
#ifndef OS_EVR_MEMORY_LEVEL
378+
#define OS_EVR_MEMORY_LEVEL 0x81U
379379
#endif
380380

381-
// <h>Kernel
381+
// <e.7>Kernel
382382
// <i> Recording level for Kernel events.
383383
// <o.0>Error events
384384
// <o.1>API function call events
385385
// <o.2>Operation events
386386
// <o.3>Detailed operation events
387-
// </h>
388-
#ifndef OS_EVR_KERNEL_LEVEL
389-
#define OS_EVR_KERNEL_LEVEL 0x01U
387+
// </e>
388+
#ifndef OS_EVR_KERNEL_LEVEL
389+
#define OS_EVR_KERNEL_LEVEL 0x81U
390390
#endif
391391

392-
// <h>Thread
392+
// <e.7>Thread
393393
// <i> Recording level for Thread events.
394394
// <o.0>Error events
395395
// <o.1>API function call events
396396
// <o.2>Operation events
397397
// <o.3>Detailed operation events
398-
// </h>
399-
#ifndef OS_EVR_THREAD_LEVEL
400-
#define OS_EVR_THREAD_LEVEL 0x05U
398+
// </e>
399+
#ifndef OS_EVR_THREAD_LEVEL
400+
#define OS_EVR_THREAD_LEVEL 0x85U
401401
#endif
402402

403-
// <h>Generic Wait
403+
// <e.7>Generic Wait
404404
// <i> Recording level for Generic Wait events.
405405
// <o.0>Error events
406406
// <o.1>API function call events
407407
// <o.2>Operation events
408408
// <o.3>Detailed operation events
409-
// </h>
410-
#ifndef OS_EVR_WAIT_LEVEL
411-
#define OS_EVR_WAIT_LEVEL 0x01U
409+
// </e>
410+
#ifndef OS_EVR_WAIT_LEVEL
411+
#define OS_EVR_WAIT_LEVEL 0x81U
412412
#endif
413413

414-
// <h>Thread Flags
414+
// <e.7>Thread Flags
415415
// <i> Recording level for Thread Flags events.
416416
// <o.0>Error events
417417
// <o.1>API function call events
418418
// <o.2>Operation events
419419
// <o.3>Detailed operation events
420-
// </h>
421-
#ifndef OS_EVR_THFLAGS_LEVEL
422-
#define OS_EVR_THFLAGS_LEVEL 0x01U
420+
// </e>
421+
#ifndef OS_EVR_THFLAGS_LEVEL
422+
#define OS_EVR_THFLAGS_LEVEL 0x81U
423423
#endif
424424

425-
// <h>Event Flags
425+
// <e.7>Event Flags
426426
// <i> Recording level for Event Flags events.
427427
// <o.0>Error events
428428
// <o.1>API function call events
429429
// <o.2>Operation events
430430
// <o.3>Detailed operation events
431-
// </h>
432-
#ifndef OS_EVR_EVFLAGS_LEVEL
433-
#define OS_EVR_EVFLAGS_LEVEL 0x01U
431+
// </e>
432+
#ifndef OS_EVR_EVFLAGS_LEVEL
433+
#define OS_EVR_EVFLAGS_LEVEL 0x81U
434434
#endif
435435

436-
// <h>Timer
436+
// <e.7>Timer
437437
// <i> Recording level for Timer events.
438438
// <o.0>Error events
439439
// <o.1>API function call events
440440
// <o.2>Operation events
441441
// <o.3>Detailed operation events
442-
// </h>
443-
#ifndef OS_EVR_TIMER_LEVEL
444-
#define OS_EVR_TIMER_LEVEL 0x01U
442+
// </e>
443+
#ifndef OS_EVR_TIMER_LEVEL
444+
#define OS_EVR_TIMER_LEVEL 0x81U
445445
#endif
446446

447-
// <h>Mutex
447+
// <e.7>Mutex
448448
// <i> Recording level for Mutex events.
449449
// <o.0>Error events
450450
// <o.1>API function call events
451451
// <o.2>Operation events
452452
// <o.3>Detailed operation events
453-
// </h>
454-
#ifndef OS_EVR_MUTEX_LEVEL
455-
#define OS_EVR_MUTEX_LEVEL 0x01U
453+
// </e>
454+
#ifndef OS_EVR_MUTEX_LEVEL
455+
#define OS_EVR_MUTEX_LEVEL 0x81U
456456
#endif
457457

458-
// <h>Semaphore
458+
// <e.7>Semaphore
459459
// <i> Recording level for Semaphore events.
460460
// <o.0>Error events
461461
// <o.1>API function call events
462462
// <o.2>Operation events
463463
// <o.3>Detailed operation events
464-
// </h>
465-
#ifndef OS_EVR_SEMAPHORE_LEVEL
466-
#define OS_EVR_SEMAPHORE_LEVEL 0x01U
464+
// </e>
465+
#ifndef OS_EVR_SEMAPHORE_LEVEL
466+
#define OS_EVR_SEMAPHORE_LEVEL 0x81U
467467
#endif
468468

469-
// <h>Memory Pool
469+
// <e.7>Memory Pool
470470
// <i> Recording level for Memory Pool events.
471471
// <o.0>Error events
472472
// <o.1>API function call events
473473
// <o.2>Operation events
474474
// <o.3>Detailed operation events
475-
// </h>
476-
#ifndef OS_EVR_MEMPOOL_LEVEL
477-
#define OS_EVR_MEMPOOL_LEVEL 0x01U
475+
// </e>
476+
#ifndef OS_EVR_MEMPOOL_LEVEL
477+
#define OS_EVR_MEMPOOL_LEVEL 0x81U
478478
#endif
479479

480-
// <h>Message Queue
480+
// <e.7>Message Queue
481481
// <i> Recording level for Message Queue events.
482482
// <o.0>Error events
483483
// <o.1>API function call events
484484
// <o.2>Operation events
485485
// <o.3>Detailed operation events
486-
// </h>
487-
#ifndef OS_EVR_MSGQUEUE_LEVEL
488-
#define OS_EVR_MSGQUEUE_LEVEL 0x01U
486+
// </e>
487+
#ifndef OS_EVR_MSGQUEUE_LEVEL
488+
#define OS_EVR_MSGQUEUE_LEVEL 0x81U
489489
#endif
490490

491491
// </h>

CMSIS/RTOS2/RTX/Source/rtx_lib.c

Lines changed: 39 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -360,69 +360,57 @@ __attribute__((section(".bss.os.msgqueue.mem")));
360360

361361
#if (defined(OS_EVR_INIT) && (OS_EVR_INIT != 0))
362362

363-
// Initial Thread configuration covered also Thread Flags and Generic Wait
364-
#if defined(OS_EVR_THREAD_FILTER)
365-
#if !defined(OS_EVR_THFLAGS_FILTER)
366-
#define OS_EVR_THFLAGS_FILTER OS_EVR_THREAD_FILTER
367-
#endif
368-
#if !defined(OS_EVR_WAIT_FILTER)
369-
#define OS_EVR_WAIT_FILTER OS_EVR_THREAD_FILTER
370-
#endif
371-
#endif
363+
#ifdef RTE_Compiler_EventRecorder
364+
365+
// Event Recorder Initialize
366+
__STATIC_INLINE void evr_initialize (void) {
367+
368+
(void)EventRecorderInitialize(OS_EVR_LEVEL, (uint32_t)OS_EVR_START);
372369

373-
// Migrate initial filter configuration
374-
#if defined(OS_EVR_MEMORY_FILTER)
375-
#define OS_EVR_MEMORY_LEVEL (((OS_EVR_MEMORY_FILTER & 0x80U) != 0U) ? (OS_EVR_MEMORY_FILTER & 0x0FU) : 0U)
370+
#if ((OS_EVR_MEMORY_LEVEL & 0x80U) != 0U)
371+
(void)EventRecorderEnable( OS_EVR_MEMORY_LEVEL & 0x0FU, EvtRtxMemoryNo, EvtRtxMemoryNo);
372+
(void)EventRecorderDisable(~OS_EVR_MEMORY_LEVEL & 0x0FU, EvtRtxMemoryNo, EvtRtxMemoryNo);
376373
#endif
377-
#if defined(OS_EVR_KERNEL_FILTER)
378-
#define OS_EVR_KERNEL_LEVEL (((OS_EVR_KERNEL_FILTER & 0x80U) != 0U) ? (OS_EVR_KERNEL_FILTER & 0x0FU) : 0U)
374+
#if ((OS_EVR_KERNEL_LEVEL & 0x80U) != 0U)
375+
(void)EventRecorderEnable( OS_EVR_KERNEL_LEVEL & 0x0FU, EvtRtxKernelNo, EvtRtxKernelNo);
376+
(void)EventRecorderDisable(~OS_EVR_KERNEL_LEVEL & 0x0FU, EvtRtxKernelNo, EvtRtxMemoryNo);
379377
#endif
380-
#if defined(OS_EVR_THREAD_FILTER)
381-
#define OS_EVR_THREAD_LEVEL (((OS_EVR_THREAD_FILTER & 0x80U) != 0U) ? (OS_EVR_THREAD_FILTER & 0x0FU) : 0U)
378+
#if ((OS_EVR_THREAD_LEVEL & 0x80U) != 0U)
379+
(void)EventRecorderEnable( OS_EVR_THREAD_LEVEL & 0x0FU, EvtRtxThreadNo, EvtRtxThreadNo);
380+
(void)EventRecorderDisable(~OS_EVR_THREAD_LEVEL & 0x0FU, EvtRtxThreadNo, EvtRtxThreadNo);
382381
#endif
383-
#if defined(OS_EVR_WAIT_FILTER)
384-
#define OS_EVR_WAIT_LEVEL (((OS_EVR_WAIT_FILTER & 0x80U) != 0U) ? (OS_EVR_WAIT_FILTER & 0x0FU) : 0U)
382+
#if ((OS_EVR_WAIT_LEVEL & 0x80U) != 0U)
383+
(void)EventRecorderEnable( OS_EVR_WAIT_LEVEL & 0x0FU, EvtRtxWaitNo, EvtRtxWaitNo);
384+
(void)EventRecorderDisable(~OS_EVR_WAIT_LEVEL & 0x0FU, EvtRtxWaitNo, EvtRtxWaitNo);
385385
#endif
386-
#if defined(OS_EVR_THFLAGS_FILTER)
387-
#define OS_EVR_THFLAGS_LEVEL (((OS_EVR_THFLAGS_FILTER & 0x80U) != 0U) ? (OS_EVR_THFLAGS_FILTER & 0x0FU) : 0U)
386+
#if ((OS_EVR_THFLAGS_LEVEL & 0x80U) != 0U)
387+
(void)EventRecorderEnable( OS_EVR_THFLAGS_LEVEL & 0x0FU, EvtRtxThreadFlagsNo, EvtRtxThreadFlagsNo);
388+
(void)EventRecorderDisable(~OS_EVR_THFLAGS_LEVEL & 0x0FU, EvtRtxThreadFlagsNo, EvtRtxThreadFlagsNo);
388389
#endif
389-
#if defined(OS_EVR_EVFLAGS_FILTER)
390-
#define OS_EVR_EVFLAGS_LEVEL (((OS_EVR_EVFLAGS_FILTER & 0x80U) != 0U) ? (OS_EVR_EVFLAGS_FILTER & 0x0FU) : 0U)
390+
#if ((OS_EVR_EVFLAGS_LEVEL & 0x80U) != 0U)
391+
(void)EventRecorderEnable( OS_EVR_EVFLAGS_LEVEL & 0x0FU, EvtRtxEventFlagsNo, EvtRtxEventFlagsNo);
392+
(void)EventRecorderDisable(~OS_EVR_EVFLAGS_LEVEL & 0x0FU, EvtRtxEventFlagsNo, EvtRtxEventFlagsNo);
391393
#endif
392-
#if defined(OS_EVR_TIMER_FILTER)
393-
#define OS_EVR_TIMER_LEVEL (((OS_EVR_TIMER_FILTER & 0x80U) != 0U) ? (OS_EVR_TIMER_FILTER & 0x0FU) : 0U)
394+
#if ((OS_EVR_TIMER_LEVEL & 0x80U) != 0U)
395+
(void)EventRecorderEnable( OS_EVR_TIMER_LEVEL & 0x0FU, EvtRtxTimerNo, EvtRtxTimerNo);
396+
(void)EventRecorderDisable(~OS_EVR_TIMER_LEVEL & 0x0FU, EvtRtxTimerNo, EvtRtxTimerNo);
394397
#endif
395-
#if defined(OS_EVR_MUTEX_FILTER)
396-
#define OS_EVR_MUTEX_LEVEL (((OS_EVR_MUTEX_FILTER & 0x80U) != 0U) ? (OS_EVR_MUTEX_FILTER & 0x0FU) : 0U)
398+
#if ((OS_EVR_MUTEX_LEVEL & 0x80U) != 0U)
399+
(void)EventRecorderEnable( OS_EVR_MUTEX_LEVEL & 0x0FU, EvtRtxMutexNo, EvtRtxMutexNo);
400+
(void)EventRecorderDisable(~OS_EVR_MUTEX_LEVEL & 0x0FU, EvtRtxMutexNo, EvtRtxMutexNo);
397401
#endif
398-
#if defined(OS_EVR_SEMAPHORE_FILTER)
399-
#define OS_EVR_SEMAPHORE_LEVEL (((OS_EVR_SEMAPHORE_FILTER & 0x80U) != 0U) ? (OS_EVR_SEMAPHORE_FILTER & 0x0FU) : 0U)
402+
#if ((OS_EVR_SEMAPHORE_LEVEL & 0x80U) != 0U)
403+
(void)EventRecorderEnable( OS_EVR_SEMAPHORE_LEVEL & 0x0FU, EvtRtxSemaphoreNo, EvtRtxSemaphoreNo);
404+
(void)EventRecorderDisable(~OS_EVR_SEMAPHORE_LEVEL & 0x0FU, EvtRtxSemaphoreNo, EvtRtxSemaphoreNo);
400405
#endif
401-
#if defined(OS_EVR_MEMPOOL_FILTER)
402-
#define OS_EVR_MEMPOOL_LEVEL (((OS_EVR_MEMPOOL_FILTER & 0x80U) != 0U) ? (OS_EVR_MEMPOOL_FILTER & 0x0FU) : 0U)
406+
#if ((OS_EVR_MEMPOOL_LEVEL & 0x80U) != 0U)
407+
(void)EventRecorderEnable( OS_EVR_MEMPOOL_LEVEL & 0x0FU, EvtRtxMemoryPoolNo, EvtRtxMemoryPoolNo);
408+
(void)EventRecorderDisable(~OS_EVR_MEMPOOL_LEVEL & 0x0FU, EvtRtxMemoryPoolNo, EvtRtxMemoryPoolNo);
403409
#endif
404-
#if defined(OS_EVR_MSGQUEUE_FILTER)
405-
#define OS_EVR_MSGQUEUE_LEVEL (((OS_EVR_MSGQUEUE_FILTER & 0x80U) != 0U) ? (OS_EVR_MSGQUEUE_FILTER & 0x0FU) : 0U)
410+
#if ((OS_EVR_MSGQUEUE_LEVEL & 0x80U) != 0U)
411+
(void)EventRecorderEnable( OS_EVR_MSGQUEUE_LEVEL & 0x0FU, EvtRtxMessageQueueNo, EvtRtxMessageQueueNo);
412+
(void)EventRecorderDisable(~OS_EVR_MSGQUEUE_LEVEL & 0x0FU, EvtRtxMessageQueueNo, EvtRtxMessageQueueNo);
406413
#endif
407-
408-
#if defined(RTE_Compiler_EventRecorder)
409-
410-
// Event Recorder Initialize
411-
__STATIC_INLINE void evr_initialize (void) {
412-
413-
(void)EventRecorderInitialize(OS_EVR_LEVEL, (uint32_t)OS_EVR_START);
414-
415-
(void)EventRecorderEnable(OS_EVR_MEMORY_LEVEL, EvtRtxMemoryNo, EvtRtxMemoryNo);
416-
(void)EventRecorderEnable(OS_EVR_KERNEL_LEVEL, EvtRtxKernelNo, EvtRtxKernelNo);
417-
(void)EventRecorderEnable(OS_EVR_THREAD_LEVEL, EvtRtxThreadNo, EvtRtxThreadNo);
418-
(void)EventRecorderEnable(OS_EVR_WAIT_LEVEL, EvtRtxWaitNo, EvtRtxWaitNo);
419-
(void)EventRecorderEnable(OS_EVR_THFLAGS_LEVEL, EvtRtxThreadFlagsNo, EvtRtxThreadFlagsNo);
420-
(void)EventRecorderEnable(OS_EVR_EVFLAGS_LEVEL, EvtRtxEventFlagsNo, EvtRtxEventFlagsNo);
421-
(void)EventRecorderEnable(OS_EVR_TIMER_LEVEL, EvtRtxTimerNo, EvtRtxTimerNo);
422-
(void)EventRecorderEnable(OS_EVR_MUTEX_LEVEL, EvtRtxMutexNo, EvtRtxMutexNo);
423-
(void)EventRecorderEnable(OS_EVR_SEMAPHORE_LEVEL, EvtRtxSemaphoreNo, EvtRtxSemaphoreNo);
424-
(void)EventRecorderEnable(OS_EVR_MEMPOOL_LEVEL, EvtRtxMemoryPoolNo, EvtRtxMemoryPoolNo);
425-
(void)EventRecorderEnable(OS_EVR_MSGQUEUE_LEVEL, EvtRtxMessageQueueNo, EvtRtxMessageQueueNo);
426414
}
427415

428416
#else

0 commit comments

Comments
 (0)