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 profile.py with latest net-next #1688

Merged
merged 1 commit into from
Apr 18, 2018
Merged

fix profile.py with latest net-next #1688

merged 1 commit into from
Apr 18, 2018

Conversation

yonghong-song
Copy link
Collaborator

The profile.py tries to validate whether the "ip" from the
context register is a kernel ip address or not by comparing
"ip" to the kernel PAGE_OFFSET.

On non-x86_64 architectures, PAGE_OFFSET can be directly used.
On x86_64 architecture, things become more complex.
With 4.17 (latest linus tree), __PAGE_OFFSET_BASE is gone
and replaced with __PAGE_OFFSET_BASE_L5 and __PAGE_OFFSET_BASE_L4
for 5 and 4 level page table respectively.
Running profile.py will have the following error:
/virtual/main.c:41:18: error: use of undeclared identifier '__PAGE_OFFSET_BASE'
if (ip > __PAGE_OFFSET_BASE) {
^
1 error generated.

So, for 4.17, _PAGE_OFFSET_BASE{L4, L5} should be used.
For 4.16 and some old kernels (e.g., 4.11), which I did not
check earlier one, __PAGE_OFFSET_BASE should be used.
For even older kernels like 4.6, PAGE_OFFSET should be used.

Signed-off-by: Yonghong Song [email protected]

The profile.py tries to validate whether the "ip" from the
context register is a kernel ip address or not by comparing
"ip" to the kernel PAGE_OFFSET.

On non-x86_64 architectures, PAGE_OFFSET can be directly used.
On x86_64 architecture, things become more complex.
With 4.17 (latest linus tree), __PAGE_OFFSET_BASE is gone
and replaced with __PAGE_OFFSET_BASE_L5 and __PAGE_OFFSET_BASE_L4
for 5 and 4 level page table respectively.
Running profile.py will have the following error:
    /virtual/main.c:41:18: error: use of undeclared identifier '__PAGE_OFFSET_BASE'
            if (ip > __PAGE_OFFSET_BASE) {
                     ^
    1 error generated.

So, for 4.17, __PAGE_OFFSET_BASE_{L4, L5} should be used.
For 4.16 and some old kernels (e.g., 4.11), which I did not
check earlier one, __PAGE_OFFSET_BASE should be used.
For even older kernels like 4.6, PAGE_OFFSET should be used.

Signed-off-by: Yonghong Song <[email protected]>
@yonghong-song
Copy link
Collaborator Author

[buildbot, ok to test]

@4ast 4ast merged commit 84c8873 into master Apr 18, 2018
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