Bug 23478 - bpf: multi-key associative arrays
Summary: bpf: multi-key associative arrays
Status: ASSIGNED
Alias: None
Product: systemtap
Classification: Unclassified
Component: bpf (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-01 19:03 UTC by Serhei Makarov
Modified: 2021-08-30 15:21 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2019-08-20 00:00:00
Project(s) to access:
ssh public key:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Serhei Makarov 2018-08-01 19:03:57 UTC
From the 'language features' brainstorm:

# More complex structures: multi-key associative arrays

It's theoretically possible to have a large struct as the key to a hash map. Thus, a key could literally be a structure with 2 (or more) embedded strings. It seemed to work fine when I used a 128-byte map key size, so two 64-byte string keys should be doable at the very least.
Comment 1 William Cohen 2019-05-28 13:51:38 UTC
This would also be useful for the @entry support. A number of the systemtap examples fail like in the following way:

TEST PWD=/home/wcohen/systemtap_write/systemtap/testsuite/systemtap.examples/memory
meta taglines 'test_check: stap -p4 overcommit.stp' tag 'test_check' value 'stap -p4 overcommit.stp'
attempting command stap --bpf -p4 overcommit.stp
OUT semantic error: unhandled multi-dimensional array: identifier '$pages' at overcommit.stp:6:40
        source:              execname(), pid(), @entry($pages))
                                                       ^

Pass 4: compilation failed.  [man error::pass4]
child process exited abnormally
RC 1
FAIL: systemtap.examples/memory/overcommit build
Comment 2 William Cohen 2019-08-20 20:49:30 UTC
There is a initial patch on https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=shortlog;h=refs/heads/wcohen/pr23478 that allows use of multi-dimensional arrays with the exception of foreach statements for multi-dimensional arrays.
Comment 3 Serhei Makarov 2021-08-30 15:21:17 UTC
Implemented support for foreach iterations in multi-key associative arrays.