From 42ee08b55b2f7a12b26f2049d672a1b563f064a4 Mon Sep 17 00:00:00 2001 From: hunt Date: Thu, 28 Jul 2005 17:33:09 +0000 Subject: 2005-07-28 Martin Hunt * bench/ALL: Chnage to probe sys_getuid() and sys_getgid() because those aren't used by stpd, unlike sys_read() and sys_write(). --- runtime/probes/bench/ttest.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'runtime/probes/bench/ttest.c') diff --git a/runtime/probes/bench/ttest.c b/runtime/probes/bench/ttest.c index eed641da..93b37c84 100644 --- a/runtime/probes/bench/ttest.c +++ b/runtime/probes/bench/ttest.c @@ -37,8 +37,7 @@ void usage(char *name) int main(int argc, char *argv[]) { - int fd, i, n = 1; - char buf[1024]; + int i, n = 1; uint64 nsecs; if (argc > 2) @@ -50,33 +49,26 @@ int main(int argc, char *argv[]) usage(argv[0]); } - fd = open ("foo", O_CREAT | O_RDWR); - /* large warmup time */ for (i = 0; i < n * 1000000; i++) { - if (write (fd, buf, 0) < 0) - perror("write"); + getuid(); } start(); - for (i = 0; i < n * 1000000; i++) { - if (read (fd, buf, 0) < 0) - perror("read"); - } + for (i = 0; i < n * 1000000; i++) + getuid(); + nsecs = stop() / (n * 1000); printf("%lld ", nsecs); start(); - for (i = 0; i < n * 1000000; i++) { - if (write (fd, buf, 0) < 0) - perror("write"); - } + for (i = 0; i < n * 1000000; i++) + getgid(); + nsecs = stop() / (n * 1000); - close (fd); printf("%lld\n", nsecs); - unlink("foo"); return 0; } -- cgit