Check out the new USENIX Web site. next up previous
Next: Instrumented Events Up: MAGNeT in Kernel Space Previous: MAGNeT in Kernel Space

Instrumentation Record

The C header file include/linux/magnet.h contains the global definitions for the MAGNeT system. At the heart of the system is the instrumentation record structure shown in Figure 2.

Figure 2: The MAGNeT Instrumentation Record


struct magnet_data {
  void *sockid;
  unsigned long long timestamp;
  unsigned int event;
  int size;
  union magnet_ext_data data;
}; /* struct magnet data */

The instrumentation record is the data structure that magnet_add() adds to the kernel buffer at each instrumentation point. sockid is a unique identifier for each connection stream,2 giving MAGNeT the ability of separating data traces into individual streams while protecting user privacy. The timestamp field contains a CPU cycle count which serves as both a high-fidelity time measurement for MAGNeT traces, and a synchronization flag between the user and kernel MAGNeT processes (See Section 2.2.1). Valid values for the event field (e.g., MAGNET_IP_SEND) are given by an enum declaration at the beginning of magnet.h and indicate what type of the event is being recorded. size is the number of bytes transferred during a specific event.3 The data field (a optional field selected at kernel compilation time) is a union of various structures in which information specific to particular protocols can be stored. This field provides a mechanism for MAGNeT to record protocol-state information along with event transitions.


next up previous
Next: Instrumented Events Up: MAGNeT in Kernel Space Previous: MAGNeT in Kernel Space
Jeffrey R. Hay 2001-09-12