6a62174b |
1 | # This script will enable the system-wide tap on the given list of events passed |
2 | # as parameter, and stop the tap at each other "normal rate" events. |
3 | |
4 | #excluding core markers (already connected) |
5 | #excluding locking markers (high traffic) |
6 | |
7 | echo Connecting function markers |
8 | |
9 | # interesting period starts with the list of events passed as parameter. |
10 | START_FTRACE=$* |
11 | |
12 | # interesting period may stop with one specific event, but also try to keep the |
13 | # other START_FTRACE events triggers to the lowest possible overhead by stopping |
14 | # function trace at every other events. |
15 | # Do _not_ disable function tracing in ftrace_entry event unless you really only |
16 | # want the first function entry... |
17 | STOP_FTRACE=`cat /proc/ltt|grep -v %k|awk '{print $2}'|sort -u|grep -v ^core_|grep -v ^locking_|grep -v ^lockdep|grep -v ftrace_entry|grep -v ^tap_` |
18 | |
19 | for a in $START_FTRACE; do |
20 | STOP_FTRACE=`echo $STOP_FTRACE|sed 's/$a//'` |
21 | done |
22 | |
23 | |
24 | for a in $STOP_FTRACE; do |
25 | echo Connecting stop $a |
26 | echo "connect $a ftrace_system_stop" > /proc/ltt |
27 | done |
28 | |
29 | for a in $START_FTRACE; do |
30 | echo Connecting start $a |
31 | echo "connect $a ftrace_system_start" > /proc/ltt |
32 | done |
33 | |
34 | |