X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttctl%2Fltt-disarmall.sh;h=56dc3a0b1e48644caae856da3849b4a9061ed7c1;hb=efd72b5d61b85de373b987aa768de315419d4a83;hp=aa1a0d7736160e5676435d94b63df662b37421da;hpb=fde9c319224e496655850ff59c38b8a8659146ee;p=ltt-control.git diff --git a/lttctl/ltt-disarmall.sh b/lttctl/ltt-disarmall.sh index aa1a0d7..56dc3a0 100755 --- a/lttctl/ltt-disarmall.sh +++ b/lttctl/ltt-disarmall.sh @@ -1,4 +1,5 @@ # Copyright (C) 2009 Benjamin Poirier +# Copyright (C) 2010 Mathieu Desnoyers # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,7 +15,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -DEBUGFSROOT=$(grep ^debugfs /proc/mounts | head -1 | awk '{print $2}') +DEBUGFSROOT=$(awk '{if ($3 == "debugfs") print $2}' /proc/mounts | head -n 1) MARKERSROOT=${DEBUGFSROOT}/ltt/markers usage () { @@ -48,7 +49,7 @@ while getopts "qh" options; do done shift $((${OPTIND} - 1)) -while read -r -d $'\0' marker; do +(eval "find '${MARKERSROOT}' -name metadata -prune -o -name enable -print") | while read -r marker; do grep "^1$" "${marker}" -q if [ $? -ne 0 ]; then continue @@ -57,4 +58,4 @@ while read -r -d $'\0' marker; do echo "Disconnecting ${marker%/enable}" fi echo 0 > ${marker} -done < <(eval "find '${MARKERSROOT}' -name metadata -prune -o -name enable -print0") +done