xref: /freebsd/sys/contrib/openzfs/tests/zfs-tests/callbacks/zfs_dmesg.ksh (revision c27f7d6b9cf6d4ab01cb3d0972726c14e0aca146)
1#!/bin/ksh -p
2# SPDX-License-Identifier: CDDL-1.0
3
4#
5# This file and its contents are supplied under the terms of the
6# Common Development and Distribution License ("CDDL"), version 1.0.
7# You may only use this file in accordance with the terms of version
8# 1.0 of the CDDL.
9#
10# A full copy of the text of the CDDL should have accompanied this
11# source.  A copy of the CDDL is also available via the Internet at
12# http://www.illumos.org/license/CDDL.
13#
14
15#
16# Copyright (c) 2016 by Delphix. All rights reserved.
17# Copyright (c) 2017 Lawrence Livermore National Security, LLC.
18#
19
20# $1: number of lines to output (default: 200)
21typeset lines=${1:-200}
22
23echo "================================================================="
24echo " Tailing last $lines lines of dmesg log"
25echo "================================================================="
26
27# report and reset afterwards
28sudo dmesg -c | tail -n $lines
29
30echo "================================================================="
31echo " End of dmesg log"
32echo "================================================================="
33