Date: Wed, 4 Jul 2018 13:28:44 +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: r335938 - head/tools/tools/syscall_timing Message-ID: <201807041328.w64DSiW6002933@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Wed Jul 4 13:28:43 2018 New Revision: 335938 URL: https://svnweb.freebsd.org/changeset/base/335938 Log: Add getprogname(3) (ie null) benchmark. 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 Wed Jul 4 13:28:16 2018 (r335937) +++ head/tools/tools/syscall_timing/syscall_timing.c Wed Jul 4 13:28:43 2018 (r335938) @@ -184,7 +184,24 @@ test_getpriority(uintmax_t num, uintmax_t int_arg, con return (i); } +/* + * The point of this one is to figure out the cost of a call into libc, + * through PLT, and back. + */ uintmax_t +test_getprogname(uintmax_t num, uintmax_t int_arg, const char *path) +{ + uintmax_t i; + + benchmark_start(); + BENCHMARK_FOREACH(i, num) { + (void)getprogname(); + } + benchmark_stop(); + return (i); +} + +uintmax_t test_pipe(uintmax_t num, uintmax_t int_arg, const char *path) { int fd[2], i; @@ -678,6 +695,7 @@ static const struct test tests[] = { { "clock_gettime", test_clock_gettime }, { "gettimeofday", test_gettimeofday }, { "getpriority", test_getpriority }, + { "getprogname", test_getprogname }, { "pipe", test_pipe }, { "select", test_select }, { "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL },
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807041328.w64DSiW6002933>