diff --git a/src/pmdas/bpftrace/examples/biolatency.bt b/src/pmdas/bpftrace/examples/biolatency.bt index 2a58f0de443..59bf2a85ffe 100644 --- a/src/pmdas/bpftrace/examples/biolatency.bt +++ b/src/pmdas/bpftrace/examples/biolatency.bt @@ -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); } diff --git a/src/pmdas/bpftrace/examples/runqlat.bt b/src/pmdas/bpftrace/examples/runqlat.bt index c01832441f9..0dbf355523d 100644 --- a/src/pmdas/bpftrace/examples/runqlat.bt +++ b/src/pmdas/bpftrace/examples/runqlat.bt @@ -12,8 +12,6 @@ */ // include: @usecs -#include - tracepoint:sched:sched_wakeup, tracepoint:sched:sched_wakeup_new { @@ -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; } @@ -32,3 +30,8 @@ tracepoint:sched:sched_switch } delete(@qtime[args->next_pid]); } + +END +{ + clear(@qtime); +}