diff --git a/examples/tracing/biolatpcts.py b/examples/tracing/biolatpcts.py index c9bb834e59d8..68a59516a2a7 100755 --- a/examples/tracing/biolatpcts.py +++ b/examples/tracing/biolatpcts.py @@ -11,6 +11,7 @@ bpf_source = """ #include +#include #include #include @@ -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'] diff --git a/tools/biolatpcts.py b/tools/biolatpcts.py index a2f595924ac1..0f334419197d 100755 --- a/tools/biolatpcts.py +++ b/tools/biolatpcts.py @@ -56,6 +56,7 @@ bpf_source = """ #include #include +#include #include BPF_PERCPU_ARRAY(rwdf_100ms, u64, 400);