-
-
Save cwen0/0ef3deab656d8e32204a5b798601554f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global inject, delay_cnt | |
probe begin { | |
println("injdect diskio delay begin.\n"); | |
} | |
probe procfs("cnt").read { | |
$value = sprintf("%d\n", delay_cnt); | |
} | |
probe procfs("inject").write { | |
inject = $value; | |
printf("inject count %d, delay_cnt %s", delay_cnt, inject); | |
} | |
probe vfs.read.return { | |
if ($return && devname == @1 && inject == "on\n") { | |
delay_cnt++; | |
udelay($2); | |
} | |
} | |
probe vfs.write.return { | |
if ($return && devname == @1 && inject == "on\n") { | |
delay_cnt++; | |
udelay($3); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment