~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/ktest/examples/bootconfigs/verify-tracing.sh

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #!/bin/sh
  2 
  3 cd /sys/kernel/tracing
  4 
  5 compare_file() {
  6         file="$1"
  7         val="$2"
  8         content=`cat $file`
  9         if [ "$content" != "$val" ]; then
 10                 echo "FAILED: $file has '$content', expected '$val'"
 11                 exit 1
 12         fi
 13 }
 14 
 15 compare_file_partial() {
 16         file="$1"
 17         val="$2"
 18         content=`cat $file | sed -ne "/^$val/p"`
 19         if [ -z "$content" ]; then
 20                 echo "FAILED: $file does not contain '$val'"
 21                 cat $file
 22                 exit 1
 23         fi
 24 }
 25 
 26 file_contains() {
 27         file=$1
 28         val="$2"
 29 
 30         if ! grep -q "$val" $file ; then
 31                 echo "FAILED: $file does not contain $val"
 32                 cat $file
 33                 exit 1
 34         fi
 35 }
 36 
 37 compare_mask() {
 38         file=$1
 39         val="$2"
 40 
 41         content=`cat $file | sed -ne "/^[0 ]*$val/p"`
 42         if [ -z "$content" ]; then
 43                 echo "FAILED: $file does not have mask '$val'"
 44                 cat $file
 45                 exit 1
 46         fi
 47 }
 48 
 49 compare_file "current_tracer" "function_graph"
 50 compare_file "options/event-fork" "1"
 51 compare_file "options/sym-addr" "1"
 52 compare_file "options/stacktrace" "1"
 53 compare_file "buffer_size_kb" "1024"
 54 file_contains "snapshot" "Snapshot is allocated"
 55 file_contains "trace_clock" '\[global\]'
 56 
 57 compare_file "events/initcall/enable" "1"
 58 compare_file "events/task/task_newtask/enable" "1"
 59 compare_file "events/sched/sched_process_exec/filter" "pid < 128"
 60 compare_file "events/kprobes/enable" "1"
 61 
 62 compare_file "instances/bar/events/kprobes/myevent/enable" "1"
 63 compare_file "instances/bar/events/kprobes/myevent2/enable" "1"
 64 compare_file "instances/bar/events/kprobes/myevent3/enable" "1"
 65 
 66 compare_file "instances/foo/current_tracer" "function"
 67 compare_file "instances/foo/tracing_on" "0"
 68 
 69 compare_file "/proc/sys/kernel/ftrace_dump_on_oops" "2"
 70 compare_file "/proc/sys/kernel/traceoff_on_warning" "1"
 71 
 72 exit 0

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php