xref: /freebsd/sys/contrib/openzfs/tests/zfs-tests/callbacks/zfs_dbgmsg.ksh (revision 2a58b312b62f908ec92311d1bd8536dbaeb8e55b)
1eda14cbcSMatt Macy#!/bin/ksh -p
2eda14cbcSMatt Macy
3eda14cbcSMatt Macy#
4eda14cbcSMatt Macy# This file and its contents are supplied under the terms of the
5eda14cbcSMatt Macy# Common Development and Distribution License ("CDDL"), version 1.0.
6eda14cbcSMatt Macy# You may only use this file in accordance with the terms of version
7eda14cbcSMatt Macy# 1.0 of the CDDL.
8eda14cbcSMatt Macy#
9eda14cbcSMatt Macy# A full copy of the text of the CDDL should have accompanied this
10eda14cbcSMatt Macy# source.  A copy of the CDDL is also available via the Internet at
11eda14cbcSMatt Macy# http://www.illumos.org/license/CDDL.
12eda14cbcSMatt Macy#
13eda14cbcSMatt Macy
14eda14cbcSMatt Macy#
15eda14cbcSMatt Macy# Copyright (c) 2016 by Delphix. All rights reserved.
16eda14cbcSMatt Macy#
17eda14cbcSMatt Macy
18eda14cbcSMatt Macy# $1: number of lines to output (default: 200)
19eda14cbcSMatt Macytypeset lines=${1:-200}
20eda14cbcSMatt Macy
21eda14cbcSMatt Macyecho "================================================================="
22eda14cbcSMatt Macyecho " Tailing last $lines lines of zfs_dbgmsg log"
23eda14cbcSMatt Macyecho "================================================================="
24eda14cbcSMatt Macy
25eda14cbcSMatt Macysudo tail -n $lines /proc/spl/kstat/zfs/dbgmsg
26eda14cbcSMatt Macy
27*2a58b312SMartin Matuska# reset dbgmsg
28*2a58b312SMartin Matuskasudo bash -c "echo > /proc/spl/kstat/zfs/dbgmsg"
29*2a58b312SMartin Matuska
30eda14cbcSMatt Macyecho "================================================================="
31eda14cbcSMatt Macyecho " End of zfs_dbgmsg log"
32eda14cbcSMatt Macyecho "================================================================="
33