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 <[email protected]> # 13# # 14############################################################################### 15 16MAX_LOOP=1500 17count=0 18 19while true; do 20 count=$(( $count + 1 )) 21 i=0 22 while [ $i -lt $MAX_LOOP ]; do 23 echo 0 > /proc/sys/kernel/ftrace_enabled 24 echo 1 > /proc/sys/kernel/ftrace_enabled 25 i=$((i + 1)) 26 done 27 28 enable=$(( $count % 3 )) 29 30 if [ $enable -eq 0 ]; then 31 echo 1 > /proc/sys/kernel/ftrace_enabled 32 else 33 echo 0 > /proc/sys/kernel/ftrace_enabled 34 fi 35 36 sleep 1 37done 38 39