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]

[Bug bpf/23858] sorted iteration on bpf arrays can't sort values


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.

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