Check out the new USENIX Web site. next up previous
Next: /proc/net/magnet Up: MAGNeT in User Space Previous: User/Kernel Interface and Synchronization


MAGNeT System Information

In order to accurately gauge the amount of time spent in protocol-stack layers, MAGNeT requires very high-fidelity timing. To this end, MAGNeT timestamp values are recorded in units of processor-clock cycles by the kernel's get_cycles() function. In addition, the first record stored by MAGNeT in the circular buffer is a record of type MAGNET_SYSINFO, whose size field contains the processor-clock speed estimated by the kernel. This information allows for easy conversion of MAGNeT timestamp values to wall-clock time.

The MAGNET_SYSINFO event record also provides endian-awareness. Since this field is guaranteed to be the first record in the circular buffer every time the MAGNeT device file is opened, it will be the first record that the user-application reads. The value of the event field of this record lets data processing software determine if the records were saved on a big- or little-endian machine (e.g., if the records are saved to a file for later processing on a different machine). Specifically, MAGNET_SYSINFO is defined in magnet.h to have a value of 0x01234567. If the first record read by the data processor has an event field of this value, no endian translation is necessary. On the other hand, if the first record's event field contains a different value (e.g., a value of 0x67452301), the file was saved on a machine with a different endian orientation than the processing machine, so endian translation is necessary.


next up previous
Next: /proc/net/magnet Up: MAGNeT in User Space Previous: User/Kernel Interface and Synchronization
Jeffrey R. Hay 2001-09-12