org.opensolaris.os.dtrace
Class Flow

java.lang.Object
  extended by org.opensolaris.os.dtrace.Flow
All Implemented Interfaces:
java.io.Serializable

public final class Flow
extends java.lang.Object
implements java.io.Serializable

Description of control flow across function boundaries including direction (entry or return) and depth in the call stack. This information is added to ProbeData instances only when the flowindent option is used:


     Consumer consumer = new LocalConsumer();
     consumer.open();
     consumer.setOption(Option.flowindent);
     ...
 
See the Examples section of the fbt Provider chapter of the Solaris Dynamic Tracing Guide.

Immutable. Supports persistence using XMLEncoder.

See Also:
Consumer.setOption(String option), Option.flowindent, Serialized Form

Nested Class Summary
static class Flow.Kind
          Indicates direction of flow across a boundary, such as entering or returing from a function.
 
Constructor Summary
Flow(java.lang.String flowKindName, int flowDepth)
          Creates a Flow instance with the given flow kind and depth.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the specified object with this Flow instance for equality.
 int getDepth()
          Gets the current depth in the call stack.
 Flow.Kind getKind()
          Gets the direction of the flow of control (entry or return) across a function boundary.
 int hashCode()
          Overridden to ensure that equal instances have equal hash codes.
 java.lang.String toString()
          Gets a string representation of this Flow instance useful for logging and not intended for display.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Flow

public Flow(java.lang.String flowKindName,
            int flowDepth)
Creates a Flow instance with the given flow kind and depth. Supports XML persistence.

Parameters:
flowKindName - name of enumeration value indicating the direction of flow
flowDepth - current depth in the call stack
Throws:
java.lang.IllegalArgumentException - if there is no Flow.Kind value with the given name or if the given flowDepth is negative
java.lang.NullPointerException - if the given Flow.Kind name is null
Method Detail

getKind

public Flow.Kind getKind()
Gets the direction of the flow of control (entry or return) across a function boundary.

Returns:
non-null flow kind indicating direction of flow (entry or return) across a function boundary

getDepth

public int getDepth()
Gets the current depth in the call stack.

Returns:
A non-negative sum of the function entries minus the function returns up until the moment described by this control flow instance. For example, if the traced flow of control entered two functions but only returned from one, the depth is one (2 entries minus 1 return).

equals

public boolean equals(java.lang.Object o)
Compares the specified object with this Flow instance for equality. Defines equality as having the same flow kind and depth.

Overrides:
equals in class java.lang.Object
Returns:
true if and only if the specified object is of type Flow and both instances have equal flow kind and depth.

hashCode

public int hashCode()
Overridden to ensure that equal instances have equal hash codes.

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Gets a string representation of this Flow instance useful for logging and not intended for display. The exact details of the representation are unspecified and subject to change, but the following format may be regarded as typical:

 class-name[property1 = value1, property2 = value2]
 

Overrides:
toString in class java.lang.Object