diff options
author | Anton Blanchard <[email protected]> | 2012-06-20 12:53:03 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2012-06-20 14:39:36 -0700 |
commit | f39cdaebb89dc3e6dd4f3e75b6d4e87ef12190af (patch) | |
tree | 3e6db2d5c97c822591350be26a09097589ef5b8c /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | 10d8935f46e5028847b179757ecbf9238b13d129 (diff) |
fault-inject: avoid call to random32() if fault injection is disabled
After enabling CONFIG_FAILSLAB I noticed random32 in profiles even if slub
fault injection wasn't enabled at runtime.
should_fail forces a comparison against random32() even if probability is
0:
if (attr->probability <= random32() % 100)
return false;
Add a check up front for probability == 0 and avoid all of the more
complicated checks.
Signed-off-by: Anton Blanchard <[email protected]>
Acked-by: Akinobu Mita <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions