This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug bpf/23858] sorted iteration on bpf arrays can't sort values
- From: "me at serhei dot io" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Tue, 26 Mar 2019 19:33:18 +0000
- Subject: [Bug bpf/23858] sorted iteration on bpf arrays can't sort values
- Auto-submitted: auto-generated
- References: <bug-23858-6586@http.sourceware.org/bugzilla/>
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.