This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

foreach interation over specified index values in multiple index arrays


I have an array with two indexes. I'd like to use foreach to iterate over part of the array by specifying the first index value and iterating over the second index (see example below). Is there a way to do this? Nothing I've tried works.

Thanks,
Mike

global arr

probe begin
{
       arr[0,0] = "00"
       arr[0,1] = "01"
       arr[0,2] = "02"

       arr[1,0] = "10"
       arr[1,1] = "11"
       arr[1,2] = "12"

       arr[3,0] = "30"
       arr[3,1] = "31"
       arr[3,2] = "32"

	// stap doesn't like the 3 in foreach
       foreach ([3, idx2] in arr) {
               printf("%s\n", arr[3, idx2])
       }

       exit()
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]