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

Log ZTS test name to dmesg #10944

Closed
wants to merge 1 commit into from
Closed

Conversation

tonyhutter
Copy link
Contributor

Motivation and Context

DO NOT REVIEW OR PULL - THIS IS JUST TO HELP DEBUG #10940.

Description

Log ZTS test name to dmesg.

How Has This Been Tested?

Tested on a VM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist:

@@ -279,6 +279,10 @@ function default_setup_noexit
typeset no_mountpoint=$4
log_note begin default_setup_noexit

# Crudely log to dmesg which test we're running for post-mortem
me=`ps a | grep -Eo '[^ ]+ksh$' | head -n 1`
echo "ZTS: running $me" > /dev/kmsg
Copy link
Contributor

Choose a reason for hiding this comment

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

this is very Linux-specific are you sure it isn't easier and more portable to use logger ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The intent here is to see the test names interspersed with kernel messages in dmesg so I can see where which test is causing the __kernel_write() error in #10940. I don't think logger can log to the dmesg log.

@richardelling
Copy link
Contributor

Most Linux distros use something like rsyslog with the imklog plugin that copies the messages from the kernel log into a file or files in /var/log. For example, /var/log/kern.log* Some Linux distros also have restrictions on what logger can do, for example whether you can log to kern facility. But that is a logger restriction, not a syslog restriction.

In illumos, dmesg simply does tail on some /var/adm (nee /var/log) files. I'm not sure about FreeBSD.

In any case, you can make this more portable the simple way by using logger, or more complicated by checking for is_linux and if not use logger.

@tonyhutter tonyhutter force-pushed the kernel_write branch 2 times, most recently from 921e237 to 115cd16 Compare September 18, 2020 00:03
Log each test name to dmesg to help post-mortem test failures.
Specifically, to help debug openzfs#10940.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
@behlendorf
Copy link
Contributor

Closing as stale. The original #10940 issue is understood, we can open a new PR with a more generic version of this if it's something we decide is useful.

@behlendorf behlendorf closed this Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Work in Progress Not yet ready for general review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants