This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: foreach interation over specified index values in multiple index arrays
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Mike Mason <mmlnx at us dot ibm dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: 07 Mar 2007 11:46:59 -0500
- Subject: Re: foreach interation over specified index values in multiple index arrays
- References: <45EEEB02.7000208@us.ibm.com>
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