Skip to content
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

matter: add Kconfig option to control logging #2787

Merged
merged 1 commit into from
Oct 27, 2024

Conversation

zhhyu7
Copy link
Contributor

@zhhyu7 zhhyu7 commented Oct 27, 2024

Summary

Logs have a great impact on image size, so whether to print logs is modified as a compilation option and controlled by Kconfig

Impact

Testing

sim:matter

@nuttxpr
Copy link

nuttxpr commented Oct 27, 2024

[Experimental Bot, please feedback here]

This PR summary is missing crucial information. Here's a breakdown of what's lacking and how to improve it:

Summary - Missing Information

  • Why is this change necessary?
    • Is this a performance optimization?
    • Are there specific use cases where large log sizes are problematic?
    • Clearly state the problem this PR solves.
  • What functional part of the code is being changed?
    • Be specific! Which logging framework is being modified?
    • Are you changing the NuttX kernel, a specific driver, or a general logging utility?
  • How does the change work?
    • Explain the Kconfig option:
      • What is its name?
      • What are the possible values?
      • What is the default behavior?
    • How can developers enable/disable logging at compile time using this option?

Impact - Incomplete

You need to address all the points in the impact section. Even if the answer is "NO", state it explicitly. For example:

  • Is new feature added? YES (Kconfig option for logging control)
  • Impact on user: YES (Users can now control logging verbosity at compile time, potentially reducing image size).
  • Impact on build: YES (The build system now needs to respect the new Kconfig option).
  • Impact on hardware: NO
  • Impact on documentation: YES (The documentation must be updated to explain the new Kconfig option and its usage).
  • Impact on security: Potentially YES. Disabling logs can have security implications if debugging information is no longer available. You need to analyze and explain this.
  • Impact on compatibility: Possibly, depending on how the logging changes are implemented. Analyze and explain.

Testing - Insufficient

  • Build Host(s): Provide more details about your development environment. This helps reviewers reproduce your results.
    • OS: (e.g., Linux Mint 21)
    • CPU: (e.g., Intel i7-12700K)
    • Compiler: (e.g., GCC 12.2.0)
  • Target(s):
    • "sim:matter" is not descriptive enough.
    • Which simulator are you using? (e.g., QEMU)
    • What is the "matter" configuration?
  • Testing Logs:
    • You must provide actual logs demonstrating:
      • The system's behavior with logging enabled.
      • The system's behavior with logging disabled.
      • Ideally, show the difference in image size between the two scenarios.

Revised Summary Example

## Summary

This PR addresses the issue of large log files impacting image size in NuttX. It introduces a new Kconfig option, `CONFIG_DEBUG_LOGGING`, which allows developers to enable or disable logging at compile time. This change modifies the core logging framework within the NuttX kernel ([mention specific files or modules]).

By default, `CONFIG_DEBUG_LOGGING` is set to `y` (enabled). Developers can disable logging by setting this option to `n` in their board or application configuration files.

This change provides a flexible mechanism to control logging verbosity, enabling optimization of image size for resource-constrained devices or deployments where extensive logging is not required.

## Impact 

* **Is new feature added?** YES (Kconfig option for logging control - `CONFIG_DEBUG_LOGGING`)
* **Impact on user:** YES (Users can now control logging verbosity at compile time using the `CONFIG_DEBUG_LOGGING` option, potentially reducing image size).
* **Impact on build:** YES (The build system now respects the `CONFIG_DEBUG_LOGGING` option)
* **Impact on hardware:**  NO
* **Impact on documentation:** YES (The documentation must be updated to explain the new `CONFIG_DEBUG_LOGGING`  Kconfig option and its usage).
* **Impact on security:**  YES (Disabling logging could make it more difficult to debug security issues in the field. Developers should carefully consider the security implications of disabling logs). 
* **Impact on compatibility:**  NO (This change does not introduce any known compatibility issues.)

## Testing

**Build Host:**
* OS: Linux Mint 21
* CPU: Intel i7-12700K
* Compiler: GCC 12.2.0

**Target:**
* QEMU simulator 
* matter: [Provide a clear description of the "matter" configuration]

**Testing Logs (Before Change - Logging Enabled):**

[logs showing system behavior with logging enabled]


**Testing Logs (After Change - Logging Disabled):**

[logs showing system behavior with logging disabled - should be minimal or no output]


**Image Size Comparison:**

* Image size with logging enabled: [size]
* Image size with logging disabled: [size]

@xiaoxiang781216 xiaoxiang781216 changed the title add Kconfig option to control logging matter: add Kconfig option to control logging Oct 27, 2024
Logs have a great impact on image size, so whether to print logs is
modified as a compilation option and controlled by Kconfig

Signed-off-by: zhanghongyu <[email protected]>
@xiaoxiang781216 xiaoxiang781216 merged commit 8b15b26 into apache:master Oct 27, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants