From b3e8f644958f5033beebeb91edf11d5edf21c8c1 Mon Sep 17 00:00:00 2001 From: ddomingo Date: Mon, 17 Nov 2008 13:04:02 +1000 Subject: revisions as per dsmith --- doc/SystemTap_Beginners_Guide/en-US/Array-Operations.xml | 14 +++++++++++--- 1 file changed, 11 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 32fdf021..f63d1d70 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Array-Operations.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Array-Operations.xml @@ -30,7 +30,12 @@ foo[execname()] = gettimeofday_s()
Reading Values From Arrays - You can also use the = operator to read values from an array. This is accomplished by simply including the array_name[index_expression] as an element in a mathematical expression. For example: + You can also read values from an array the same way you would read the value of a variable. + To do so, include the + array_name[index_expression] + statement as an element in a mathematical expression. For example: + Using Array Values in Simple Computations @@ -187,7 +192,9 @@ probe timer.s(2) foreach (count in reads+) printf("%s : %d \n", count, reads[count]) if(reads["stapio"] >= 20) - {exit()} + { + exit() + } } @@ -221,7 +228,8 @@ probe timer.s(2) foreach (count in reads+) printf("%s : %d \n", count, reads[count]) if(["stapio"] in reads) - {printf("stapio read detected, exiting\n") + { + printf("stapio read detected, exiting\n") exit() } } -- cgit