Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(disksnoop): register to blk_mq_complete_request #5118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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_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?

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