summaryrefslogtreecommitdiffstats
path: root/ci/envs/disable_trace.sh
diff options
context:
space:
mode:
authorJiang, Yunhong <yunhong.jiang@intel.com>2017-02-16 18:00:47 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-02-16 18:00:47 +0000
commit48f1b1f5298bc4960f261df412315d6e15897c43 (patch)
treead2e2861ebfb25532a377a23f76e4c0fcbebac68 /ci/envs/disable_trace.sh
parent881aa3fcf152088440444d6f4296eaac3783801c (diff)
parentbe208cb48be4f4db438ce27be15e1f6166c26910 (diff)
Merge "Enabling ftrace for kernel debugging."
Diffstat (limited to 'ci/envs/disable_trace.sh')
-rwxr-xr-xci/envs/disable_trace.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/ci/envs/disable_trace.sh b/ci/envs/disable_trace.sh
new file mode 100755
index 000000000..1b04e62bb
--- /dev/null
+++ b/ci/envs/disable_trace.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set -o xtrace
+curpwd=`pwd`
+TRACE_FILE=$1
+TRACEDIR=/sys/kernel/debug/tracing/
+
+sudo bash -c "echo 0 >$TRACEDIR/tracing_on"
+sleep 1
+sudo bash -c "cat $TRACEDIR/trace > $TRACE_FILE"
+sudo bash -c "echo > $TRACEDIR/set_event"
+sudo bash -c "echo > $TRACEDIR/trace"
+sudo sysctl kernel.ftrace_enabled=0
+sudo bash -c "echo nop > $TRACEDIR/current_tracer"
+
+set +o xtrace
+cd $curpwd