libbpf-tools/map_helpers: Fix duplicate map read operations#4998
Merged
yonghong-song merged 1 commit intoiovisor:masterfrom May 19, 2024
Merged
libbpf-tools/map_helpers: Fix duplicate map read operations#4998yonghong-song merged 1 commit intoiovisor:masterfrom
yonghong-song merged 1 commit intoiovisor:masterfrom
Conversation
Even when the batch read is successful, a non-batch read is performed.
Fixed so that non-batch reads are not performed once batch reads are done.
This is the result of testing tcpconnect by adding some logs to map_helpers.
Before:
./tcpconnect -c
dump_hash_batch, *count: 3
k: 16777343, v: 1
k: 50331775, v: 0
k: 385875968, v: 1
dump_hash_iter, *count: 3
k: 16777343, v: 1
k: 50331775, v: 0
k: 385875968, v: 1
LADDR RADDR RPORT CONNECT
127.0.0.1 127.0.0.3 23 1
127.0.0.1 127.0.0.1 23 1
127.0.0.1 127.0.0.2 23 1
After:
./tcpconnect -c
dump_hash_batch *count: 2
k: 16777343, v: 1
k: 16777343, v: 0
LADDR RADDR RPORT CONNECT
127.0.0.1 127.0.0.1 23 1
127.0.0.1 127.0.0.2 23 1
dagomez137
pushed a commit
to dagomez137/bcc
that referenced
this pull request
Nov 28, 2024
…4998) Even when the batch read is successful, a non-batch read is performed. Fixed so that non-batch reads are not performed once batch reads are done. This is the result of testing tcpconnect by adding some logs to map_helpers. Before: ./tcpconnect -c dump_hash_batch, *count: 3 k: 16777343, v: 1 k: 50331775, v: 0 k: 385875968, v: 1 dump_hash_iter, *count: 3 k: 16777343, v: 1 k: 50331775, v: 0 k: 385875968, v: 1 LADDR RADDR RPORT CONNECT 127.0.0.1 127.0.0.3 23 1 127.0.0.1 127.0.0.1 23 1 127.0.0.1 127.0.0.2 23 1 After: ./tcpconnect -c dump_hash_batch *count: 2 k: 16777343, v: 1 k: 16777343, v: 0 LADDR RADDR RPORT CONNECT 127.0.0.1 127.0.0.1 23 1 127.0.0.1 127.0.0.2 23 1
dagomez137
pushed a commit
to dagomez137/bcc
that referenced
this pull request
Mar 18, 2025
…4998) Even when the batch read is successful, a non-batch read is performed. Fixed so that non-batch reads are not performed once batch reads are done. This is the result of testing tcpconnect by adding some logs to map_helpers. Before: ./tcpconnect -c dump_hash_batch, *count: 3 k: 16777343, v: 1 k: 50331775, v: 0 k: 385875968, v: 1 dump_hash_iter, *count: 3 k: 16777343, v: 1 k: 50331775, v: 0 k: 385875968, v: 1 LADDR RADDR RPORT CONNECT 127.0.0.1 127.0.0.3 23 1 127.0.0.1 127.0.0.1 23 1 127.0.0.1 127.0.0.2 23 1 After: ./tcpconnect -c dump_hash_batch *count: 2 k: 16777343, v: 1 k: 16777343, v: 0 LADDR RADDR RPORT CONNECT 127.0.0.1 127.0.0.1 23 1 127.0.0.1 127.0.0.2 23 1
dagomez137
pushed a commit
to dagomez137/bcc
that referenced
this pull request
Oct 9, 2025
…4998) Even when the batch read is successful, a non-batch read is performed. Fixed so that non-batch reads are not performed once batch reads are done. This is the result of testing tcpconnect by adding some logs to map_helpers. Before: ./tcpconnect -c dump_hash_batch, *count: 3 k: 16777343, v: 1 k: 50331775, v: 0 k: 385875968, v: 1 dump_hash_iter, *count: 3 k: 16777343, v: 1 k: 50331775, v: 0 k: 385875968, v: 1 LADDR RADDR RPORT CONNECT 127.0.0.1 127.0.0.3 23 1 127.0.0.1 127.0.0.1 23 1 127.0.0.1 127.0.0.2 23 1 After: ./tcpconnect -c dump_hash_batch *count: 2 k: 16777343, v: 1 k: 16777343, v: 0 LADDR RADDR RPORT CONNECT 127.0.0.1 127.0.0.1 23 1 127.0.0.1 127.0.0.2 23 1
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Even when the batch read is successful, a non-batch read is performed. Fixed so that non-batch reads are not performed once batch reads are done.
This is the result of testing tcpconnect by adding some logs to map_helpers.
Before:
After: