Skip to content

Revise log format for consistency #6

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

Merged
merged 1 commit into from
Apr 9, 2025
Merged

Conversation

charliechiou
Copy link
Contributor

Add 'end' to the log message in ai_one_work_func to match the format used in ai_two_work_func. This improves clarity and consistency in logs.

main.c Outdated
@@ -222,7 +222,7 @@ static void ai_one_work_func(struct work_struct *w)
tv_end = ktime_get();

nsecs = (s64) ktime_to_ns(ktime_sub(tv_end, tv_start));
pr_info("kxo: [CPU#%d] doing %s for %llu usec\n", cpu, __func__,
pr_info("kxo: [CPU#%d] end doing %s for %llu usec\n", cpu, __func__,
Copy link
Contributor

Choose a reason for hiding this comment

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

I am hesitant to adopt the use of "end doing," which sounds a bit strange. Can you provide alternatives?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’m considering:
pr_info("kxo: [CPU#%d] %s completed in %llu usec\n", ...)
pr_info("kxo: [CPU#%d] completed %s after %llu usec\n", ...)
Do you have a preference between the two in terms of clarity?

Copy link
Contributor

Choose a reason for hiding this comment

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

The former looks fine.

Update the pr_info log message in ai_one_work_func and
ai_two_work_func to improve the clarity and ensure consistent logging
format across functions.

Co-authored-by: Cheng-Yang Chou <[email protected]>
@charliechiou charliechiou changed the title Add 'end' to pr_info for consistency Revise log format for consistency Mar 30, 2025
@charliechiou
Copy link
Contributor Author

Hi @jserv , the log message has been updated to pr_info("kxo: [CPU#%d] %s completed in %llu usec\n", ...) as suggested.

@jserv
Copy link
Contributor

jserv commented Apr 9, 2025

the log message has been updated to pr_info("kxo: [CPU#%d] %s completed in %llu usec\n", ...) as suggested.

Next time, request a rewiew via GitHub web interface instead of leaving messages. See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review

@jserv jserv merged commit 6214766 into sysprog21:main Apr 9, 2025
@jserv
Copy link
Contributor

jserv commented Apr 9, 2025

Thank @charliechiou for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants