Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/pmdas/bpftrace/examples/biolatency.bt
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@
*/
// include: @usecs

kprobe:blk_account_io_start,
kprobe:__blk_account_io_start
tracepoint:block:block_bio_queue
{
@start[arg0] = nsecs;
@start[args.sector] = nsecs;
}

kprobe:blk_account_io_done,
kprobe:__blk_account_io_done
/@start[arg0]/
tracepoint:block:block_rq_complete,
tracepoint:block:block_bio_complete
/@start[args.sector]/
{
@usecs = hist((nsecs - @start[arg0]) / 1000);
delete(@start[arg0]);
@usecs = hist((nsecs - @start[args.sector]) / 1000);
delete(@start, args.sector);
}

END
{
clear(@start);
}
9 changes: 6 additions & 3 deletions src/pmdas/bpftrace/examples/runqlat.bt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
*/
// include: @usecs

#include <linux/sched.h>

tracepoint:sched:sched_wakeup,
tracepoint:sched:sched_wakeup_new
{
Expand All @@ -22,7 +20,7 @@ tracepoint:sched:sched_wakeup_new

tracepoint:sched:sched_switch
{
if (args->prev_state == TASK_RUNNING) {
if (args->prev_state == 0) { /* TASK_RUNNING */
@qtime[args->prev_pid] = nsecs;
}

Expand All @@ -32,3 +30,8 @@ tracepoint:sched:sched_switch
}
delete(@qtime[args->next_pid]);
}

END
{
clear(@qtime);
}
Loading