Index: tools/tools/syscall_timing/syscall_timing.c =================================================================== --- tools/tools/syscall_timing/syscall_timing.c +++ tools/tools/syscall_timing/syscall_timing.c @@ -36,9 +36,12 @@ #include #include #include +#include #include #include +#include + #include #include #include @@ -841,6 +844,27 @@ } static uintmax_t +test_sysctl(uintmax_t num, uintmax_t int_arg __unused, const char *path __unused) +{ + int mib[2]; + size_t vallen; + uintmax_t i; + int val; + + mib[0] = CTL_VM; + mib[1] = VM_OVERCOMMIT; + vallen = sizeof(val); + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + if (sysctl(mib, 2, &val, &vallen, NULL, 0) != 0) + err(-1, "test_sysctl: sysctl"); + } + benchmark_stop(); + return (i); +} + +static uintmax_t test_readlink(uintmax_t num, uintmax_t int_arg __unused, const char *path) { char buf[PATH_MAX]; @@ -988,6 +1012,7 @@ { "select", test_select, .t_flags = 0 }, { "semaping", test_semaping, .t_flags = 0 }, { "setuid", test_setuid, .t_flags = 0 }, + { "sysctl", test_sysctl, .t_flags = 0 }, { "shmfd", test_shmfd, .t_flags = 0 }, { "shmfd_dup", test_shmfd_dup, .t_flags = 0 }, { "shmfd_fstat", test_shmfd_fstat, .t_flags = 0 },