[PATCH] High-resolution process time

From: Nick Rasmussen (nick@jive.org)
Date: Thu May 04 2000 - 14:54:24 EST


This patch enables very low-overhead access to high-resolution process virtual
time and, optionally, high-resolution virtualized user and system time.
      
If enabled, a page of memory containing timing values is allocated with each
task_struct, and an extra per-pid proc entry (/proc/PID/hrtime) is created
which, when mmapped, maps the timing page into the user's address space. All
process timing queries can be then be performed at memory reference speeds,
without the overhead of a system call. Timers work at the resolution of the
hardware timestamp counters. For convenience, a library is provided which can
be used to perform the mapping and timer querying.

Using the library and this patch, the cost to get your own process virtual
time with TSC precision is ~90 cycles.
  
In the current implementation, permissions on /proc/PID/hrtime are set to 400.

The library and the latest version of the patch against various 2.2 and 2.3
kernels is available at http://www.cs.wisc.edu/paradyn/libhrtime/. The
following patch is against 2.3.99-pre6

These timers were developed as part of the Paradyn Parallel Performance Tools
project at the University of Wisconsin.
  
-nick



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:15 EST