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

syslog/ramlog: remove magic flag #13686

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

anchao
Copy link
Contributor

@anchao anchao commented Sep 27, 2024

Summary

syslog/ramlog: remove magic flag

  1. remove magic flag
  2. move g_sysdev to bss
  3. clear ramlog buffer only if in custom section

Signed-off-by: chao an [email protected]

Impact

N/A

Testing

ci-check

@github-actions github-actions bot added the Size: S The size of the change in this PR is small label Sep 27, 2024
@nuttxpr
Copy link

nuttxpr commented Sep 27, 2024

[Experimental Bot, please feedback here]

This PR appears to mostly meet the NuttX requirements, but is missing some information:

What's good:

  • Summary: Provides a high-level overview of the changes being made. However, it could be more descriptive. What is the magic flag and why should it be removed?
  • Testing: Indicates that CI checks were performed, which is good. However, providing actual log snippets (even if shortened) would be even better.

What needs improvement:

  • Impact: While marking everything as N/A might be technically correct, it's unlikely that every category is truly unaffected. For example:
    • Impact on build: Even small code changes can alter build times or memory usage. Consider if this is relevant.
    • Impact on compatibility: Does removing this magic flag potentially break any existing configurations or use cases?
  • Testing:
    • Be specific about the build host and target(s) used for testing.
    • Provide snippets of the testing logs before and after the change. This helps reviewers quickly understand the impact of the changes.

Recommendation:

Before merging, expand on the Impact section, even if briefly, to confirm that the potential implications have been considered. Additionally, enhance the Testing section with specifics about the test environment and relevant log snippets.

1. remove magic flag
2. move g_sysdev to bss
3. clear ramlog buffer only if in custom section

Signed-off-by: chao an <[email protected]>
@acassis
Copy link
Contributor

acassis commented Sep 27, 2024

@anchao I think the magic flag is useful to search where the ramlog starts in the memory in case where someone is debug NuttX bringup and doesn't have serial console working.

Maybe @patacongo can confirm the reason he included it.

@patacongo
Copy link
Contributor

patacongo commented Sep 27, 2024

The flag was used to distinguish between a cold start and a reset. This was added by Xiaomi just a few months ago. See

commit 0da8755fbce536da81894694c47905430d38848b
Author: yuanyongjian <[email protected]>
Date:   Thu Nov 23 13:02:47 2023 +0800

    syslog/ramlog:Add tags to distinguish between hot start and cold start

    Signed-off-by: yuanyongjian <[email protected]>

@anchao
Copy link
Contributor Author

anchao commented Sep 27, 2024

@acassis @patacongo This PR will use the header pointer to check if it is hot/cold reset, so removing the magic will give the same functionality.

image

@xiaoxiang781216
Copy link
Contributor

@acassis @patacongo This PR will use the header pointer to check if it is hot/cold reset, so removing the magic will give the same functionality.

image

but the check doesn't work since g_sysdev is initialized to zero by boot every time.

{
priv->rl_header = (FAR void *)g_sysbuffer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the benefit to change the static data initialization to the runtime initialization?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: S The size of the change in this PR is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants