From 479eb3bed67bfe9392f2299ade86e97613f99f4c Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Wed, 14 Mar 2018 23:48:30 -0400 Subject: [PATCH] jjb: lava: kprobe-fuzzing: Fix: clear events before next iteration Signed-off-by: Francis Deslauriers --- scripts/system-tests/run-kprobe-fuzzing.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/system-tests/run-kprobe-fuzzing.py b/scripts/system-tests/run-kprobe-fuzzing.py index aed583e..3c7c766 100644 --- a/scripts/system-tests/run-kprobe-fuzzing.py +++ b/scripts/system-tests/run-kprobe-fuzzing.py @@ -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() -- 2.34.1