-
Notifications
You must be signed in to change notification settings - Fork 96
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
lazy ksymbols: fix address search #283
lazy ksymbols: fix address search #283
Conversation
What about to sort |
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.
LGTM.
In addition to that possibility, I think that, in the future, we can refactor a bit by moving some of the parsing logic into a function. |
ec8d71f
to
97df12c
Compare
Could you explain better in the git log what was the fix you did with this commit? Also, you recommended a PR in tracee to use lazy symbols, if it is broken it is better to update that PR as well (asking for the author to include this fix). Thanks! |
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.
Still need to review, but asked for a better git log.
97df12c
to
3997301
Compare
In commit 3ea9231, a new KernelSymbolsTable implementation was added which uses lazy querying and parsing of a stored string copy of the /proc/kallsyms file. In order to keep efficiency of non cached queries, binary search was used for querying symbols by address, since the file mostly stores the symbols in order of addresses. However, on kernels compiled with CONFIG_KALLSYMS_ALL=y, symbols from other sections may be present in a non ordered place. This wasn't taken in consideration in initial implementations, and so a query by address could have failed despite existing. These symbols usually appear near the end of the file, so a reverse linear search is added after a failed binary search.
3997301
to
c5233bf
Compare
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.
LGTM
ksymbols may sometimes not be sorted at the edges, usually for non system symbols. As such searching by binary search may fail. Add a reverse linear search at the end to catch these symbols.