-
Notifications
You must be signed in to change notification settings - Fork 14.2k
[Memprof] Changes HISTOGRAM_GRANULARITY
from 8U to 8ULL.
#100949
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
[Memprof] Changes HISTOGRAM_GRANULARITY
from 8U to 8ULL.
#100949
Conversation
This changes a bug in memprofiling with histogram where the shadow mask would be `0xFFFFFFF8` instead of `0xFFFFFFFFFFFFFFF8`, essentially discarding the upper 32 bits of the address. This can cause different addresses to be mapped to the same shadow address.
HISTOGRAM_GRANULARITY
from 8U to 8ULL.HISTOGRAM_GRANULARITY
from 8U to 8ULL.
@llvm/pr-subscribers-pgo Author: Matthew Weingarten (mattweingarten) ChangesThis changes a bug in memprofiling with histogram where the shadow mask would be Full diff: https://github.com/llvm/llvm-project/pull/100949.diff 1 Files Affected:
diff --git a/compiler-rt/lib/memprof/memprof_mapping.h b/compiler-rt/lib/memprof/memprof_mapping.h
index fef8acfcfc921..6da385ab3d6e2 100644
--- a/compiler-rt/lib/memprof/memprof_mapping.h
+++ b/compiler-rt/lib/memprof/memprof_mapping.h
@@ -55,7 +55,7 @@ extern uptr kHighMemEnd; // Initialized in __memprof_init.
// computed by summing up all individual 1 byte counters. This can incur an
// accuracy penalty.
-#define HISTOGRAM_GRANULARITY 8U
+#define HISTOGRAM_GRANULARITY 8ULL
#define HISTOGRAM_MAX_COUNTER 255U
|
Did this affect the callback handling in a way that was user visible and affected the profile results? If so, perhaps a test can be added for that case, since the IR case will be effectively tested once PR100834 goes in. |
No there is no effect that is visible. Only the shadow adress translation is affected, so the counters have a different address inside the shadow space. |
I don't think there is a way to write a test for this |
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
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/2844 Here is the relevant piece of the build log for the reference:
|
This changes a bug in memprofiling with histogram where the shadow mask would be
0xFFFFFFF8
instead of0xFFFFFFFFFFFFFFF8
, essentially discarding the upper 32 bits of the address. This can cause different addresses to be mapped to the same shadow address.