xref: /freebsd/sys/contrib/openzfs/tests/zfs-tests/callbacks/zfs_dbgmsg.ksh (revision 61145dc2b94f12f6a47344fb9aac702321880e43)
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#
18
19# $1: number of lines to output (default: 200)
20typeset lines=${1:-200}
21
22echo "================================================================="
23echo " Tailing last $lines lines of zfs_dbgmsg log"
24echo "================================================================="
25
26sudo tail -n $lines /proc/spl/kstat/zfs/dbgmsg
27
28# reset dbgmsg
29sudo bash -c "echo > /proc/spl/kstat/zfs/dbgmsg"
30
31echo "================================================================="
32echo " End of zfs_dbgmsg log"
33echo "================================================================="
34