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

oomkill: Remove trailing newline from output #4147

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

chenhengqi
Copy link
Collaborator

Signed-off-by: Hengqi Chen chenhengqi@outlook.com

@@ -78,11 +78,11 @@ static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz)
strftime(ts, sizeof(ts), "%H:%M:%S", tm);

if (n)
printf("%s Triggered by PID %d (\"%s\"), OOM kill of PID %d (\"%s\"), %lld pages, loadavg: %s\n",
printf("%s Triggered by PID %d (\"%s\"), OOM kill of PID %d (\"%s\"), %lld pages, loadavg: %s",
Copy link
Collaborator

Choose a reason for hiding this comment

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

why removing '\n' here? The else branch still has '\n'. it seems '\n' makes sense since different oom's will be in different lines?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The if branch print /proc/loadavg which has a newline already.

Signed-off-by: Hengqi Chen <chenhengqi@outlook.com>
@davemarchevsky davemarchevsky merged commit dda13ed into iovisor:master Aug 8, 2022
fengjixuchui added a commit to fengjixuchui/bcc that referenced this pull request Aug 8, 2022
Merge pull request iovisor#4147 from chenhengqi/fix-oomkill-output
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.

3 participants