Skip to contentSkip to conversation

process filtering for fault-injection capabilities

PATCH Don Mullis 2 participants 4 messages Sep 8, 2006 – Sep 12, 2006 Library code

lore
Share & tools
lore

Don Mullis

author
#0 lore raw

Suggested changes, implemented by patch below:

1) Reorder kernel command line args alphabetically -- lets output of ls /debug/failslab serve as a handy reminder of the arg bindings.

2) Rename a variable to agree with the /debug file name.

---
 lib/should_fail.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
lib/should_fail.c +8 -6
Index: linux-2.6.17/lib/should_fail.c
===================================================================
@@ -13,18 +13,20 @@ int setup_should_fail(struct should_fail
 	unsigned long interval;
 	int times;
 	int space;
-	unsigned long filter;
+	unsigned long process_filter;
 
-	/* "<probability>,<interval>,<times>,<space>,<process-filter>" */
-	if (sscanf(str, "%lu,%lu,%d,%d,%lu", &probability, &interval, &times,
-		   &space, &filter) < 5)
-		return 0;
+	/* "<interval>,<probability>,<process-filter>,<space>,<times>" */
+	if (sscanf(str, "%lu,%lu,%lu,%d,%d", &interval,
+		   &probability, &process_filter, &space, &times) < 5) {
+		printk( "SHOULD_FAIL: failed to parse arguments\n");
+  		return 0;
+	}
 
 	data->probability = probability;
 	data->interval = interval;
 	atomic_set(&data->times, times);
 	atomic_set(&data->space, space);
-	data->process_filter = filter;
+	data->process_filter = process_filter;
 
 	return 1;
 }
#1 lore raw
Quoted 5 lines · Don Mullis

1) Reorder kernel command line args alphabetically -- lets output of ls /debug/failslab serve as a handy reminder of the arg bindings.

2) Rename a variable to agree with the /debug file name.

Yes. this kernel command line was confusing.
This change makes it better.

Now I'm writing the filter which allow failing only for a specific module by using unwinding kernel stacks API.

Then I'll send next version with your fixes.

author
#2 lore raw
Quoted 2 lines · Akinobu Mita

Now I'm writing the filter which allow failing only for a specific module by using unwinding kernel stacks API.

Are you planning to use STACK_UNWIND? I see that only i386 supports STACK_UNWIND.

Perhaps the much simpler STACKTRACE would suffice -- supported by i386, x86_64, and s390?

#3 lore raw
Quoted 9 lines · Don Mullis
Quoted 2 lines · Akinobu Mita

Now I'm writing the filter which allow failing only for a specific module by using unwinding kernel stacks API.

Are you planning to use STACK_UNWIND? I see that only i386 supports STACK_UNWIND.

Perhaps the much simpler STACKTRACE would suffice -- supported by i386, x86_64, and s390?

Thanks, I didn't realize the include/linux/stacktrace.h