exit_unsupported
fi
+do_function_fork=1
+
+if [ ! -f options/function-fork ]; then
+ do_function_fork=0
+ echo "no option for function-fork found. Option will not be tested."
+fi
+
read PID _ < /proc/self/stat
-# default value of function-fork option
-orig_value=`grep function-fork trace_options`
+if [ $do_function_fork -eq 1 ]; then
+ # default value of function-fork option
+ orig_value=`grep function-fork trace_options`
+fi
do_reset() {
reset_tracer
echo > set_ftrace_filter
echo > set_ftrace_pid
+ if [ $do_function_fork -eq 0 ]; then
+ return
+ fi
+
echo $orig_value > trace_options
}
echo $PID > set_ftrace_pid
echo function > current_tracer
- # don't allow children to be traced
- echo nofunction-fork > trace_options
+ if [ $do_function_fork -eq 1 ]; then
+ # don't allow children to be traced
+ echo nofunction-fork > trace_options
+ fi
enable_tracing
yield
disable_tracing
clear_trace
+ if [ $do_function_fork -eq 0 ]; then
+ return
+ fi
+
# allow children to be traced
echo function-fork > trace_options