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

biosnoop.bt: use block tracepoints #2875

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

Conversation

makelinux
Copy link
Contributor

@makelinux makelinux commented Dec 10, 2023

since functions blk_account_io_start and blk_account_io_done became static and can't be used as kprobes.

Using major and minor because unfortunately disk_name is not exported to tracepoints.

Checklist
  • User-visible and non-trivial changes updated in CHANGELOG.md

Copy link
Member

@danobi danobi left a comment

Choose a reason for hiding this comment

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

seems reasonable to me

@danobi
Copy link
Member

danobi commented Jan 26, 2024

Needs a rebase I think. But otherwise good to merge. Sorry - this fell thru the cracks

@danobi
Copy link
Member

danobi commented Jan 28, 2024

Ah ok, so I was getting confused about dev_t cuz apparently kernel dev_t is different than the one userspace sees: https://lwn.net/Articles/50703/ . So that all looks good.

Just one question though: when I run biosnoop during sudo pacman -Syu, I see a lot of:

10497         259:1  pacman           270981       0
10499         259:1  pacman           270981       0
10499         259:1  pacman           270981       0
10500         259:1  pacman           270981       0
10502         259:1  pacman           270981       0
10502         259:1  pacman           270981       0
10503         259:1  pacman           270981       0

But my lsblk shows:

nvme0n1     259:0    0 953.9G  0 disk
├─nvme0n1p1 259:1    0     1G  0 part  /boot
├─nvme0n1p2 259:2    0    32G  0 part  [SWAP]
└─nvme0n1p3 259:3    0 920.9G  0 part  /

Doesn't seem correct that pacman writes/reads from /boot (259:1). It should be from / (259:3), right? Any ideas?

because since v5.17-rc1~116^2~83
functions blk_account_io_start and blk_account_io_done
became static and can't be used as kprobes.

Using major and minor because unfortunately disk_name
is not exported to tracepoints.

Tested on linux-6.5 and linux-4.18
@makelinux
Copy link
Contributor Author

makelinux commented Jan 28, 2024 via email

@danobi
Copy link
Member

danobi commented Jan 28, 2024

Ha, && vs & -- didn't spot that.

With fix, it looks like all activity is going to minor number 0. Is that expected? I'm not too familiar with block layer semantics for this case

@makelinux
Copy link
Contributor Author

With fix, it looks like all activity is going to minor number 0. Is that expected? I'm not too familiar with block layer semantics for this case

The same major or another?

@danobi
Copy link
Member

danobi commented Jan 29, 2024

The same major as before (correct one I think)

@makelinux
Copy link
Contributor Author

I don't know.

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.

None yet

2 participants