summaryrefslogtreecommitdiffstats
path: root/runtime/probes/bench/ttest.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-07-28 17:33:09 +0000
committerhunt <hunt>2005-07-28 17:33:09 +0000
commit42ee08b55b2f7a12b26f2049d672a1b563f064a4 (patch)
tree080aa7516d0b19de5c606833f98444d252494f51 /runtime/probes/bench/ttest.c
parent377b88310b59601c0d967c55bd6a46ec024dc2de (diff)
downloadsystemtap-steved-42ee08b55b2f7a12b26f2049d672a1b563f064a4.tar.gz
systemtap-steved-42ee08b55b2f7a12b26f2049d672a1b563f064a4.tar.xz
systemtap-steved-42ee08b55b2f7a12b26f2049d672a1b563f064a4.zip
2005-07-28 Martin Hunt <hunt@redhat.com>
* bench/ALL: Chnage to probe sys_getuid() and sys_getgid() because those aren't used by stpd, unlike sys_read() and sys_write().
Diffstat (limited to 'runtime/probes/bench/ttest.c')
-rw-r--r--runtime/probes/bench/ttest.c24
1 files changed, 8 insertions, 16 deletions
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;
}