From owner-svn-src-stable@FreeBSD.ORG Sat Jun 9 08:23:55 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCC8A1065673; Sat, 9 Jun 2012 08:23:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B78788FC0A; Sat, 9 Jun 2012 08:23:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q598NtD6017368; Sat, 9 Jun 2012 08:23:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q598Ntn0017366; Sat, 9 Jun 2012 08:23:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201206090823.q598Ntn0017366@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 9 Jun 2012 08:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236797 - stable/9/tools/tools/syscall_timing X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 09 Jun 2012 08:23:55 -0000 Author: kib Date: Sat Jun 9 08:23:55 2012 New Revision: 236797 URL: http://svn.freebsd.org/changeset/base/236797 Log: MFC r236686: Add gettimeofday() test. Modified: stable/9/tools/tools/syscall_timing/syscall_timing.c Directory Properties: stable/9/tools/tools/syscall_timing/ (props changed) Modified: stable/9/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- stable/9/tools/tools/syscall_timing/syscall_timing.c Sat Jun 9 08:13:57 2012 (r236796) +++ stable/9/tools/tools/syscall_timing/syscall_timing.c Sat Jun 9 08:23:55 2012 (r236797) @@ -142,6 +142,22 @@ test_clock_gettime(uintmax_t num, uintma } uintmax_t +test_gettimeofday(uintmax_t num, uintmax_t int_arg, const char *path) +{ + struct timeval tv; + uintmax_t i; + + benchmark_start(); + for (i = 0; i < num; i++) { + if (alarm_fired) + break; + (void)gettimeofday(&tv, NULL); + } + benchmark_stop(); + return (i); +} + +uintmax_t test_pipe(uintmax_t num, uintmax_t int_arg, const char *path) { int fd[2], i; @@ -608,6 +624,7 @@ static const struct test tests[] = { { "getuid", test_getuid }, { "getppid", test_getppid }, { "clock_gettime", test_clock_gettime }, + { "gettimeofday", test_gettimeofday }, { "pipe", test_pipe }, { "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL }, { "socket_local_dgram", test_socket_dgram, .t_int = PF_LOCAL },