From owner-svn-src-all@freebsd.org Wed Jul 4 13:28:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7D7810356A9; Wed, 4 Jul 2018 13:28:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5833D7A5F8; Wed, 4 Jul 2018 13:28:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 398073AC8; Wed, 4 Jul 2018 13:28:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w64DSig5002934; Wed, 4 Jul 2018 13:28:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w64DSiW6002933; Wed, 4 Jul 2018 13:28:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201807041328.w64DSiW6002933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 4 Jul 2018 13:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335938 - head/tools/tools/syscall_timing X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/tools/tools/syscall_timing X-SVN-Commit-Revision: 335938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jul 2018 13:28:44 -0000 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 },