From owner-svn-src-stable@freebsd.org Mon Apr 16 17:28:59 2018 Return-Path: Delivered-To: svn-src-stable@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 BE55EF963AD; Mon, 16 Apr 2018 17:28:59 +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 705648067B; Mon, 16 Apr 2018 17:28:59 +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 6B28C205B4; Mon, 16 Apr 2018 17:28:59 +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 w3GHSxbK032427; Mon, 16 Apr 2018 17:28:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GHSxTo032426; Mon, 16 Apr 2018 17:28:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804161728.w3GHSxTo032426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 16 Apr 2018 17:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332626 - stable/11/tools/tools/syscall_timing X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/tools/tools/syscall_timing X-SVN-Commit-Revision: 332626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 17:28:59 -0000 Author: trasz Date: Mon Apr 16 17:28:59 2018 New Revision: 332626 URL: https://svnweb.freebsd.org/changeset/base/332626 Log: MFC r325316: Add benchmark for getresuid(2) - three pointers, although only "output" ones, and quite lightwait. The purpose of this commit, and the previous one, is to be able to measure overhead of pointer arguments - in case you're running a strange architecture where pointers and integers are quite different things at the hardware level. 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:27:13 2018 (r332625) +++ stable/11/tools/tools/syscall_timing/syscall_timing.c Mon Apr 16 17:28:59 2018 (r332626) @@ -131,6 +131,22 @@ test_getppid(uintmax_t num, uintmax_t int_arg, const c } uintmax_t +test_getresuid(uintmax_t num, uintmax_t int_arg, const char *path) +{ + uid_t ruid, euid, suid; + uintmax_t i; + + benchmark_start(); + for (i = 0; i < num; i++) { + if (alarm_fired) + break; + (void)getresuid(&ruid, &euid, &suid); + } + benchmark_stop(); + return (i); +} + +uintmax_t test_clock_gettime(uintmax_t num, uintmax_t int_arg, const char *path) { struct timespec ts; @@ -687,6 +703,7 @@ struct test { static const struct test tests[] = { { "getuid", test_getuid }, { "getppid", test_getppid }, + { "getresuid", test_getresuid }, { "clock_gettime", test_clock_gettime }, { "gettimeofday", test_gettimeofday }, { "getpriority", test_getpriority },