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

logging: Trigger logging thread when above threshold #75806

Conversation

thales-nascimento
Copy link

Trigger logging thread also when above CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD.
Fixes #75736

@zephyrbot zephyrbot added area: Logging size: XS A PR changing only a single line of code labels Jul 12, 2024
Copy link

Hello @thales-nascimento, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@carlescufi carlescufi added the bug The issue is a bug, or the PR is fixing a bug label Jul 12, 2024
@carlescufi carlescufi added this to the v3.7.0 milestone Jul 12, 2024
JordanYates
JordanYates previously approved these changes Jul 12, 2024
@@ -184,7 +184,7 @@ static void z_log_msg_post_finalize(void)
K_MSEC(CONFIG_LOG_PROCESS_THREAD_SLEEP_MS),
K_NO_WAIT);
} else if (CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD &&
(cnt + 1) == CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD) {
(cnt + 1) >= CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This will prolong time needed to log all logging messages when cnt exceeds the threshold. What about adding

k_timer_stop(&log_process_thread_timer);
k_sem_give(&log_process_thread_sem);

to z_log_dropped instead? If we start to drop messages then it's a good time to wake up the processing thread.

Can you try if that helps in your case?

Copy link
Author

Choose a reason for hiding this comment

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

Confirmed that it also solves my case, changes applied.

Copy link
Author

Choose a reason for hiding this comment

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

Hi, is there some action needed from my side for this pull request?

Copy link
Collaborator

@JordanYates JordanYates Jul 24, 2024

Choose a reason for hiding this comment

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

No, we are currently in a hard freeze for the v3.7 release.
That is scheduled for release on Friday, and PR's can be merged again after that.
https://github.com/zephyrproject-rtos/zephyr/wiki/Release-Management

Wake up logging thread when we start to drop messages.

Signed-off-by: Thales Bacelar <thalesbacelar@duck.com>
@nashif nashif added the backport v3.7-branch Request backport to the v3.7-branch label Jul 16, 2024
@aescolar aescolar removed this from the v3.7.0 milestone Jul 16, 2024
@MaureenHelm MaureenHelm merged commit d642943 into zephyrproject-rtos:main Aug 2, 2024
24 checks passed
Copy link

github-actions bot commented Aug 2, 2024

Hi @thales-nascimento!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Logging backport v3.7-branch Request backport to the v3.7-branch bug The issue is a bug, or the PR is fixing a bug size: XS A PR changing only a single line of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logging stops on all backend when overloaded for a time
9 participants