Skip to content

Commit 7d63942

Browse files
adleriscarlescufi
authored andcommitted
doc: logging: Fix some grammar issues
Fixes some grammar issues in the documentation. Signed-off-by: Alexander Leris <[email protected]>
1 parent 0bda216 commit 7d63942

File tree

2 files changed

+33
-32
lines changed

2 files changed

+33
-32
lines changed

doc/services/logging/index.rst

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ allocated.
124124

125125
:kconfig:option:`CONFIG_LOG_PRINTK`: Redirect printk calls to the logging.
126126

127-
:kconfig:option:`CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD`: When number of buffered log
128-
messages reaches the threshold dedicated thread (see :c:func:`log_thread_set`)
129-
is waken up. If :kconfig:option:`CONFIG_LOG_PROCESS_THREAD` is enabled then this
127+
:kconfig:option:`CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD`: When the number of buffered log
128+
messages reaches the threshold, the dedicated thread (see :c:func:`log_thread_set`)
129+
is woken up. If :kconfig:option:`CONFIG_LOG_PROCESS_THREAD` is enabled then this
130130
threshold is used by the internal thread.
131131

132132
:kconfig:option:`CONFIG_LOG_PROCESS_THREAD`: When enabled, logging thread is created
@@ -242,7 +242,7 @@ Logging in a module instance
242242
============================
243243

244244
In case of modules which are multi-instance and instances are widely used
245-
across the system enabling logs will lead to flooding. Logger provide the tools
245+
across the system enabling logs will lead to flooding. The logger provides the tools
246246
which can be used to provide filtering on instance level rather than module
247247
level. In that case logging can be enabled for particular instance.
248248

@@ -305,16 +305,16 @@ By default, logging processing in deferred mode is handled internally by the
305305
dedicated task which starts automatically. However, it might not be available
306306
if multithreading is disabled. It can also be disabled by unsetting
307307
:kconfig:option:`CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD`. In that case, logging can
308-
be controlled using API defined in :zephyr_file:`include/zephyr/logging/log_ctrl.h`.
309-
Logging must be initialized before it can be used. Optionally, user can provide
310-
function which returns timestamp value. If not provided, :c:macro:`k_cycle_get`
308+
be controlled using the API defined in :zephyr_file:`include/zephyr/logging/log_ctrl.h`.
309+
Logging must be initialized before it can be used. Optionally, the user can provide
310+
a function which returns the timestamp value. If not provided, :c:macro:`k_cycle_get`
311311
or :c:macro:`k_cycle_get_32` is used for timestamping.
312-
:c:func:`log_process` function is used to trigger processing of one log
313-
message (if pending). Function returns true if there is more messages pending.
312+
The :c:func:`log_process` function is used to trigger processing of one log
313+
message (if pending), and returns true if there are more messages pending.
314314
However, it is recommended to use macro wrappers (:c:macro:`LOG_INIT` and
315-
:c:macro:`LOG_PROCESS`) which handles case when logging is disabled.
315+
:c:macro:`LOG_PROCESS`) which handle the case where logging is disabled.
316316

317-
Following snippet shows how logging can be processed in simple forever loop.
317+
The following snippet shows how logging can be processed in simple forever loop.
318318

319319
.. code-block:: c
320320
@@ -356,16 +356,17 @@ that moment all logs are processed in a blocking way.
356356
Printk
357357
******
358358

359-
Typically, logging and :c:func:`printk` is using the same output for which they
360-
compete. This can lead to issues if the output does not support preemption but
361-
also it may result in the corrupted output because logging data is interleaved
362-
with printk data. However, it is possible to redirect printk messages to the
359+
Typically, logging and :c:func:`printk` use the same output, which they compete
360+
for. This can lead to issues if the output does not support preemption but it may
361+
also result in corrupted output because logging data is interleaved with printk
362+
data. However, it is possible to redirect printk messages to the
363363
logging subsystem by enabling :kconfig:option:`CONFIG_LOG_PRINTK`. In that case,
364364
printk entries are treated as log messages with level 0 (they cannot be disabled).
365365
When enabled, logging manages the output so there is no interleaving. However,
366-
in the deferred mode it changes the behavior of the printk because output is delayed
367-
until logging thread processes the data. :kconfig:option:`CONFIG_LOG_PRINTK` is by
368-
default enabled.
366+
in deferred mode the printk behaviour is changed since the output is delayed
367+
until the logging thread processes the data. :kconfig:option:`CONFIG_LOG_PRINTK`
368+
is enabled by default.
369+
369370

370371
.. _log_architecture:
371372

@@ -384,27 +385,27 @@ instance of a module.
384385
Default Frontend
385386
================
386387

387-
Default frontend is engaged when logging API is called in a source of logging (e.g.
388+
Default frontend is engaged when the logging API is called in a source of logging (e.g.
388389
:c:macro:`LOG_INF`) and is responsible for filtering a message (compile and run
389-
time), allocating buffer for the message, creating the message and committing that
390-
message. Since logging API can be called in an interrupt, frontend is optimized
390+
time), allocating a buffer for the message, creating the message and committing that
391+
message. Since the logging API can be called in an interrupt, the frontend is optimized
391392
to log the message as fast as possible.
392393

393394
Log message
394395
-----------
395396

396-
Log message contains message descriptor (source, domain and level), timestamp,
397+
A log message contains a message descriptor (source, domain and level), timestamp,
397398
formatted string details (see :ref:`cbprintf_packaging`) and optional data.
398399
Log messages are stored in a continuous block of memory.
399-
Memory is allocated from a circular packet buffer (:ref:`mpsc_pbuf`). It has
400-
few consequences:
400+
Memory is allocated from a circular packet buffer (:ref:`mpsc_pbuf`), which has
401+
a few consequences:
401402

402-
* Each message is self-contained, continuous block of memory thus it is suited
403+
* Each message is a self-contained, continuous block of memory thus it is suited
403404
for copying the message (e.g. for offline processing).
404405
* Messages must be sequentially freed. Backend processing is synchronous. Backend
405406
can make a copy for deferred processing.
406407

407-
Log message has following format:
408+
A log message has following format:
408409

409410
+------------------+----------------------------------------------------+
410411
| Message Header | 2 bits: MPSC packet buffer header |
@@ -446,12 +447,12 @@ Log message has following format:
446447
Log message allocation
447448
----------------------
448449

449-
It may happen that frontend cannot allocate a message. It happens if system is
450-
generating more log messages than it can process in certain time frame. There
451-
are two strategies to handle that case:
450+
It may happen that the frontend cannot allocate a message. This happens if the
451+
system is generating more log messages than it can process in certain time
452+
frame. There are two strategies to handle that case:
452453

453-
- No overflow - new log is dropped if space for a message cannot be allocated.
454-
- Overflow - oldest pending messages are freed, until new message can be
454+
- No overflow - the new log is dropped if space for a message cannot be allocated.
455+
- Overflow - the oldest pending messages are freed, until the new message can be
455456
allocated. Enabled by :kconfig:option:`CONFIG_LOG_MODE_OVERFLOW`. Note that it degrades
456457
performance thus it is recommended to adjust buffer size and amount of enabled
457458
logs to limit dropping.

include/zephyr/logging/log_ctrl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ __syscall void log_panic(void);
8282
/**
8383
* @brief Process one pending log message.
8484
*
85-
* @retval true There is more messages pending to be processed.
85+
* @retval true There are more messages pending to be processed.
8686
* @retval false No messages pending.
8787
*/
8888
__syscall bool log_process(void);

0 commit comments

Comments
 (0)