[PATCH 2/3] tracing/kselftests: Remove triggers with references before their definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If an event trigger references a variable defined in another trigger, it
has to be removed before the trigger that defines the variable is
removed.

Signed-off-by: Kalesh Singh <kaleshsingh@xxxxxxxxxx>
---
 tools/testing/selftests/ftrace/test.d/functions | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
index 000fd05e84b1..bd9e85f4d626 100644
--- a/tools/testing/selftests/ftrace/test.d/functions
+++ b/tools/testing/selftests/ftrace/test.d/functions
@@ -22,6 +22,15 @@ reset_trigger_file() {
 	file=`echo $line | cut -f1 -d:`
 	echo "!$cmd" >> $file
     done
+
+    # remove triggers with references next
+    grep -H '\$' $@ |
+    while read line; do
+        cmd=`echo $line | cut -f2- -d: | cut -f1 -d"["`
+	file=`echo $line | cut -f1 -d:`
+	echo "!$cmd" >> $file
+    done
+
     grep -Hv ^# $@ |
     while read line; do
         cmd=`echo $line | cut -f2- -d: | cut -f1 -d"["`
-- 
2.33.0.1079.g6e70778dc9-goog




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux