From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14633 invoked by alias); 26 Mar 2019 19:33:22 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 12317 invoked by uid 48); 26 Mar 2019 19:33:18 -0000 From: "me at serhei dot io" 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 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: bpf X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: me at serhei dot io X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2019-q1/txt/msg00093.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D23858 --- Comment #2 from Serhei Makarov --- More involved example: global a global s probe oneshot { printf("BEGIN") a[0]=3D5; a[3]=3D3; a[5]=3D0 s["avocado"]=3D5; s["blueberry"]=3D3; s["caramel apple"]=3D0 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#SECTION0007= 6000000000000000 "If you add a single plus (+) or minus (-) operator after the VAR or the AR= RAY identifier, the iteration order will be sorted by the ascending or descendi= ng index or value." --=20 You are receiving this mail because: You are the assignee for the bug.