Fix symbolication on 32-bit userspace / 64-bit kernel #2869
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Symbolication is broken on platforms running a 64-bit kernel and a 32-bit userspace. For example, this simple test case can reproduce the issue: $ bpftrace -e 'profile:hz:99 { @[kstack] = count(); }' .
This is happening because bpftrace requests uint64_t addresses to the kernel here but then performs an implicit conversion to uintptr_t here when resolving ksyms, usyms and uids. Fix the issue by changing the signature of these functions so they receive a uint64_t address instead.
Ideally we should uncomment add_compile_options("-Wconversion") in bpftrace/CMakeLists.txt to avoid running into simple issues like this in the future. This patch is one small step towards fixing the current conversion warnings we have.
Issue 2854