-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial version of logging feature request #206
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,202 @@ | ||||||
.. | ||||||
# ******************************************************************************* | ||||||
# Copyright (c) 2024 Contributors to the Eclipse Foundation | ||||||
# | ||||||
# See the NOTICE file(s) distributed with this work for additional | ||||||
# information regarding copyright ownership. | ||||||
# | ||||||
# This program and the accompanying materials are made available under the | ||||||
# terms of the Apache License Version 2.0 which is available at | ||||||
# https://www.apache.org/licenses/LICENSE-2.0 | ||||||
# | ||||||
# SPDX-License-Identifier: Apache-2.0 | ||||||
# ******************************************************************************* | ||||||
|
||||||
Logging | ||||||
####### | ||||||
|
||||||
.. document:: Logging | ||||||
:id: DOC_Logging | ||||||
:status: draft | ||||||
:safety: ASIL_B | ||||||
:tags: feature_request | ||||||
|
||||||
|
||||||
Feature flag | ||||||
============ | ||||||
|
||||||
To activate this feature, use the following feature flag: | ||||||
|
||||||
``experimental_logging`` | ||||||
|
||||||
Abstract | ||||||
======== | ||||||
|
||||||
This feature request proposes the development of a safe, efficient and robust logging framework for embedded systems. | ||||||
|
||||||
|
||||||
Motivation | ||||||
========== | ||||||
|
||||||
- currently no solution available in the score platform | ||||||
|
||||||
Rationale | ||||||
========= | ||||||
|
||||||
Logging provides the possibility to understand the running system by capturing detailed information about system | ||||||
events and application-level activities. | ||||||
|
||||||
Specification | ||||||
============= | ||||||
|
||||||
[Describe the requirements, architecture of any new feature.] [or] | ||||||
[Describe the change to requirements, architecture, implementation, process, documentation, infrastructure of any change request.] | ||||||
|
||||||
.. note:: | ||||||
A Feature Request shall specify the stakeholder requirements as part of our platform/project. | ||||||
Thereby the :need:`RL_technical_lead` will approve these requirements as part of accepting the Feature Request (e.g. merging the PR with the Feature Request). | ||||||
|
||||||
Functionality | ||||||
------------- | ||||||
|
||||||
Logging has to support the following features: | ||||||
|
||||||
- Timestamping | ||||||
arsibo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
- local timestamp for each log entry | ||||||
- original timestamp for routed log entries | ||||||
- timestamp synchronization for log entries coming from different logging nodes- | ||||||
|
||||||
- Log severity levels | ||||||
- Log prioritization in case of resource conflicts | ||||||
- logging of early startup events | ||||||
- Log filtering | ||||||
|
||||||
- Support application and context identifier like in DLT | ||||||
- Filtering by log levels for components and application level | ||||||
- Out of scope "time" (tooling topic) | ||||||
- logs filtering by logging entity ID (e.g., ECU ID, Application ID, Context ID such as in DLT) | ||||||
- logs filtering by log level (e.g., FATAL, ERROR, WARN, INFO, DEBUG, VERBOSE such as in DLT) | ||||||
- Filtering options: it should have filter on app id and more fine-tuned filters on context ids. | ||||||
|
||||||
- message loss detection | ||||||
arsibo marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Message loss detection use cases:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hint: prio logic needs to define late |
||||||
|
||||||
- optional functionality for logging. Important for tracing. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am really not sure, if it is a good idea to have message loss detection only optional for logging. How trustworthy is a log that has for example only every second message in it? Or misses like 10 messages inbetween without a notice. And me, as a log consumer, I have no clue about it? I think this is the complete log. |
||||||
- would become mandatory in case verification is done via logging feature (not recommended) | ||||||
|
||||||
- Context specific log level activation at runtime | ||||||
|
||||||
arsibo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
Log Sources | ||||||
----------- | ||||||
|
||||||
- user application | ||||||
- component features & platform | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Sources (additional)
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed in the workshop today:
can be provided via the interfaces specified here in 0.5 by implemeting a bridge that is reading the sys level logs on the one side and writing them into score on the other side. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about
as a log source also? We did mention it in the Functionality section. |
||||||
Log Sinks | ||||||
--------- | ||||||
- log sinks shall be transparent to the application (e.g. by a facade ) | ||||||
- console | ||||||
- File system | ||||||
|
||||||
- local | ||||||
- external mounted PCIe Drive | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd not be specific to 'PCIe' here. Also drive is maybe not the right term?
Suggested change
|
||||||
- Cloud native drive via network | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
- Network (incl. second dedicated Ethernet Channel) | ||||||
- Logs shall appear on stdout when running unit tests | ||||||
|
||||||
Configuration | ||||||
arsibo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
------------- | ||||||
|
||||||
- Log level | ||||||
- Log Sinks | ||||||
|
||||||
- Log storage device | ||||||
- Log storage strategy (e.g., on system shutdown, on each message, on demand, on file size, on cache size, with circular or linear buffer) | ||||||
|
||||||
- Buffer size | ||||||
- Storage size (e.g. storage size of log files) | ||||||
- Permission settings | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We did not mention 'permission' until here. |
||||||
- log filter | ||||||
- Logging entity ID (e.g., ECU ID, Application ID, Context ID such as in DLT) | ||||||
- On-demand functionality (e.g., enable / disable the log storage) | ||||||
- Provide fallback configs. E.g.: App, System-wide | ||||||
|
||||||
- Possibility to provide an extension for custom types | ||||||
|
||||||
Error handling | ||||||
-------------- | ||||||
|
||||||
- reboot/reset | ||||||
- On logging errors, the framework should continue if recoverable; otherwise, deactivate silently and set an error state reported on shutdown. | ||||||
arsibo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- The user application should not be affected by logging framework errors. | ||||||
|
||||||
Context | ||||||
------- | ||||||
|
||||||
- Supported operating system: QNX, Linux (encapsulation via OSAL) | ||||||
- Supported programming languages: C++, Rust, Python (e.g. for tests) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For Rust, we would like to be able to use the log crate. It provides an (allocation-free) facade without forcing a specific logger implementation. Advantages of using this facade:
There might be comparable defacto standards for C++ and Python. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Design decision for detailed design => copy there There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python comes with logging out of the box and the concepts are similar to Rust, where you can add custom 'handlers'. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Context (additional)
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +plantuml There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not in scope of logging. belongs to Process / Docu / Tools There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think C is a score supported language also. Should we have it also on our radar? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kinda relates to https://github.com/eclipse-score/score/pull/206/files#r1952715564 as it probably would be convenient to have a logging interface that works with c++ and c or is at least similar |
||||||
|
||||||
Resource consumption | ||||||
-------------------- | ||||||
|
||||||
- Storage | ||||||
- Communication Channel | ||||||
- Runtime resources | ||||||
- Low impact on overall performance ---> QoS for handling overflows/dropping log messages | ||||||
|
||||||
Norms/Standards | ||||||
--------------- | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
|
||||||
Backwards Compatibility | ||||||
======================= | ||||||
\- | ||||||
|
||||||
Security Impact | ||||||
=============== | ||||||
|
||||||
- only authorized users should be able to access the log files | ||||||
|
||||||
Safety Impact | ||||||
============= | ||||||
|
||||||
- The interface should support the ASIL level of the user function. | ||||||
- Dependent on the Safety concept of the over all system, the logging should be classified accordingly. | ||||||
That could be the case if the logging information are part of the verification strategy.. | ||||||
|
||||||
License Impact | ||||||
============== | ||||||
|
||||||
- not known | ||||||
|
||||||
How to Teach This | ||||||
================= | ||||||
|
||||||
How to Use: Logging Guideline | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
Definitions | ||||||
=========== | ||||||
|
||||||
Logging | ||||||
------- | ||||||
|
||||||
Write out some message | ||||||
General progress description (incl. Context) | ||||||
- state changes | ||||||
- Infos | ||||||
- errors | ||||||
|
||||||
When logging from a library, it shall be possible to easily associate the logs to the library. A solution could be to provide contexts. | ||||||
|
||||||
Tracing | ||||||
------- | ||||||
|
||||||
Example - User need to correlate kernel traces to user traces for debugging , analyzing etc | ||||||
Follow the control flow (on function call basis)of the application. | ||||||
|
||||||
Recompute | ||||||
--------- | ||||||
|
||||||
All data to recompute a module (Input, Output, States) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.. | ||
# ******************************************************************************* | ||
# Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache License Version 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# ******************************************************************************* | ||
|
||
This document includes the detailed design findings from the feature request review. | ||
|
||
Logging | ||
####### | ||
|
||
Specification | ||
============= | ||
Context | ||
------- | ||
.. related feature from feature request | ||
- Supported programming languages: C++, Rust, Python (e.g. for tests) | ||
|
||
.. detailed design finding | ||
For Rust, we would like to be able to use the log crate. It provides an (allocation-free) facade without forcing a specific logger implementation. Advantages of using this facade: | ||
|
||
We stay with language best-practices. | ||
New contributors directly feel at home with the logging. | ||
Any library dependency which we might use probably logs against this facade. So we would get logs of dependencies for free by using it as well and implementing a logger for the facade. | ||
There might be comparable defacto standards for C++ and Python. | ||
|
||
|
||
Resource consumption | ||
-------------------- | ||
.. related feature from feature request | ||
- Runtime ressources | ||
- Low impact on overall performance ---> QoS for handling overflows/dropping log messages | ||
|
||
.. detailed design finding | ||
Ideally, in a language like Rust, logging messages should be possible without allocations for individual logs. | ||
Using the defacto standard log crate as facade, implementors of this facade should not allocate to write / forward log messages. | ||
Comment on lines
+1
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the purpose of this file? It does not seem to be referenced from somewhere. |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we general enough that 'embedded system' applies here, or do we just focus on score?