This is an automated email from the ASF dual-hosted git repository.
michallenc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 35e8eebff3a Documentation/critmon: Document context-switch accounting.
35e8eebff3a is described below
commit 35e8eebff3a1e04cb55943351f339353e81f6653
Author: yushuailong <[email protected]>
AuthorDate: Tue Sep 8 10:59:44 2026 +0800
Documentation/critmon: Document context-switch accounting.
Remove the misspelled crimon placeholder so the application appears
only under its correct name.
Document how nxsched_switch_critmon() updates timing across context
switches, correct the RUN and TIME column descriptions, and link the
application page to the implementation guide.
This follows up on PR #20066
Assisted-by: OpenAI Codex
Signed-off-by: yushuailong <[email protected]>
---
Documentation/applications/system/crimon/index.rst | 3 ---
Documentation/applications/system/critmon/index.rst | 13 +++++++------
Documentation/implementation/critical_sections.rst | 5 +++++
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/Documentation/applications/system/crimon/index.rst
b/Documentation/applications/system/crimon/index.rst
deleted file mode 100644
index 1db862dfce4..00000000000
--- a/Documentation/applications/system/crimon/index.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-====================================
-``critmon`` Critical Section Monitor
-====================================
diff --git a/Documentation/applications/system/critmon/index.rst
b/Documentation/applications/system/critmon/index.rst
index 49a6db41a0c..7f1b4ed72ae 100644
--- a/Documentation/applications/system/critmon/index.rst
+++ b/Documentation/applications/system/critmon/index.rst
@@ -48,12 +48,12 @@ Output Format
The output shows a table with the following columns:
-- **PRE-EMPTION CALLER**: The function that most recently enabled
- pre-emption for this task.
-- **CSECTION CALLER**: The function that most recently entered a
- critical section.
-- **RUN**: Maximum time spent in a critical section.
-- **TIME**: Total accumulated critical section time.
+- **PRE-EMPTION CALLER**: Maximum pre-emption-disabled time and its
+ associated caller.
+- **CSECTION CALLER**: Maximum critical-section time and its associated
+ caller.
+- **RUN**: Maximum uninterrupted execution time for the thread.
+- **TIME**: Total accumulated execution time for the thread.
- **PID**: Process/thread ID.
- **DESCRIPTION**: Task name (if ``CONFIG_TASK_NAME_SIZE > 0``).
@@ -87,5 +87,6 @@ Stop the monitoring daemon:
See Also
========
+- :doc:`/implementation/critical_sections`
- :doc:`../stackmonitor/index`
- :doc:`../gprof/index`
diff --git a/Documentation/implementation/critical_sections.rst
b/Documentation/implementation/critical_sections.rst
index 8c45e34d67e..17b0b067d42 100644
--- a/Documentation/implementation/critical_sections.rst
+++ b/Documentation/implementation/critical_sections.rst
@@ -214,6 +214,11 @@ you only focus on specific feature, we isolate the crtimon
features to differenc
configurations. Allow you only open some of the features to minimum the side
effect
of the performance etc.
+The scheduler calls ``nxsched_switch_critmon()`` whenever the running thread
+changes. It accounts for the elapsed execution time of the outgoing thread and
+starts timing the incoming thread. It also updates pre-emption and
+critical-section timing across the context switch.
+
The Critical Section Monitor is enabled with the following setting in the
configurations::