Commit 6d925498 authored by Benjamin Poirier's avatar Benjamin Poirier Committed by yonghong-song

inject: Add support for alloc_page family of functions (#2114)

* inject: Add support for alloc_page family of functions

* Add vim backup files to gitignore
parent aed9b1e2
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
*.swo *.swo
*.pyc *.pyc
.idea .idea
*~
# Build artifacts # Build artifacts
/build/ /build/
......
...@@ -41,6 +41,7 @@ class Probe: ...@@ -41,6 +41,7 @@ class Probe:
errno_mapping = { errno_mapping = {
"kmalloc": "-ENOMEM", "kmalloc": "-ENOMEM",
"bio": "-EIO", "bio": "-EIO",
"alloc_page" : "true",
} }
@classmethod @classmethod
...@@ -327,6 +328,7 @@ EXAMPLES: ...@@ -327,6 +328,7 @@ EXAMPLES:
error_injection_mapping = { error_injection_mapping = {
"kmalloc": "should_failslab(struct kmem_cache *s, gfp_t gfpflags)", "kmalloc": "should_failslab(struct kmem_cache *s, gfp_t gfpflags)",
"bio": "should_fail_bio(struct bio *bio)", "bio": "should_fail_bio(struct bio *bio)",
"alloc_page": "should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)",
} }
def __init__(self): def __init__(self):
...@@ -334,7 +336,7 @@ EXAMPLES: ...@@ -334,7 +336,7 @@ EXAMPLES:
" functionality when call chain and predicates are met", " functionality when call chain and predicates are met",
formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=Tool.examples) epilog=Tool.examples)
parser.add_argument(dest="mode", choices=['kmalloc','bio'], parser.add_argument(dest="mode", choices=["kmalloc", "bio", "alloc_page"],
help="indicate which base kernel function to fail") help="indicate which base kernel function to fail")
parser.add_argument(metavar="spec", dest="spec", parser.add_argument(metavar="spec", dest="spec",
help="specify call chain") help="specify call chain")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment