Commit Graph

10 Commits

Author SHA1 Message Date
Ming Yang
1425ab67ed Add script for generating per-arch vmlinux.h files
This script iterates over a list archs and generates vmlinux.h for each.
Generated files are put under the corresponding arch directory

Signed-off-by: Ming Yang <minos.future@gmail.com>
2024-10-22 23:27:15 -07:00
Changwoo Min
8d63024be7 scx_lavd: add missing reset_lock_futex_boost()
reset_lock_futex_boost() should be called every context switch of a
task. Otherwise, in the worst case, a task and that CPU could block
the preemption. To avoid such a situation, add missing
reset_lock_futex_boost() calls.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
2024-10-19 15:39:18 +09:00
Andrea Righi
8b7f9cde0f scripts: Convert sched ftrace helper scripts to python
Merge the sched_switch ftrace helper scripts into a single python script
that prints the result to stdout.

In this way it's possible to generate a perfetto-compatible trace
running:

 $ sudo ./scripts/sched_ftrace.py > sched.ftrace

Signed-off-by: Andrea Righi <andrea.righi@linux.dev>
2024-10-14 08:44:14 +02:00
Daniel Hodges
cc3fede8e0
scripts: Add ftrace helper scripts
Add a set of ftrace helper scripts for making perfetto compatible ftrace
scheduler profiles.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-13 09:00:07 -04:00
Daniel Hodges
f59b73b97c
scripts: Add vtime distribution script
Add bpftrace script to print the distribution of vtime across DSQs.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-12 08:40:16 -04:00
likewhatevs
bf68679d35
Setup "debugging" and misc cleanup (#695)
* Fix a couple of misc errors in build scripts.
* Tweak scripts/kconfigs to make bpftrace work.
* Update how CI caching works to make builds faster (6 minute turnaround
  time)
* Update CI config to generate per-scheduler debug archives w/ guest
  dmesg/scheduler stdout, guest stdout, bpftrace script output,
  veristat output.

* Update build scripts to accept the following:
** VNG RW -- write to host filesystem (better caching, logging).
* For stress tests in particular (via ini config):
** QEMU Opts -- to facilitate reproducing bugs (i.e. high core count).
** bpftrace scripts -- specify bpftrace scripts to run during stress
tests.
2024-09-26 11:11:10 -04:00
likewhatevs
2282a0af37
enable bpftrace when using stress tests (#688)
* enable bpftrace when using stress tests

update meson/stress test runner to enable
running bpftrace scripts while running
stress tests.

* disable layered stats output on ci
2024-09-25 17:20:36 -04:00
Daniel Hodges
b6054fb5f2 scripts: Add dsq latency script
This change adds a bpftrace script to monitor runq latency as well as
dsq latency.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-08-02 12:19:41 -07:00
Jose Fernandez
7b4689cbde
scripts: whitespace cleanup for process_runqlat.bt
Use tabs instead of spaces for indentation in process_runqlat.bt. I also
updated comments and fixed a typo.

Signed-off-by: Jose Fernandez <josef@netflix.com>
2024-05-15 14:59:13 -06:00
Jose Fernandez
1beb4ed205
scripts: Add script to measure runqlat for a process
Add a `scripts` folder to hold scripts that are useful for the project,
and add a bpftrace program to measure the runqueue latency for a process.

bpftrace's built-in runqlat.bt program instruments runqueue latency for
all processes and does not provide a way to filter by PID. For sched_ext
performance work, we are interested in the runqueue latency of a
specific process we are trying to optimize, such as a video game.
Therefore, we need to create a custom bpftrace program to achieve this.

`process_runqlat.bt` instruments runqueue latency for a PID and its
threads. This script measures the runqueue latency for a specified PID
and includes all threads spawned by that process.

USAGE: sudo ./scripts/process_runqlat.bt <PID>

The program output will include:
- Stats by thread (count, avg latency, total latency)
- A histogram of all latency measurements
- Aggregated total stats (count, avg latency, total latency)

Example output when targeting Terraria's main process:

$ sudo ./scripts/process_runqlat.bt 652644

Attaching 5 probes...
Instrumenting runqueue latency for PID 652644. Hit Ctrl-C to end.

@tasks[AsyncActionDisp, 652676]: count 24, average 2, total 67
@tasks[Finalizer, 652646]: count 24, average 6, total 151
@tasks[Main Thread, 652668]: count 1432, average 8, total 12561
@tasks[Terraria.b:gl0, 652672]: count 1421, average 9, total 13120
@tasks[Main Thread, 652667]: count 1037, average 9, total 10091
@tasks[FACT Thread, 652679]: count 1033, average 10, total 11005
@tasks[Terraria:gdrv0, 652671]: count 3511, average 10, total 37047
@tasks[SDLAudioP3, 652678]: count 982, average 10, total 10210
@tasks[Main Thread, 652666]: count 104, average 10, total 1088
@tasks[SDLAudioP2, 652675]: count 982, average 10, total 10461
@tasks[Main Thread, 652644]: count 5840, average 11, total 69177
@tasks[Main Thread, 694917]: count 44, average 14, total 659
@tasks[Terraria.b:cs0, 652650]: count 3288, average 14, total 47300
@tasks[Thread Pool Wor, 695239]: count 1001, average 35, total 35873
@tasks[Thread Pool Wor, 696059]: count 986, average 35, total 34848
@tasks[Thread Pool Wor, 695458]: count 985, average 36, total 35836
@tasks[Thread Pool Wor, 696058]: count 982, average 37, total 36518

@usec_hist:
[0]                   16 |                                                    |
[1]                  360 |@                                                   |
[2, 4)              4650 |@@@@@@@@@@@@@@                                      |
[4, 8)             14517 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@       |
[8, 16)            16593 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[16, 32)            5056 |@@@@@@@@@@@@@@@                                     |
[32, 64)            6795 |@@@@@@@@@@@@@@@@@@@@@                               |
[64, 128)           7106 |@@@@@@@@@@@@@@@@@@@@@@                              |
[128, 256)          1926 |@@@@@@                                              |
[256, 512)           130 |                                                    |
[512, 1K)              2 |                                                    |

@usec_total_stats: count 57152, average 29, total 1699656

Signed-off-by: Jose Fernandez <josef@netflix.com>
2024-05-15 09:18:29 -06:00