Date: Mon, 16 Apr 2018 17:26:32 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332624 - stable/11/tools/tools/syscall_timing Message-ID: <201804161726.w3GHQWmG031836@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Mon Apr 16 17:26:32 2018 New Revision: 332624 URL: https://svnweb.freebsd.org/changeset/base/332624 Log: MFC r325314: Add getpriority(2) benchmark; it's a lightweight syscall which does pretty much nothing - just like getuid(2) - but takes arguments. Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- stable/11/tools/tools/syscall_timing/syscall_timing.c Mon Apr 16 17:25:52 2018 (r332623) +++ stable/11/tools/tools/syscall_timing/syscall_timing.c Mon Apr 16 17:26:32 2018 (r332624) @@ -31,6 +31,7 @@ #include <sys/types.h> #include <sys/mman.h> +#include <sys/resource.h> #include <sys/socket.h> #include <sys/stat.h> #include <sys/time.h> @@ -162,6 +163,22 @@ test_gettimeofday(uintmax_t num, uintmax_t int_arg, co } uintmax_t +test_getpriority(uintmax_t num, uintmax_t int_arg, const char *path) +{ + uintmax_t i; + + benchmark_start(); + for (i = 0; i < num; i++) { + if (alarm_fired) + break; + (void)getpriority(PRIO_PROCESS, 0); + } + benchmark_stop(); + return (i); +} + + +uintmax_t test_pipe(uintmax_t num, uintmax_t int_arg, const char *path) { int fd[2], i; @@ -648,6 +665,7 @@ static const struct test tests[] = { { "getppid", test_getppid }, { "clock_gettime", test_clock_gettime }, { "gettimeofday", test_gettimeofday }, + { "getpriority", test_getpriority }, { "pipe", test_pipe }, { "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL }, { "socket_local_dgram", test_socket_dgram, .t_int = PF_LOCAL },
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804161726.w3GHQWmG031836>