Skip to content
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

scripts: Refactor vtime_dist script #1056

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

hodgesds
Copy link
Contributor

@hodgesds hodgesds commented Dec 6, 2024

Refactor the vtime_dist script to show the distribution in the change of vtime rather than the histogram of the vtime. The histogram of the vtime is not really that useful as it should continuously be increasing. Attach to the scx_bpf_dsq_insert_vtime kprobe event rather than on sched_wakeup. Support filtering by DSQ with a script parameter and include the slice interval average and distribution to the output.

Example scx_rusty filtering DSQ 1:

$ sudo ./vtime_dist.bt 0 1
-----------------------------------
@dsq_vtime[1]: 
(..., 0)             437 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[0]                    1 |                                                    |
[1]                    0 |                                                    |
[2, 4)                 0 |                                                    |
[4, 8)                 0 |                                                    |
[8, 16)                0 |                                                    |
[16, 32)               0 |                                                    |
[32, 64)               0 |                                                    |
[64, 128)              0 |                                                    |
[128, 256)             1 |                                                    |
[256, 512)             0 |                                                    |
[512, 1K)              2 |                                                    |
[1K, 2K)               3 |                                                    |
[2K, 4K)              15 |@                                                   |
[4K, 8K)              22 |@@                                                  |
[8K, 16K)             53 |@@@@@@                                              |
[16K, 32K)            62 |@@@@@@@                                             |
[32K, 64K)            77 |@@@@@@@@@                                           |
[64K, 128K)          102 |@@@@@@@@@@@@                                        |
[128K, 256K)          66 |@@@@@@@                                             |
[256K, 512K)          35 |@@@@                                                |
[512K, 1M)            31 |@@@                                                 |
[1M, 2M)              27 |@@@                                                 |
[2M, 4M)              25 |@@                                                  |
[4M, 8M)              13 |@                                                   |
[8M, 16M)             17 |@@                                                  |
[16M, 32M)            32 |@@@                                                 |
[32M, 64M)            17 |@@                                                  |
[64M, 128M)            9 |@                                                   |
[128M, 256M)           2 |                                                    |
[256M, 512M)           1 |                                                    |
[512M, 1G)             0 |                                                    |
[1G, 2G)               0 |                                                    |
[2G, 4G)               0 |                                                    |
[4G, 8G)               1 |                                                    |

@dsq_vtime_diff[1]: 7467980

@dsq_slice_avg[1]: 20000000

@dsq_slice[1]: 
[16M, 32M)          1052 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|

scx_flash (all dsqs):

$ sudo ./vtime_dist.bt 
-----------------------------------
@dsq_vtime[0]: 
(..., 0)              74 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[0]                    0 |                                                    |
[1]                    0 |                                                    |
[2, 4)                 0 |                                                    |
[4, 8)                 0 |                                                    |
[8, 16)                0 |                                                    |
[16, 32)               0 |                                                    |
[32, 64)               0 |                                                    |
[64, 128)              0 |                                                    |
[128, 256)             0 |                                                    |
[256, 512)             0 |                                                    |
[512, 1K)              0 |                                                    |
[1K, 2K)               0 |                                                    |
[2K, 4K)               0 |                                                    |
[4K, 8K)               0 |                                                    |
[8K, 16K)              0 |                                                    |
[16K, 32K)             0 |                                                    |
[32K, 64K)             0 |                                                    |
[64K, 128K)            0 |                                                    |
[128K, 256K)           1 |                                                    |
[256K, 512K)           1 |                                                    |
[512K, 1M)             1 |                                                    |
[1M, 2M)               7 |@@@@                                                |
[2M, 4M)              13 |@@@@@@@@@                                           |
[4M, 8M)              20 |@@@@@@@@@@@@@@                                      |
[8M, 16M)             11 |@@@@@@@                                             |
[16M, 32M)            20 |@@@@@@@@@@@@@@                                      |
[32M, 64M)            23 |@@@@@@@@@@@@@@@@                                    |
[64M, 128M)            7 |@@@@                                                |
[128M, 256M)           1 |                                                    |
[256M, 512M)          16 |@@@@@@@@@@@                                         |
[512M, 1G)            10 |@@@@@@@                                             |
[1G, 2G)              37 |@@@@@@@@@@@@@@@@@@@@@@@@@@                          |
[2G, 4G)               1 |                                                    |
[4G, 8G)               0 |                                                    |
[8G, 16G)              0 |                                                    |
[16G, 32G)             0 |                                                    |
[32G, 64G)             0 |                                                    |
[64G, 128G)            1 |                                                    |

@dsq_vtime_diff[0]: 831996573

@dsq_slice_avg[0]: 20000000

@dsq_slice[0]: 
[16M, 32M)           244 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|

@hodgesds
Copy link
Contributor Author

hodgesds commented Dec 6, 2024

Going to put slice related data into a separate script.

@hodgesds hodgesds force-pushed the vtime_dist-refactor branch from 34b2a52 to da43baa Compare December 6, 2024 17:36
Refactor the vtime_dist script to show the distribution in the change of
vtime rather than the histogram of the vtime. Update the probe
attachement point to be scx_bpf_dsq_insert_vtime rather than
`sched_wakeup`. Support filtering by dsq with a script parameter.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
@hodgesds hodgesds force-pushed the vtime_dist-refactor branch from da43baa to 62632c7 Compare December 6, 2024 20:20
@hodgesds hodgesds added this pull request to the merge queue Dec 6, 2024
Merged via the queue into sched-ext:main with commit 913b688 Dec 7, 2024
23 checks passed
@hodgesds hodgesds deleted the vtime_dist-refactor branch December 7, 2024 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants