-
Notifications
You must be signed in to change notification settings - Fork 2
/
trace_test.sh
43 lines (30 loc) · 1.14 KB
/
trace_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
FUNCTION=$1
shift
EXE=$@
echo "FUNCTION: $FUNCTION"
echo "EXE: $EXE"
DEBUGFS_PATH=/sys/kernel/debug
TRACER_PATH=${DEBUGFS_PATH}/tracing
mount -t debugfs nodev ${DEBUGFS_PATH} || echo "debugfs already mounted."
echo function_graph > ${TRACER_PATH}/current_tracer
echo 0 > ${TRACER_PATH}/tracing_on
echo > ${TRACER_PATH}/trace
echo '' > ${TRACER_PATH}/set_ftrace_filter
echo '' > ${TRACER_PATH}/set_graph_function
#echo $FUNCTION > ${TRACER_PATH}/set_graph_function
#echo $FUNCTION > ${TRACER_PATH}/set_ftrace_filter
echo 'xip_file_write' > ${TRACER_PATH}/set_ftrace_filter
#echo 'vfs_write' > ${TRACER_PATH}/set_ftrace_filter
#echo 'xip_file_write' > ${TRACER_PATH}/set_ftrace_filter
echo 'xip_file_write' > ${TRACER_PATH}/set_graph_function
#echo 'vfs_write' > ${TRACER_PATH}/set_graph_function
#echo 'xip_file_write' > ${TRACER_PATH}/set_graph_function
#./write_to_ram_warm Ext2 1 0 1g test.csv
#echo 1 > ${TRACER_PATH}/tracing_on
${EXE}
#echo 0 > ${TRACER_PATH}/tracing_on
echo 0 > ${TRACER_PATH}/tracing_on
echo '' > ${TRACER_PATH}/set_ftrace_filter
echo '' > ${TRACER_PATH}/set_graph_function
cat ${TRACER_PATH}/trace > ${FUNCTION}_graph.txt