forked from iovisor/bcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add BPF_MAP_TYPE_HASH_OF_MAPS and BPF_MAP_TYPE_HASH_OF_MAPS supports in bcc. Two new constructs below are introduced to bpf program: BPF_HASH_OF_MAPS(map_name, "inner_map_name", max_entries) BPF_ARRAY_OF_MAPS(map_name, "inner_map_name", max_entries) In the above, "inner_map_name" is for metadata purpose and there must be a map defined in bpf program with map name "inner_map_name". Both python and C++ APIs are added. For python, a new Table API get_fd() is introduced to get the fd of a map so that the fd can be used by a map-in-map do update. The get_fd() is already exposed as API function in C++. For C++, without get_fd(), we will need to templatize basic functions like update_value etc, which I feed too heavy weight. Because of C++ using get_fd() mechanism, so I exposed similar API on python side for parity reason. For map-in-map, the inner map lookup/update/delete won't have explicit map names. Considering map-in-map is not used very frequently, I feel looking primitive bpf_map_{lookup,update,delete}_elem() probably okay, so I did not create any new bcc specific constructs for this purpose. Added both C++ and python test cases to show how to use the above two new map type in bcc. Signed-off-by: Yonghong Song <[email protected]>
- Loading branch information
1 parent
0272a3d
commit 149c1c8
Showing
15 changed files
with
574 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.