ltt-armall script: disable input subsystem by default
[ltt-control.git] / lttctl / ltt-armall.sh
1 # Copyright (C) 2009 Benjamin Poirier
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
7
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12
13 # You should have received a copy of the GNU General Public License along
14 # with this program; if not, write to the Free Software Foundation, Inc.,
15 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16
17 DEBUGFSROOT=$(grep ^debugfs /proc/mounts | head -n 1 | awk '{print $2}')
18 MARKERSROOT=${DEBUGFSROOT}/ltt/markers
19
20 usage () {
21 echo "Usage: $0 [OPTION]..." > /dev/stderr
22 echo "Connect lttng markers" > /dev/stderr
23 echo "" > /dev/stderr
24 echo "Options:" > /dev/stderr
25 printf "\t-l Also activate locking markers (high traffic)\n" > /dev/stderr
26 printf "\t-n Also activate detailed network markers (large size)\n" > /dev/stderr
27 printf "\t-i Also activate input subsystem events (security implication: records keyboard inputs)\n" > /dev/stderr
28 echo "" > /dev/stderr
29 printf "\t-q Quiet mode, suppress output\n" > /dev/stderr
30 printf "\t-h Print this help\n" > /dev/stderr
31 echo "" > /dev/stderr
32 }
33
34 if [ ! "${DEBUGFSROOT}" ]; then
35 echo "Error: debugfs not mounted" > /dev/stderr
36 exit 1;
37 fi
38
39 if [ ! -d "${MARKERSROOT}" ]; then
40 echo "Error: LTT trace controller not found (did you compile and load LTTng?)" > /dev/stderr
41 exit 1;
42 fi
43
44 while getopts "lnqh" options; do
45 case ${options} in
46 l) LOCKING="0";;
47 n) NETWORK="0";;
48 q) QUIET="0";;
49 i) INPUT="0";;
50 h) usage;
51 exit 0;;
52 \?) usage;
53 exit 1;;
54 esac
55 done
56 shift $((${OPTIND} - 1))
57
58
59 if [ ! ${LOCKING} ]; then
60 TESTS="${TESTS} -name lockdep -prune -o -name locking -prune -o"
61 fi
62
63 if [ ! ${NETWORK} ]; then
64 TESTS="${TESTS} -path '*/net/*_extended' -prune -o"
65 fi
66
67 if [ ! ${INPUT} ]; then
68 TESTS="${TESTS} -name input -prune -o"
69 fi
70
71 (eval "find '${MARKERSROOT}' ${TESTS} -name metadata -prune -o -name enable -print") | while read -r marker; do
72 if [ ! ${QUIET} ]; then
73 echo "Connecting ${marker%/enable}"
74 fi
75 echo 1 > ${marker}
76 done
This page took 0.029811 seconds and 4 git commands to generate.