-
Notifications
You must be signed in to change notification settings - Fork 4k
Delete the element from the starts map after it has been used.
#5416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I think it has been an omission, as opposed to an optimization, in the
original change that introduced this. The python version of the
`funclatency` has the delete after the lookup.
Before the change:
./funclatency nvme_setup_cmd
Tracing nvme_setup_cmd. Hit Ctrl-C to exit
^C
nsec : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 243 |****************************************|
1024 -> 2047 : 43 |******* |
2048 -> 4095 : 59 |********* |
4096 -> 8191 : 26 |**** |
After the change:
./funclatency nvme_setup_cmd
Tracing nvme_setup_cmd. Hit Ctrl-C to exit
^C
nsec : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 4 | |
512 -> 1023 : 624 |****************************************|
1024 -> 2047 : 39 |** |
2048 -> 4095 : 98 |****** |
4096 -> 8191 : 71 |**** |
8192 -> 16383 : 1 | |
libbpf-tools/funclatency.bpf.c
Outdated
| start = bpf_map_lookup_elem(&starts, &pid); | ||
| if (!start) | ||
| return; | ||
| bpf_map_delete_elem(&starts, &pid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cleanup should be done at the end of this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done? PTAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please.
I think it has been an omission, as opposed to an optimization, in the original change that introduced this. The python version of the
funclatencyhas the delete after the lookup.Before the change:
./funclatency nvme_setup_cmd
Tracing nvme_setup_cmd. Hit Ctrl-C to exit
^C
nsec : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 0 | |
512 -> 1023 : 243 |********************|
1024 -> 2047 : 43 | |
2048 -> 4095 : 59 | |
4096 -> 8191 : 26 | |
After the change:
./funclatency nvme_setup_cmd
Tracing nvme_setup_cmd. Hit Ctrl-C to exit
^C
nsec : count distribution
0 -> 1 : 0 | |
2 -> 3 : 0 | |
4 -> 7 : 0 | |
8 -> 15 : 0 | |
16 -> 31 : 0 | |
32 -> 63 : 0 | |
64 -> 127 : 0 | |
128 -> 255 : 0 | |
256 -> 511 : 4 | |
512 -> 1023 : 624 |******************************|
1024 -> 2047 : 39 |** |
2048 -> 4095 : 98 | |
4096 -> 8191 : 71 | |
8192 -> 16383 : 1 | |