Monthly Archives: July 2015

ftrace

#!/bin/bash

if [ -z "`mount |grep debugfs`" ] ; then
	mount -t debugfs debugfs /sys/kernel/debug/
	echo 100000 > /sys/kernel/debug/tracing/buffer_size_kb
fi

echo 0 > /sys/kernel/debug/tracing/tracing_on
echo function > /sys/kernel/debug/tracing/current_tracer
echo > /sys/kernel/debug/tracing/trace
echo 1 > /sys/kernel/debug/tracing/tracing_on

#test
echo 1 > /sys/block/sdg/device/delete

echo 0 > /sys/kernel/debug/tracing/tracing_on
cat /sys/kernel/debug/tracing/trace > f.log