Skip to content

Conversation

@saiintbrisson
Copy link

As mentioned in #4691, disksnoop, like biosnoop, rely on functions that can be inlined, like blk_account_io_done. This change adds a new function blk_mq_complete_request as a fallback in case that the others were inlined. I haven't changed this to support tracepoint because the tutorial guide would have to be considerably rearranged to make it follow a logical order, as the first mention of tracepoint is on lesson 12.

b.attach_kprobe(event="blk_start_request", fn_name="trace_start")
b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_start")
if BPF.get_kprobe_functions(b'blk_start_request'):
b.attach_kprobe(event="blk_start_request", fn_name="trace_start")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the above change?

elif BPF.get_kprobe_functions(b'blk_account_io_done'):
b.attach_kprobe(event="blk_account_io_done", fn_name="trace_completion")
elif BPF.get_kprobe_functions(b'blk_mq_complete_request'):
b.attach_kprobe(event="blk_mq_complete_request", fn_name="trace_completion")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let us just use tracepoint block:block_rq_complete here. It is more stable.

@yonghong-song
Copy link
Collaborator

for

I haven't changed this to support tracepoint because the tutorial guide would have to be considerably rearranged to make it follow a logical order, as the first mention of tracepoint is on lesson 12

Let us just use tracepoint. It should be fine. It would be good that example can represent reasonable recent kernel internals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants