2.9 Variables

D provides two basic types of variables for use in your tracing programs: scalar variables and associative arrays. This section explores the rules for D variables in more detail and describes how variables can be associated with different scopes. A special kind of array variable, called an aggregation, is discussed in Chapter 3, Aggregations.


  • Scalar variables and associative arrays have a global scope and are not multi-processor safe (MP-safe). As the value of such variables can be changed by more than one processor, there is a chance that a variable can become corrupted if more than one probe modifies it.

  • Aggregations are MP-safe even though they have a global scope.