From: "me at serhei dot io" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug bpf/23858] sorted iteration on bpf arrays can't sort values
Date: Tue, 26 Mar 2019 19:33:00 -0000 [thread overview]
Message-ID: <bug-23858-6586-1cjLLYUgCT@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <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.
next prev parent reply other threads:[~2019-03-26 19:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-04 17:18 [Bug bpf/23858] New: " fche at redhat dot com
2019-03-26 17:09 ` [Bug bpf/23858] " me at serhei dot io
2019-03-26 19:33 ` me at serhei dot io [this message]
2019-03-26 19:34 ` me at serhei dot io
2019-06-27 15:48 ` me at serhei dot io
2019-07-12 15:49 ` me at serhei dot io
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-23858-6586-1cjLLYUgCT@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=systemtap@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).