Date: Thu, 2 Nov 2017 12:15:39 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325317 - head/tools/tools/syscall_timing Message-ID: <201711021215.vA2CFd37026012@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Thu Nov 2 12:15:39 2017 New Revision: 325317 URL: https://svnweb.freebsd.org/changeset/base/325317 Log: Add bad_open benchmark, which measures failed opens by calling open("", O_RDONLY);. Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/tools/tools/syscall_timing/syscall_timing.c Modified: head/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- head/tools/tools/syscall_timing/syscall_timing.c Thu Nov 2 12:14:42 2017 (r325316) +++ head/tools/tools/syscall_timing/syscall_timing.c Thu Nov 2 12:15:39 2017 (r325317) @@ -392,6 +392,21 @@ test_open_close(uintmax_t num, uintmax_t int_arg, cons } uintmax_t +test_bad_open(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; + open("", O_RDONLY); + } + benchmark_stop(); + return (i); +} + +uintmax_t test_read(uintmax_t num, uintmax_t int_arg, const char *path) { char buf[int_arg]; @@ -702,6 +717,7 @@ static const struct test tests[] = { { "socket_tcp", test_socket_stream, .t_int = PF_INET }, { "socket_udp", test_socket_dgram, .t_int = PF_INET }, { "create_unlink", test_create_unlink, .t_flags = FLAG_PATH }, + { "bad_open", test_bad_open }, { "open_close", test_open_close, .t_flags = FLAG_PATH }, { "open_read_close_1", test_open_read_close, .t_flags = FLAG_PATH, .t_int = 1 },
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711021215.vA2CFd37026012>