1 #define _XOPEN_SOURCE 700
13 static char *names[] = {
14 #define T(i,f) [i] = #f,
22 int fd = open("/tmp/wrap", O_RDONLY);
24 dprintf(2, "open /tmp/wrap failed: %m\n");
27 tab = mmap(0, 2000 * sizeof *tab, PROT_READ, MAP_PRIVATE, fd, 0);
28 if (tab == MAP_FAILED) {
29 dprintf(2, "mmap: %m\n");
32 for (i = 0; i < sizeof names/sizeof *names; i++)
34 dprintf(1, "%s: %llu calls %llu ns %f us/call\n",
35 names[i], tab[i].c, tab[i].t, (double)tab[i].t/(1000*tab[i].c));