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: add support of ramlog flush worker #13599

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

Conversation

anchao
Copy link
Contributor

@anchao anchao commented Sep 25, 2024

Summary

syslog/ramlog: add support of ramlog flush worker

  1. add RAMLOG_FLUSH options to support flush ramlog buffer to ARCH_LOWPUTC device
  2. add RAMLOG_FLUSH_WORKER to support background ramlog flush from workqueue
    in timeout RAMLOG_FLUSH_WORKER_TIMEOUT_MS

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

Impact

N/A

Testing

ci-check

@github-actions github-actions bot added Area: Documentation Improvements or additions to documentation Arch: arm Issues related to ARM (32-bit) architecture Area: Board support Board support issues Size: M The size of the change in this PR is medium labels Sep 25, 2024
@nuttxpr
Copy link

nuttxpr commented Sep 25, 2024

[Experimental Bot, please feedback here]

The PR does not fully meet the NuttX requirements, specifically in the following areas:

Summary:

  • Insufficient detail: The summary provides a high-level overview but lacks specific details about the changes made. It should explain the rationale behind adding the RAMLOG_FLUSH option and the RAMLOG_FLUSH_WORKER functionality.
  • Missing references: It should include references to any related NuttX Issues or Pull Requests, if applicable.

Impact:

  • Not Applicable (N/A) is not acceptable: The impact section needs to be filled out thoughtfully, addressing each point. While the change might not impact some areas, it's important to explicitly state that and provide justification. For instance, the change likely impacts the build process and potentially hardware (if it relies on specific architecture features).

Testing:

  • Insufficient details:
    • "ci-check" isn't descriptive enough. Specify the CI environment used (OS, compiler, architectures).
    • Provide snippets of the actual testing logs showing the relevant changes in behavior. Simply stating "ci-check" doesn't offer proof of functionality.

Recommendations for Improvement:

  1. Expand the Summary: Clearly articulate the problem the PR solves and the technical approach used.
  2. Complete the Impact Section: Thoroughly analyze and describe the impact on each aspect (build, hardware, documentation, security, compatibility), providing details and justification.
  3. Provide Detailed Testing Information: List all build hosts and target environments used for testing. Include relevant snippets from the testing logs, highlighting the differences in behavior before and after the changes.

By addressing these points, the PR will better adhere to the NuttX requirements and provide reviewers with the necessary context for a comprehensive evaluation.

1. add RAMLOG_FLUSH options to support flush ramlog buffer to ARCH_LOWPUTC device
2. add RAMLOG_FLUSH_WORKER to support background ramlog flush from workqueue
   in timeout RAMLOG_FLUSH_WORKER_TIMEOUT_MS

Signed-off-by: chao an <[email protected]>
@github-actions github-actions bot removed Area: Documentation Improvements or additions to documentation Arch: arm Issues related to ARM (32-bit) architecture Area: Board support Board support issues labels Sep 26, 2024

while (pos != (header->rl_buffer + end) && *pos++ != '\n');

up_nputs(start, pos - start);
Copy link
Contributor

Choose a reason for hiding this comment

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

why need dup to up_nputs? which may generate the infinite recursion.

---help---
ROMLOG lower flush worker to flush the ramlog to lower half driver.

if RAMLOG_FLUSH_WORKER
Copy link
Contributor

Choose a reason for hiding this comment

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

change RAMLOG_FLUSH_WORKER_TIMEOUT_MS to depend on RAMLOG_FLUSH_WORKER

priv->rl_tail = header->rl_head - priv->rl_bufsize;
}

begin = priv->rl_tail % priv->rl_bufsize;
Copy link
Contributor

Choose a reason for hiding this comment

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

change begin/end to tail/head

start = header->rl_buffer + begin;
pos = start;

while (pos != (header->rl_buffer + end) && *pos++ != '\n');
Copy link
Contributor

Choose a reason for hiding this comment

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

why need find \n? let's up_nputs handle multiple \n to \r\n byself.


flags = enter_critical_section();

if (header->rl_head != priv->rl_tail)
Copy link
Contributor

Choose a reason for hiding this comment

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

why not flush all buffer in once

}
else
{
if (work_available(&priv->rl_work))
Copy link
Contributor

Choose a reason for hiding this comment

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

merge with line 454

#ifdef CONFIG_RAMLOG_FLUSH
int ramlog_flush(FAR syslog_channel_t *channel)
{
ramlog_flush_internal(&g_sysdev, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not merge ramlog_flush_internal into ramlog_flush?

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

Successfully merging this pull request may close these issues.

3 participants