Skip to content

Commit

Permalink
Merge pull request iovisor#3827 from htejun/fix-biolatpcts-build
Browse files Browse the repository at this point in the history
biolatpcts: Build fixes on recent kernels
  • Loading branch information
davemarchevsky authored Jan 27, 2022
2 parents b1d8796 + 11614bc commit d89bb79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/tracing/biolatpcts.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

bpf_source = """
#include <linux/blk_types.h>
#include <linux/blk-mq.h>
#include <linux/blkdev.h>
#include <linux/time64.h>
Expand Down Expand Up @@ -45,7 +46,10 @@
"""

bpf = BPF(text=bpf_source)
bpf.attach_kprobe(event='blk_account_io_done', fn_name='kprobe_blk_account_io_done')
if BPF.get_kprobe_functions(b'__blk_account_io_done'):
bpf.attach_kprobe(event="__blk_account_io_done", fn_name="kprobe_blk_account_io_done")
else:
bpf.attach_kprobe(event="blk_account_io_done", fn_name="kprobe_blk_account_io_done")

cur_lat_100ms = bpf['lat_100ms']
cur_lat_1ms = bpf['lat_1ms']
Expand Down
1 change: 1 addition & 0 deletions tools/biolatpcts.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
bpf_source = """
#include <linux/blk_types.h>
#include <linux/blkdev.h>
#include <linux/blk-mq.h>
#include <linux/time64.h>
BPF_PERCPU_ARRAY(rwdf_100ms, u64, 400);
Expand Down

0 comments on commit d89bb79

Please sign in to comment.