brintos

brintos / linux-shallow public Read only

0
0
Text · 853 B · 27da2db Raw
44 lines · plain
1#!/bin/sh2# SPDX-License-Identifier: GPL-2.03# description: trace_marker trigger - test snapshot trigger4# requires: set_event snapshot events/ftrace/print/trigger5# flags: instance6 7fail() { #msg8    echo $19    exit_fail10}11 12test_trace() {13    file=$114    x=$215 16    cat $file | while read line; do17	comment=`echo $line | sed -e 's/^#//'`18	if [ "$line" != "$comment" ]; then19	    continue20	fi21	echo "testing $line for >$x<"22	match=`echo $line | sed -e "s/>$x<//"`23	if [ "$line" = "$match" ]; then24	    fail "$line does not have >$x< in it"25	fi26	x=$((x+2))27    done28}29 30echo "Test snapshot trace_marker trigger"31 32echo 'snapshot' > events/ftrace/print/trigger33 34# make sure the snapshot is allocated35 36grep -q 'Snapshot is allocated' snapshot37 38for i in `seq 1 10` ; do echo "hello >$i<" > trace_marker; done39 40test_trace trace 141test_trace snapshot 242 43exit 044