Home | History | Annotate | Download | only in ftrace_stress
      1 #! /bin/sh
      2 
      3 ###############################################################################
      4 #                                                                             #
      5 # Copyright (c) 2010 FUJITSU LIMITED                                          #
      6 #                                                                             #
      7 # This program is free software; you can redistribute it and/or modify it     #
      8 # under the terms of the GNU General Public License as published by the Free  #
      9 # Software Foundation; either version 2 of the License, or (at your option)   #
     10 # any later version.                                                          #
     11 #                                                                             #
     12 # Author: Li Zefan <lizf (at] cn.fujitsu.com>                                      #
     13 #                                                                             #
     14 ###############################################################################
     15 
     16 LOOP=200
     17 
     18 should_skip=0
     19 nr_cpus=`tst_ncpus`
     20 
     21 if [ ! -e "$TRACING_PATH"/function_profile_enabled ]; then
     22         should_skip=1
     23 fi
     24 
     25 # For kernels older than 2.6.36, this testcase can result in
     26 # divide-by-zero kernel bug
     27 if tst_kvcmp -lt "2.6.36"; then
     28 	should_skip=1
     29 fi
     30 
     31 while true; do
     32 	if [ $should_skip -eq 1 ]; then
     33 		sleep 2
     34 		continue
     35 	fi
     36 	cpu=$(tst_random 0 $((nr_cpus - 1)))
     37 	i=0;
     38 	while [ $i -lt $LOOP ]; do
     39 		cat "$TRACING_PATH"/trace_stat/function${cpu} > /dev/null 2>&1
     40 		i=$((i + 1))
     41 	done
     42 
     43 	sleep 1
     44 done
     45