From 3c037c17e0b307c288e85b4da0af74e13f4718ec Mon Sep 17 00:00:00 2001 From: compudj Date: Mon, 15 Oct 2007 16:48:04 +0000 Subject: [PATCH] add arm/disarmall git-svn-id: http://ltt.polymtl.ca/svn@2687 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt-control/lttctl/Makefile.am | 15 +++++++++++++++ ltt-control/lttctl/ltt-armall.sh | 11 +++++++++++ ltt-control/lttctl/ltt-disarmall.sh | 10 ++++++++++ 3 files changed, 36 insertions(+) create mode 100755 ltt-control/lttctl/ltt-armall.sh create mode 100755 ltt-control/lttctl/ltt-disarmall.sh diff --git a/ltt-control/lttctl/Makefile.am b/ltt-control/lttctl/Makefile.am index 6a5180d..d151bf6 100644 --- a/ltt-control/lttctl/Makefile.am +++ b/ltt-control/lttctl/Makefile.am @@ -3,6 +3,21 @@ AM_CFLAGS = -DPACKAGE_DATA_DIR=\""$(datadir)"\" -DPACKAGE_BIN_DIR=\""$(bindir)"\" bin_PROGRAMS = lttctl +bin_SCRIPTS = ltt-armall ltt-disarmall +CLEANFILES = $(bin_SCRIPTS) +EXTRA_DIST = ltt-armall.sh ltt-disarmall.sh + +ltt-armall: ltt-armall.sh + rm -f ltt-armall + echo "#!"$(BASH) > ltt-armall + cat $(srcdir)/ltt-armall.sh >> ltt-armall + chmod ugo+x ltt-armall + +ltt-disarmall: ltt-disarmall.sh + rm -f ltt-disarmall + echo "#!"$(BASH) > ltt-disarmall + cat $(srcdir)/ltt-disarmall.sh >> ltt-disarmall + chmod ugo+x ltt-disarmall lttctl_SOURCES = \ lttctl.c diff --git a/ltt-control/lttctl/ltt-armall.sh b/ltt-control/lttctl/ltt-armall.sh new file mode 100755 index 0000000..0ec03f3 --- /dev/null +++ b/ltt-control/lttctl/ltt-armall.sh @@ -0,0 +1,11 @@ +#excluding core markers (already connected) +#excluding locking markers (high traffic) +echo Connecting all markers +MARKERS=`cat /proc/ltt|grep -v %k|awk '{print $2}'|sort -u|grep -v ^core_|grep -v ^locking_` +for a in $MARKERS; do echo Connecting $a; echo "connect $a default" > /proc/ltt > /proc/ltt; done + +#excluding locking markers (high traffic) +#core markers must be armed +echo Arming all markers +MARKERS=`cat /proc/ltt|awk '{print $2}'|sort -u|grep -v ^locking_` +for a in $MARKERS; do echo Arming $a; echo "arm $a" > /proc/ltt; done diff --git a/ltt-control/lttctl/ltt-disarmall.sh b/ltt-control/lttctl/ltt-disarmall.sh new file mode 100755 index 0000000..c8718bf --- /dev/null +++ b/ltt-control/lttctl/ltt-disarmall.sh @@ -0,0 +1,10 @@ +#excluding locking +echo Disarming all markers +MARKERS=`cat /proc/ltt|awk '{print $2}'|sort -u|grep -v ^locking_` +for a in $MARKERS; do echo Disarming $a; echo "disarm $a" > /proc/ltt; done + +#excluding locking +#excluding core markers, not connected to default. +echo Disconnecting all markers +MARKERS=`cat /proc/ltt|grep -v %k|awk '{print $2}'|sort -u|grep -v ^core_|grep -v ^locking_` +for a in $MARKERS; do echo Disconnecting $a; echo "disconnect $a" > /proc/ltt; done -- 2.34.1