From 10f2abedd8c2569f337c248f428cef60d75d04ea Mon Sep 17 00:00:00 2001 From: ddomingo Date: Tue, 9 Dec 2008 10:49:20 +1000 Subject: revisions as per wcohen --- .../en-US/Array-Operations.xml | 30 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'doc/SystemTap_Beginners_Guide/en-US/Array-Operations.xml') diff --git a/doc/SystemTap_Beginners_Guide/en-US/Array-Operations.xml b/doc/SystemTap_Beginners_Guide/en-US/Array-Operations.xml index 9c5e5a9f..987e2b29 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Array-Operations.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Array-Operations.xml @@ -173,11 +173,27 @@ foo[tid()] = gettimeofday_s() Using Array Values in Simple Computations -foo[tid()] = gettimeofday_s() delta = gettimeofday_s() - foo[tid()] + + This example assumes that the array foo was built using the construct in + (from ). This + sets a timestamp that will serve as a reference point, to be used in + computing for delta. + + + + The construct in computes a value for the variable + delta by subtracting the associated value of the key tid() + from the current gettimeofday_s(). The construct does this by + reading the value of tid() from the array. This particular + construct is useful for determining the time between two events, such as the start and completion + of a read operation. + + reading values from arrays @@ -214,8 +231,15 @@ delta = gettimeofday_s() - foo[tid()] reading values from arrays array operations - -In this situation, if the index_expression cannot find the unique key, it returns a value of 0 (for numerical operations, such as ) or a null/empty string value (for string operations) by default. + + Note + + If the index_expression cannot + find the unique key, it returns a value of 0 (for numerical operations, such as + ) or a null/empty string value (for string operations) by + default. + +
Incrementing Associated Values -- cgit