Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tools/funcslower.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,14 @@
#else
page_offset = __PAGE_OFFSET_BASE_L4;
#endif
#elif defined(__identity_base)
// s390 6.10 and later PAGE_OFFSET is not a constant and need
// to be read from the kernel adress space
bpf_probe_read_kernel(&page_offset, sizeof(PAGE_OFFSET), &PAGE_OFFSET);
#else
// earlier x86_64 kernels, e.g., 4.6, comes here
// arm64, s390, powerpc, x86_32
// s390 before 6.10
// arm64, powerpc, x86_32
page_offset = PAGE_OFFSET;
#endif

Expand Down
7 changes: 6 additions & 1 deletion tools/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,14 @@ def stack_id_err(stack_id):
#else
page_offset = __PAGE_OFFSET_BASE_L4;
#endif
#elif defined(__identity_base)
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about #elif defined(CONFIG_S390) && defined(__identity_base) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently __identity_base is only defined on s390 so they're equivalent.
I remember hesitating between the two and my reason to chose the former is that if __identity_base is ever defined on an other arch, it would most likely be for the same purpose.
On the other hand, PAGE_OFFSET seems to be very arch specific and I don't how likely my scenario is likely to happen.

// s390 6.10 and later PAGE_OFFSET is not a constant and need
// to be read from the kernel adress space
Copy link
Collaborator

Choose a reason for hiding this comment

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

address, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix.

bpf_probe_read_kernel(&page_offset, sizeof(PAGE_OFFSET), &PAGE_OFFSET);
#else
// earlier x86_64 kernels, e.g., 4.6, comes here
// arm64, s390, powerpc, x86_32
// s390 before 6.10
// arm64, powerpc, x86_32
page_offset = PAGE_OFFSET;
#endif
Expand Down
Loading