diff --git a/lib/test_sysctl.c b/lib/test_sysctl.c index dd795979558a..65ce42346170 100644 --- a/lib/test_sysctl.c +++ b/lib/test_sysctl.c @@ -15,6 +15,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include +#include #include #include #include @@ -48,6 +49,10 @@ struct test_sysctl_data { int boot_int; + int int_jiffies; + int int_ms_jiffies; + int int_userhz_jiffies; + unsigned int uint_0001; char string_0001[65]; @@ -67,6 +72,11 @@ static struct test_sysctl_data test_data = { .boot_int = 0, + /* One second in each converter's unit; all three store HZ jiffies. */ + .int_jiffies = HZ, + .int_ms_jiffies = HZ, + .int_userhz_jiffies = HZ, + .uint_0001 = 314, .string_0001 = "(none)", @@ -113,6 +123,27 @@ static const struct ctl_table test_table[] = { .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_ONE, }, + { + .procname = "int_jiffies", + .data = &test_data.int_jiffies, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_jiffies, + }, + { + .procname = "int_ms_jiffies", + .data = &test_data.int_ms_jiffies, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_ms_jiffies, + }, + { + .procname = "int_userhz_jiffies", + .data = &test_data.int_userhz_jiffies, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_userhz_jiffies, + }, { .procname = "uint_0001", .data = &test_data.uint_0001,