[Bug bpf/23858] sorted iteration on bpf arrays can't sort values
me at serhei dot io
sourceware-bugzilla@sourceware.org
Tue Mar 26 19:33:00 GMT 2019
https://sourceware.org/bugzilla/show_bug.cgi?id=23858
--- Comment #2 from Serhei Makarov <me at serhei dot io> ---
More involved example:
global a
global s
probe oneshot {
printf("BEGIN")
a[0]=5; a[3]=3; a[5]=0
s["avocado"]=5; s["blueberry"]=3; s["caramel apple"]=0
foreach (b in a+) printf("%d",a[b])
foreach (b in a-) printf("%d",a[b])
foreach (k in s+) printf("%d",s[k])
foreach (k in s-) printf("%d",s[k])
printf("END\n")
}
BPF and LKM SystemTap sort it in opposite order, but I'm not sure which is
right. See
https://sourceware.org/systemtap/langref/6_Statement_types.html#SECTION00076000000000000000
"If you add a single plus (+) or minus (-) operator after the VAR or the ARRAY
identifier, the iteration order will be sorted by the ascending or descending
index or value."
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Systemtap
mailing list