You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Pthread APIs in QNX follow POSIX standard,
hence, to avoid undefined behaviors:
- Return value from each API call will be handled
- Manually allocate stack size for thread
- Reduce thread queue to one for logging only to
avoid unlimited threads creation
- Use only 1 thread to handle logging, with
stack size fixed to 12K (4K aligned)
2. Injection callback:
- Since only 1 thread is used, callback injection
will now do infinity wait inside slogger2_callback
3. Handle properly dlt thread in normal exit:
- Add an atomic_bool for thread cancellation in
normal main thread exit case.
4. Handle slog2_thread heap memory:
- slog2_thread is now allocated on HEAP, in case of
failure or normal exit, free this HEAP allocated
memory is required to prevent memory leak. During
thread allocation on heap, the pointer stackaddr
shall be round up to the nearest aligned memory
address within 16K memory allocated.
Example: Heap 16K memory
|-------------|------------------------|
0x1003 0x2000-aligned MAX_MEM
MAX_MEM - 0x1003 = 16K
MAX_MEM - 0x2000 >= 12K
Signed-off-by: LUU QUANG MINH <Minh.LuuQuang@vn.bosch.com>
Copy file name to clipboardExpand all lines: doc/dlt-qnx-system.md
+21-2Lines changed: 21 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,33 @@ The application listens to the system logs on QNX (slogger2) and sends them to
7
7
DLT. The prerequisite is that dlt-daemon is already started and running.
8
8
dlt-qnx-system loads by default the configuration file ```/etc/dlt-qnx-system.conf```.
9
9
10
-
> In order to catch all logs via slog2, the syslog needs to forward to slogger2 in [syslog.conf](http://www.qnx.com/developers/docs/7.0.0/index.html#com.qnx.doc.neutrino.utilities/topic/s/syslog.conf.html).
10
+
> In order to catch all logs via slog2, the syslog needs to forward to slogger2 in [syslog.conf](http://www.qnx.com/developers/docs/7.0.0/index.html#com.qnx.doc.neutrino.utilities/topic/s/syslog.conf.html).[Deprecated]
11
11
12
12
To change the log level, use application ID and context ID set in configuration
13
13
file. ```DLT_INITIAL_LOG_LEVEL``` can be set on startup phase, or control
14
14
message can be sent from DLT client (e.g. dlt-control, DLT Viewer) at runtime.
15
15
Refer to [dlt_for_developers.md](dlt_for_developers.md) for more detail.
16
16
17
+
## Single Threaded Design (v2.18.10+)
18
+
19
+
> **Note:** Starting from version 2.18.10, `dlt-qnx-system` uses a single-threaded design for QNX logging management.
20
+
21
+
- The main process initializes and manages the logging thread for the slogger2 adapter.
22
+
- Signal handling is centralized in the main thread, ensuring clean shutdown and resource release.
23
+
- The slogger2 adapter thread is started with retries and monitored for successful startup.
24
+
- Runtime enable/disable of the slog2 adapter via injection is still supported.
25
+
26
+
The design shall improve reliability and simplifies the process structure, making it more suitable for embedded and high-load QNX systems.
0 commit comments