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

On recent kernels, zfs_zevent_console=1 outputs many spurious linefeeds #7082

Closed
akorn opened this issue Jan 26, 2018 · 7 comments
Closed

On recent kernels, zfs_zevent_console=1 outputs many spurious linefeeds #7082

akorn opened this issue Jan 26, 2018 · 7 comments
Labels
good first issue Indicates a good issue for first-time contributors Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@akorn
Copy link
Contributor

akorn commented Jan 26, 2018

This is almost certainly due to the change explained in https://lwn.net/Articles/732420/ -- if you call printk() several times, each invocation will cause a new line to be written to dmesg unless you use KERN_CONT.

Supposedly, you should instead marshal your entire line into a single buffer and use printk() to print that.

@akorn
Copy link
Contributor Author

akorn commented Jan 26, 2018

(Incidentally, I also think zfs_zevent_cols is superfluous -- whatever you view the messages on can wrap them. I don't think there is need for pre-wrapping in kernelspace. I don't think this merits filing a new issue, but if fixing the printk usage is easier if you also drop zfs_zevent_cols, I think it'd be good riddance.)

@DeHackEd
Copy link
Contributor

From IRC: https://pastebin.com/SbtYRcs1 for an example of broken output

@behlendorf
Copy link
Contributor

@akorn thanks for letting us know. I'm actually a little surprised anyone is enabling the console logging functionality and would be interested in how your using it. This is functionality we've considering removing entirely.

@akorn
Copy link
Contributor Author

akorn commented Jan 27, 2018

I have a system not unlike logcheck that post-processes logfiles, and, based on regular expressions, discards all messages classified as "known benign". It sends me the others via email for review.

I'm sure it would be possible to set this up with zed somehow, but I had already been using it when zed was introduced (or when I first noticed zed, at any rate).

While it wouldn't be a terrible blow to lose zfs_zevent_console, I think it's useful to see these messages interleaved with other kernel events, in the same stream. Makes it easier to spot if other problems coincide with zfs events.

@akorn akorn changed the title On recent kernels, zfs_zevent_cols=1 outputs many spurious linefeeds On recent kernels, zfs_zevent_console=1 outputs many spurious linefeeds Jan 27, 2018
@stale
Copy link

stale bot commented Aug 25, 2020

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale No recent activity for issue label Aug 25, 2020
@akorn
Copy link
Contributor Author

akorn commented Aug 25, 2020

AFAIK the problem still persists, but since it made zfs_zevent_console pretty much useless I have stopped using it.

I think that knob should either go away as you, @behlendorf, suggested, or the output should be fixed.

@stale stale bot removed the Status: Stale No recent activity for issue label Aug 25, 2020
@behlendorf behlendorf added good first issue Indicates a good issue for first-time contributors Type: Defect Incorrect behavior (e.g. crash, hang) labels Aug 25, 2020
@behlendorf
Copy link
Contributor

I'd recommend we remove it.

nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue May 4, 2021
zfs_zevent_console committed multiple printk()s per line without
properly continuing them ‒ a single event could easily be fragmented
across over thirty lines, making it useless for direct application

zfs_zevent_cols exists purely to wrap the output from zfs_zevent_console

The niche this was supposed to fill can be better served by something
akin to the all-syslog ZEDLET

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#7082
nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue May 8, 2021
zfs_zevent_console committed multiple printk()s per line without
properly continuing them ‒ a single event could easily be fragmented
across over thirty lines, making it useless for direct application

zfs_zevent_cols exists purely to wrap the output from zfs_zevent_console

The niche this was supposed to fill can be better served by something
akin to the all-syslog ZEDLET

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#7082
nabijaczleweli added a commit to nabijaczleweli/zfs that referenced this issue May 8, 2021
zfs_zevent_console committed multiple printk()s per line without
properly continuing them ‒ a single event could easily be fragmented
across over thirty lines, making it useless for direct application

zfs_zevent_cols exists purely to wrap the output from zfs_zevent_console

The niche this was supposed to fill can be better served by something
akin to the all-syslog ZEDLET

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#7082
behlendorf pushed a commit to behlendorf/zfs that referenced this issue May 28, 2021
zfs_zevent_console committed multiple printk()s per line without
properly continuing them ‒ a single event could easily be fragmented
across over thirty lines, making it useless for direct application

zfs_zevent_cols exists purely to wrap the output from zfs_zevent_console

The niche this was supposed to fill can be better served by something
akin to the all-syslog ZEDLET

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#7082 
Closes openzfs#11996
sempervictus pushed a commit to sempervictus/zfs that referenced this issue May 31, 2021
zfs_zevent_console committed multiple printk()s per line without
properly continuing them ‒ a single event could easily be fragmented
across over thirty lines, making it useless for direct application

zfs_zevent_cols exists purely to wrap the output from zfs_zevent_console

The niche this was supposed to fill can be better served by something
akin to the all-syslog ZEDLET

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#7082 
Closes openzfs#11996
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

3 participants