jjb: lava: kprobe-fuzzing: Fix: clear events before next iteration
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 15 Mar 2018 03:48:30 +0000 (23:48 -0400)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 15 Mar 2018 18:45:08 +0000 (14:45 -0400)
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
scripts/system-tests/run-kprobe-fuzzing.py

index aed583e08a1a52bd7c2617c10d8f93ccd18e765c..3c7c7668741efb73dfe96f433202debc75b37957 100644 (file)
@@ -55,16 +55,18 @@ def set_kprobe_tracing_state(state):
     if state not in (0 ,1):
         raise ValueError
 
-    if state == 0:
-        # Clear the content of the trace.
-        open('/sys/kernel/debug/tracing/trace', 'w').close()
-
     try:
         with open('/sys/kernel/debug/tracing/events/kprobes/enable', 'w') as enable_kprobe_file:
             enable_kprobe_file.write('{}\n'.format(state))
     except IOError:
         print('kprobes/enable file does not exist')
 
+    if state == 0:
+        # Clear the content of the trace.
+        open('/sys/kernel/debug/tracing/trace', 'w').close()
+        # Clear all the events.
+        open('/sys/kernel/debug/tracing/kprobe_events', 'w').close()
+
 def run_workload():
     print('Running workload...', end='')
     sys.stdout.flush()
This page took 0.023456 seconds and 4 git commands to generate.