mirror of
https://github.com/JakeHillion/scx.git
synced 2024-12-04 23:07:11 +00:00
f59b73b97c
Add bpftrace script to print the distribution of vtime across DSQs. Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
31 lines
617 B
Plaintext
Executable File
31 lines
617 B
Plaintext
Executable File
#!/usr/bin/env bpftrace
|
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
|
|
// This software may be used and distributed according to the terms of the
|
|
// GNU General Public License version 2.
|
|
|
|
|
|
rawtracepoint:sched_wakeup,
|
|
rawtracepoint:sched_wakeup_new,
|
|
{
|
|
$task = (struct task_struct *)arg0;
|
|
|
|
if ($1 > 0 && $task->tgid != $1) {
|
|
return;
|
|
}
|
|
|
|
if ($task->scx.dsq->id >= 0) {
|
|
@dsq_vtime[$task->scx.dsq->id] = hist($task->scx.dsq_vtime);
|
|
}
|
|
}
|
|
|
|
|
|
interval:s:1 {
|
|
if ($1 >0) {
|
|
$scx_ops = kaddr("scx_ops");
|
|
$ops = (struct sched_ext_ops*)$scx_ops;
|
|
printf("scheduler: %s\n", $ops->name);
|
|
}
|
|
print(@dsq_vtime);
|
|
}
|