-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
tools/readahead compatible with kernel version >= 5.10 #3507
tools/readahead compatible with kernel version >= 5.10 #3507
Conversation
src/python/bcc/utils.py
Outdated
if version[0] > major: | ||
return True | ||
if version[0] < major: | ||
return False | ||
if minor and version[1] < minor: | ||
return False | ||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return (version[0], version[1]) > (major, minor)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! adjusted.
tools/readahead.py
Outdated
from time import sleep | ||
import ctypes as ct | ||
import argparse | ||
|
||
# arguments | ||
examples = """examples: | ||
./readahead -d 20 # monitor for 10 seconds and generate stats | ||
./readahead -d 20 # monitor for 10 seconds and generate stats |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20 and 10 don't match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adjusted.
if kernel_version_ge(5, 10): | ||
ra_event = "do_page_cache_ra" | ||
b.attach_kprobe(event=ra_event, fn_name="entry__do_page_cache_readahead") | ||
b.attach_kretprobe(event=ra_event, fn_name="exit__do_page_cache_readahead") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us just do first try attach_kprobe with __do_page_cache_readahead(), if failed, try do_page_cache_ra(). You can look at nfsdist.py as an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, adjutsted.
[buildbot, test this please] |
After kernel version 5.10, __do_page_cache_readahead() was renamed to do_page_cache_ra(), let us try both in readahead.py.
After kernel version 5.10, __do_page_cache_readahead() was renamed to do_page_cache_ra(), let us try both in readahead.py.
After kernel version 5.10, __do_page_cache_readahead() was renamed to do_page_cache_ra(), let us try both in readahead.py.
After kernel version 5.10, __do_page_cache_readahead() was renamed to do_page_cache_ra(), let us try both in readahead.py.
After kernel version 5.10, __do_page_cache_readahead was renamed to /do_page_cache_ra https://patchwork.kernel.org/project/linux-fsdevel/patch/20200903140844.14194-5-willy@infradead.org/