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]

Re: foreach interation over specified index values in multiple index arrays


Mike Mason <mmlnx@us.ibm.com> writes:

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

We could support this syntax (interpreting literals as
select/project).  However, it would not be efficient to implement,
since all keys are hashed together for the array indexing.  It would
be equivalent to

#         foreach ([__idx1, idx2] in arr) {
#                 if (__idx1 != 3) continue
#                 printf("%s\n", arr[3, idx2])
#         }

- FChE


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