Author: kib
Date: Wed Jun  6 16:26:55 2012
New Revision: 236686
URL: http://svn.freebsd.org/changeset/base/236686

Log:
  Add gettimeofday() test.
  
  MFC after:    3 days

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 Jun  6 16:20:59 
2012        (r236685)
+++ head/tools/tools/syscall_timing/syscall_timing.c    Wed Jun  6 16:26:55 
2012        (r236686)
@@ -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 },
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to