75 lines
2.7 KiB
Bash
75 lines
2.7 KiB
Bash
|
#!/bin/bash
|
||
|
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
#
|
||
|
# runtest.sh of /tools/systemtap/Regression/irq-vector-tracepoints
|
||
|
# Description: irq-vector-tracepoints
|
||
|
# Author: Martin Cermak <mcermak@redhat.com>
|
||
|
#
|
||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
#
|
||
|
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
|
||
|
#
|
||
|
# This copyrighted material is made available to anyone wishing
|
||
|
# to use, modify, copy, or redistribute it subject to the terms
|
||
|
# and conditions of the GNU General Public License version 2.
|
||
|
#
|
||
|
# This program is distributed in the hope that it will be
|
||
|
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
||
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||
|
# PURPOSE. See the GNU General Public License for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU General Public
|
||
|
# License along with this program; if not, write to the Free
|
||
|
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
# Boston, MA 02110-1301, USA.
|
||
|
#
|
||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
|
||
|
# Include Beaker environment
|
||
|
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||
|
|
||
|
rlJournalStart
|
||
|
rlPhaseStartSetup
|
||
|
rlRun "TMPDIR=$(mktemp -d)"
|
||
|
rlRun "pushd $TMPDIR"
|
||
|
rlRun "mount -t debugfs /dev/null /sys/kernel/debug" 0-255
|
||
|
rlRun "test -d /sys/kernel/debug/tracing/events"
|
||
|
rlPhaseEnd
|
||
|
|
||
|
rlPhaseStart FAIL "Systemtap sanity check"
|
||
|
rlRun "stap --version"
|
||
|
rlRun "stap -v -e 'probe kernel.function(\"vfs_read\"){ exit() }'"
|
||
|
rlPhaseEnd
|
||
|
|
||
|
rlPhaseStart FAIL "Create list of all kernel tracepoints known to stap"
|
||
|
rlRun "stap -l 'kernel.trace(\"*\")' > tracepoints"
|
||
|
rlFileSubmit tracepoints
|
||
|
rlPhaseEnd
|
||
|
|
||
|
rlPhaseStart FAIL "Check irq_vectors"
|
||
|
dir='/sys/kernel/debug/tracing/events/irq_vectors'
|
||
|
if test -d $dir; then
|
||
|
for p in $( find $dir -mindepth 1 -type d | awk -F\/ '{print $NF}' ); do
|
||
|
rlLogInfo "Checking $p"
|
||
|
rlRun "grep -q $p tracepoints"
|
||
|
done
|
||
|
# additional checks
|
||
|
rlRun "stap -vp4 -e 'probe kernel.trace(\"local_timer_entry\") {println(pp())}'"
|
||
|
rlRun "stap -vp4 -e 'probe kernel.trace(\"reschedule_entry\") {println(pp())}'"
|
||
|
else
|
||
|
if arch | egrep 'x86_64|i[36]86'; then
|
||
|
rlLogError "$dir does not exist"
|
||
|
else
|
||
|
rlLogInfo "$dir does not exist"
|
||
|
fi
|
||
|
fi
|
||
|
rlPhaseEnd
|
||
|
|
||
|
rlPhaseStartCleanup
|
||
|
rlRun "popd"
|
||
|
rlRun "rm -r $TMPDIR"
|
||
|
rlPhaseEnd
|
||
|
rlJournalPrintText
|
||
|
rlJournalEnd
|