1e8d8bef9SDimitry Andric //===-- memprof_rtl.cpp --------------------------------------------------===//
2e8d8bef9SDimitry Andric //
3e8d8bef9SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4e8d8bef9SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5e8d8bef9SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6e8d8bef9SDimitry Andric //
7e8d8bef9SDimitry Andric //===----------------------------------------------------------------------===//
8e8d8bef9SDimitry Andric //
9e8d8bef9SDimitry Andric // This file is a part of MemProfiler, a memory profiler.
10e8d8bef9SDimitry Andric //
11e8d8bef9SDimitry Andric // Main file of the MemProf run-time library.
12e8d8bef9SDimitry Andric //===----------------------------------------------------------------------===//
13e8d8bef9SDimitry Andric
14e8d8bef9SDimitry Andric #include "memprof_allocator.h"
15e8d8bef9SDimitry Andric #include "memprof_interceptors.h"
16e8d8bef9SDimitry Andric #include "memprof_interface_internal.h"
17e8d8bef9SDimitry Andric #include "memprof_internal.h"
18e8d8bef9SDimitry Andric #include "memprof_mapping.h"
19e8d8bef9SDimitry Andric #include "memprof_stack.h"
20e8d8bef9SDimitry Andric #include "memprof_stats.h"
21e8d8bef9SDimitry Andric #include "memprof_thread.h"
22e8d8bef9SDimitry Andric #include "sanitizer_common/sanitizer_atomic.h"
23e8d8bef9SDimitry Andric #include "sanitizer_common/sanitizer_flags.h"
2481ad6265SDimitry Andric #include "sanitizer_common/sanitizer_interface_internal.h"
25e8d8bef9SDimitry Andric #include "sanitizer_common/sanitizer_libc.h"
26e8d8bef9SDimitry Andric #include "sanitizer_common/sanitizer_symbolizer.h"
27e8d8bef9SDimitry Andric
28e8d8bef9SDimitry Andric #include <time.h>
29e8d8bef9SDimitry Andric
30e8d8bef9SDimitry Andric uptr __memprof_shadow_memory_dynamic_address; // Global interface symbol.
31e8d8bef9SDimitry Andric
32e8d8bef9SDimitry Andric // Allow the user to specify a profile output file via the binary.
33e8d8bef9SDimitry Andric SANITIZER_WEAK_ATTRIBUTE char __memprof_profile_filename[1];
34e8d8bef9SDimitry Andric
35*0fca6ea1SDimitry Andric // Share ClHistogram compiler flag with runtime.
36*0fca6ea1SDimitry Andric SANITIZER_WEAK_ATTRIBUTE bool __memprof_histogram;
37*0fca6ea1SDimitry Andric
38e8d8bef9SDimitry Andric namespace __memprof {
39e8d8bef9SDimitry Andric
MemprofDie()40e8d8bef9SDimitry Andric static void MemprofDie() {
41e8d8bef9SDimitry Andric static atomic_uint32_t num_calls;
42e8d8bef9SDimitry Andric if (atomic_fetch_add(&num_calls, 1, memory_order_relaxed) != 0) {
43e8d8bef9SDimitry Andric // Don't die twice - run a busy loop.
44e8d8bef9SDimitry Andric while (1) {
4581ad6265SDimitry Andric internal_sched_yield();
46e8d8bef9SDimitry Andric }
47e8d8bef9SDimitry Andric }
48e8d8bef9SDimitry Andric if (common_flags()->print_module_map >= 1)
49e8d8bef9SDimitry Andric DumpProcessMap();
50e8d8bef9SDimitry Andric if (flags()->unmap_shadow_on_exit) {
51e8d8bef9SDimitry Andric if (kHighShadowEnd)
52e8d8bef9SDimitry Andric UnmapOrDie((void *)kLowShadowBeg, kHighShadowEnd - kLowShadowBeg);
53e8d8bef9SDimitry Andric }
54e8d8bef9SDimitry Andric }
55e8d8bef9SDimitry Andric
MemprofOnDeadlySignal(int signo,void * siginfo,void * context)56bdd1243dSDimitry Andric static void MemprofOnDeadlySignal(int signo, void *siginfo, void *context) {
57bdd1243dSDimitry Andric // We call StartReportDeadlySignal not HandleDeadlySignal so we get the
58bdd1243dSDimitry Andric // deadly signal message to stderr but no writing to the profile output file
59bdd1243dSDimitry Andric StartReportDeadlySignal();
60bdd1243dSDimitry Andric __memprof_profile_dump();
61bdd1243dSDimitry Andric Die();
62bdd1243dSDimitry Andric }
63bdd1243dSDimitry Andric
CheckUnwind()64fe6060f1SDimitry Andric static void CheckUnwind() {
65fe6060f1SDimitry Andric GET_STACK_TRACE(kStackTraceMax, common_flags()->fast_unwind_on_check);
66fe6060f1SDimitry Andric stack.Print();
67e8d8bef9SDimitry Andric }
68e8d8bef9SDimitry Andric
69e8d8bef9SDimitry Andric // -------------------------- Globals --------------------- {{{1
70e8d8bef9SDimitry Andric int memprof_inited;
71e8d8bef9SDimitry Andric bool memprof_init_is_running;
72e8d8bef9SDimitry Andric int memprof_timestamp_inited;
73e8d8bef9SDimitry Andric long memprof_init_timestamp_s;
74e8d8bef9SDimitry Andric
75e8d8bef9SDimitry Andric uptr kHighMemEnd;
76e8d8bef9SDimitry Andric
77e8d8bef9SDimitry Andric // -------------------------- Run-time entry ------------------- {{{1
78e8d8bef9SDimitry Andric // exported functions
79e8d8bef9SDimitry Andric
80e8d8bef9SDimitry Andric #define MEMPROF_MEMORY_ACCESS_CALLBACK_BODY() __memprof::RecordAccess(addr);
81*0fca6ea1SDimitry Andric #define MEMPROF_MEMORY_ACCESS_CALLBACK_BODY_HIST() \
82*0fca6ea1SDimitry Andric __memprof::RecordAccessHistogram(addr);
83e8d8bef9SDimitry Andric
84e8d8bef9SDimitry Andric #define MEMPROF_MEMORY_ACCESS_CALLBACK(type) \
85e8d8bef9SDimitry Andric extern "C" NOINLINE INTERFACE_ATTRIBUTE void __memprof_##type(uptr addr) { \
86e8d8bef9SDimitry Andric MEMPROF_MEMORY_ACCESS_CALLBACK_BODY() \
87e8d8bef9SDimitry Andric }
88e8d8bef9SDimitry Andric
89*0fca6ea1SDimitry Andric #define MEMPROF_MEMORY_ACCESS_CALLBACK_HIST(type) \
90*0fca6ea1SDimitry Andric extern "C" NOINLINE INTERFACE_ATTRIBUTE void __memprof_hist_##type( \
91*0fca6ea1SDimitry Andric uptr addr) { \
92*0fca6ea1SDimitry Andric MEMPROF_MEMORY_ACCESS_CALLBACK_BODY_HIST() \
93*0fca6ea1SDimitry Andric }
94*0fca6ea1SDimitry Andric
95*0fca6ea1SDimitry Andric MEMPROF_MEMORY_ACCESS_CALLBACK_HIST(load)
MEMPROF_MEMORY_ACCESS_CALLBACK_HIST(store)96*0fca6ea1SDimitry Andric MEMPROF_MEMORY_ACCESS_CALLBACK_HIST(store)
97*0fca6ea1SDimitry Andric
98e8d8bef9SDimitry Andric MEMPROF_MEMORY_ACCESS_CALLBACK(load)
99e8d8bef9SDimitry Andric MEMPROF_MEMORY_ACCESS_CALLBACK(store)
100e8d8bef9SDimitry Andric
101e8d8bef9SDimitry Andric // Force the linker to keep the symbols for various MemProf interface
102e8d8bef9SDimitry Andric // functions. We want to keep those in the executable in order to let the
103e8d8bef9SDimitry Andric // instrumented dynamic libraries access the symbol even if it is not used by
104e8d8bef9SDimitry Andric // the executable itself. This should help if the build system is removing dead
105e8d8bef9SDimitry Andric // code at link time.
106e8d8bef9SDimitry Andric static NOINLINE void force_interface_symbols() {
107e8d8bef9SDimitry Andric volatile int fake_condition = 0; // prevent dead condition elimination.
108e8d8bef9SDimitry Andric // clang-format off
109e8d8bef9SDimitry Andric switch (fake_condition) {
110e8d8bef9SDimitry Andric case 1: __memprof_record_access(nullptr); break;
111e8d8bef9SDimitry Andric case 2: __memprof_record_access_range(nullptr, 0); break;
112e8d8bef9SDimitry Andric }
113e8d8bef9SDimitry Andric // clang-format on
114e8d8bef9SDimitry Andric }
115e8d8bef9SDimitry Andric
memprof_atexit()116e8d8bef9SDimitry Andric static void memprof_atexit() {
117e8d8bef9SDimitry Andric Printf("MemProfiler exit stats:\n");
118e8d8bef9SDimitry Andric __memprof_print_accumulated_stats();
119e8d8bef9SDimitry Andric }
120e8d8bef9SDimitry Andric
InitializeHighMemEnd()121e8d8bef9SDimitry Andric static void InitializeHighMemEnd() {
122e8d8bef9SDimitry Andric kHighMemEnd = GetMaxUserVirtualAddress();
123e8d8bef9SDimitry Andric // Increase kHighMemEnd to make sure it's properly
124e8d8bef9SDimitry Andric // aligned together with kHighMemBeg:
125e8d8bef9SDimitry Andric kHighMemEnd |= (GetMmapGranularity() << SHADOW_SCALE) - 1;
126e8d8bef9SDimitry Andric }
127e8d8bef9SDimitry Andric
PrintAddressSpaceLayout()128e8d8bef9SDimitry Andric void PrintAddressSpaceLayout() {
129e8d8bef9SDimitry Andric if (kHighMemBeg) {
130e8d8bef9SDimitry Andric Printf("|| `[%p, %p]` || HighMem ||\n", (void *)kHighMemBeg,
131e8d8bef9SDimitry Andric (void *)kHighMemEnd);
132e8d8bef9SDimitry Andric Printf("|| `[%p, %p]` || HighShadow ||\n", (void *)kHighShadowBeg,
133e8d8bef9SDimitry Andric (void *)kHighShadowEnd);
134e8d8bef9SDimitry Andric }
135e8d8bef9SDimitry Andric Printf("|| `[%p, %p]` || ShadowGap ||\n", (void *)kShadowGapBeg,
136e8d8bef9SDimitry Andric (void *)kShadowGapEnd);
137e8d8bef9SDimitry Andric if (kLowShadowBeg) {
138e8d8bef9SDimitry Andric Printf("|| `[%p, %p]` || LowShadow ||\n", (void *)kLowShadowBeg,
139e8d8bef9SDimitry Andric (void *)kLowShadowEnd);
140e8d8bef9SDimitry Andric Printf("|| `[%p, %p]` || LowMem ||\n", (void *)kLowMemBeg,
141e8d8bef9SDimitry Andric (void *)kLowMemEnd);
142e8d8bef9SDimitry Andric }
143e8d8bef9SDimitry Andric Printf("MemToShadow(shadow): %p %p", (void *)MEM_TO_SHADOW(kLowShadowBeg),
144e8d8bef9SDimitry Andric (void *)MEM_TO_SHADOW(kLowShadowEnd));
145e8d8bef9SDimitry Andric if (kHighMemBeg) {
146e8d8bef9SDimitry Andric Printf(" %p %p", (void *)MEM_TO_SHADOW(kHighShadowBeg),
147e8d8bef9SDimitry Andric (void *)MEM_TO_SHADOW(kHighShadowEnd));
148e8d8bef9SDimitry Andric }
149e8d8bef9SDimitry Andric Printf("\n");
150e8d8bef9SDimitry Andric Printf("malloc_context_size=%zu\n",
151e8d8bef9SDimitry Andric (uptr)common_flags()->malloc_context_size);
152e8d8bef9SDimitry Andric
153e8d8bef9SDimitry Andric Printf("SHADOW_SCALE: %d\n", (int)SHADOW_SCALE);
154e8d8bef9SDimitry Andric Printf("SHADOW_GRANULARITY: %d\n", (int)SHADOW_GRANULARITY);
155*0fca6ea1SDimitry Andric Printf("SHADOW_OFFSET: %p\n", (void *)SHADOW_OFFSET);
156e8d8bef9SDimitry Andric CHECK(SHADOW_SCALE >= 3 && SHADOW_SCALE <= 7);
157e8d8bef9SDimitry Andric }
158e8d8bef9SDimitry Andric
MemprofInitInternal()159e8d8bef9SDimitry Andric static void MemprofInitInternal() {
160e8d8bef9SDimitry Andric if (LIKELY(memprof_inited))
161e8d8bef9SDimitry Andric return;
162e8d8bef9SDimitry Andric SanitizerToolName = "MemProfiler";
163e8d8bef9SDimitry Andric CHECK(!memprof_init_is_running && "MemProf init calls itself!");
164e8d8bef9SDimitry Andric memprof_init_is_running = true;
165e8d8bef9SDimitry Andric
166e8d8bef9SDimitry Andric CacheBinaryName();
167e8d8bef9SDimitry Andric
168e8d8bef9SDimitry Andric // Initialize flags. This must be done early, because most of the
169e8d8bef9SDimitry Andric // initialization steps look at flags().
170e8d8bef9SDimitry Andric InitializeFlags();
171e8d8bef9SDimitry Andric
172e8d8bef9SDimitry Andric AvoidCVE_2016_2143();
173e8d8bef9SDimitry Andric
174e8d8bef9SDimitry Andric SetMallocContextSize(common_flags()->malloc_context_size);
175e8d8bef9SDimitry Andric
176e8d8bef9SDimitry Andric InitializeHighMemEnd();
177e8d8bef9SDimitry Andric
178e8d8bef9SDimitry Andric // Make sure we are not statically linked.
179*0fca6ea1SDimitry Andric __interception::DoesNotSupportStaticLinking();
180e8d8bef9SDimitry Andric
181e8d8bef9SDimitry Andric // Install tool-specific callbacks in sanitizer_common.
182e8d8bef9SDimitry Andric AddDieCallback(MemprofDie);
183fe6060f1SDimitry Andric SetCheckUnwindCallback(CheckUnwind);
184e8d8bef9SDimitry Andric
185e8d8bef9SDimitry Andric // Use profile name specified via the binary itself if it exists, and hasn't
186e8d8bef9SDimitry Andric // been overrriden by a flag at runtime.
187e8d8bef9SDimitry Andric if (__memprof_profile_filename[0] != 0 && !common_flags()->log_path)
188e8d8bef9SDimitry Andric __sanitizer_set_report_path(__memprof_profile_filename);
189e8d8bef9SDimitry Andric else
190e8d8bef9SDimitry Andric __sanitizer_set_report_path(common_flags()->log_path);
191e8d8bef9SDimitry Andric
192e8d8bef9SDimitry Andric __sanitizer::InitializePlatformEarly();
193e8d8bef9SDimitry Andric
194e8d8bef9SDimitry Andric // Setup internal allocator callback.
195e8d8bef9SDimitry Andric SetLowLevelAllocateMinAlignment(SHADOW_GRANULARITY);
196e8d8bef9SDimitry Andric
197e8d8bef9SDimitry Andric InitializeMemprofInterceptors();
198e8d8bef9SDimitry Andric CheckASLR();
199e8d8bef9SDimitry Andric
200e8d8bef9SDimitry Andric ReplaceSystemMalloc();
201e8d8bef9SDimitry Andric
202e8d8bef9SDimitry Andric DisableCoreDumperIfNecessary();
203e8d8bef9SDimitry Andric
204e8d8bef9SDimitry Andric InitializeShadowMemory();
205e8d8bef9SDimitry Andric
206e8d8bef9SDimitry Andric TSDInit(PlatformTSDDtor);
207bdd1243dSDimitry Andric InstallDeadlySignalHandlers(MemprofOnDeadlySignal);
208e8d8bef9SDimitry Andric
209e8d8bef9SDimitry Andric InitializeAllocator();
210e8d8bef9SDimitry Andric
211e8d8bef9SDimitry Andric if (flags()->atexit)
212e8d8bef9SDimitry Andric Atexit(memprof_atexit);
213e8d8bef9SDimitry Andric
214e8d8bef9SDimitry Andric InitializeCoverage(common_flags()->coverage, common_flags()->coverage_dir);
215e8d8bef9SDimitry Andric
216e8d8bef9SDimitry Andric // interceptors
217e8d8bef9SDimitry Andric InitTlsSize();
218e8d8bef9SDimitry Andric
219e8d8bef9SDimitry Andric // Create main thread.
220e8d8bef9SDimitry Andric MemprofThread *main_thread = CreateMainThread();
221e8d8bef9SDimitry Andric CHECK_EQ(0, main_thread->tid());
222e8d8bef9SDimitry Andric force_interface_symbols(); // no-op.
223e8d8bef9SDimitry Andric SanitizerInitializeUnwinder();
224e8d8bef9SDimitry Andric
225e8d8bef9SDimitry Andric Symbolizer::LateInitialize();
226e8d8bef9SDimitry Andric
227e8d8bef9SDimitry Andric VReport(1, "MemProfiler Init done\n");
228e8d8bef9SDimitry Andric
22906c3fb27SDimitry Andric memprof_init_is_running = false;
23006c3fb27SDimitry Andric memprof_inited = 1;
231e8d8bef9SDimitry Andric }
232e8d8bef9SDimitry Andric
MemprofInitTime()233e8d8bef9SDimitry Andric void MemprofInitTime() {
234e8d8bef9SDimitry Andric if (LIKELY(memprof_timestamp_inited))
235e8d8bef9SDimitry Andric return;
236e8d8bef9SDimitry Andric timespec ts;
237e8d8bef9SDimitry Andric clock_gettime(CLOCK_REALTIME, &ts);
238e8d8bef9SDimitry Andric memprof_init_timestamp_s = ts.tv_sec;
239e8d8bef9SDimitry Andric memprof_timestamp_inited = 1;
240e8d8bef9SDimitry Andric }
241e8d8bef9SDimitry Andric
242e8d8bef9SDimitry Andric // Initialize as requested from some part of MemProf runtime library
243e8d8bef9SDimitry Andric // (interceptors, allocator, etc).
MemprofInitFromRtl()244e8d8bef9SDimitry Andric void MemprofInitFromRtl() { MemprofInitInternal(); }
245e8d8bef9SDimitry Andric
246e8d8bef9SDimitry Andric #if MEMPROF_DYNAMIC
247e8d8bef9SDimitry Andric // Initialize runtime in case it's LD_PRELOAD-ed into uninstrumented executable
248e8d8bef9SDimitry Andric // (and thus normal initializers from .preinit_array or modules haven't run).
249e8d8bef9SDimitry Andric
250e8d8bef9SDimitry Andric class MemprofInitializer {
251e8d8bef9SDimitry Andric public:
MemprofInitializer()252e8d8bef9SDimitry Andric MemprofInitializer() { MemprofInitFromRtl(); }
253e8d8bef9SDimitry Andric };
254e8d8bef9SDimitry Andric
255e8d8bef9SDimitry Andric static MemprofInitializer memprof_initializer;
256e8d8bef9SDimitry Andric #endif // MEMPROF_DYNAMIC
257e8d8bef9SDimitry Andric
258e8d8bef9SDimitry Andric } // namespace __memprof
259e8d8bef9SDimitry Andric
260e8d8bef9SDimitry Andric // ---------------------- Interface ---------------- {{{1
261e8d8bef9SDimitry Andric using namespace __memprof;
262e8d8bef9SDimitry Andric
263e8d8bef9SDimitry Andric // Initialize as requested from instrumented application code.
__memprof_init()264e8d8bef9SDimitry Andric void __memprof_init() {
265e8d8bef9SDimitry Andric MemprofInitTime();
266e8d8bef9SDimitry Andric MemprofInitInternal();
267e8d8bef9SDimitry Andric }
268e8d8bef9SDimitry Andric
__memprof_preinit()269e8d8bef9SDimitry Andric void __memprof_preinit() { MemprofInitInternal(); }
270e8d8bef9SDimitry Andric
__memprof_version_mismatch_check_v1()271e8d8bef9SDimitry Andric void __memprof_version_mismatch_check_v1() {}
272e8d8bef9SDimitry Andric
__memprof_record_access(void const volatile * addr)273e8d8bef9SDimitry Andric void __memprof_record_access(void const volatile *addr) {
274e8d8bef9SDimitry Andric __memprof::RecordAccess((uptr)addr);
275e8d8bef9SDimitry Andric }
276e8d8bef9SDimitry Andric
__memprof_record_access_hist(void const volatile * addr)277*0fca6ea1SDimitry Andric void __memprof_record_access_hist(void const volatile *addr) {
278*0fca6ea1SDimitry Andric __memprof::RecordAccessHistogram((uptr)addr);
279*0fca6ea1SDimitry Andric }
280*0fca6ea1SDimitry Andric
__memprof_record_access_range(void const volatile * addr,uptr size)281349cc55cSDimitry Andric void __memprof_record_access_range(void const volatile *addr, uptr size) {
282349cc55cSDimitry Andric for (uptr a = (uptr)addr; a < (uptr)addr + size; a += kWordSize)
283349cc55cSDimitry Andric __memprof::RecordAccess(a);
284e8d8bef9SDimitry Andric }
285e8d8bef9SDimitry Andric
__memprof_record_access_range_hist(void const volatile * addr,uptr size)286*0fca6ea1SDimitry Andric void __memprof_record_access_range_hist(void const volatile *addr, uptr size) {
287*0fca6ea1SDimitry Andric for (uptr a = (uptr)addr; a < (uptr)addr + size; a += kWordSize)
288*0fca6ea1SDimitry Andric __memprof::RecordAccessHistogram(a);
289*0fca6ea1SDimitry Andric }
290*0fca6ea1SDimitry Andric
291e8d8bef9SDimitry Andric extern "C" SANITIZER_INTERFACE_ATTRIBUTE u16
__sanitizer_unaligned_load16(const uu16 * p)292e8d8bef9SDimitry Andric __sanitizer_unaligned_load16(const uu16 *p) {
293e8d8bef9SDimitry Andric __memprof_record_access(p);
294e8d8bef9SDimitry Andric return *p;
295e8d8bef9SDimitry Andric }
296e8d8bef9SDimitry Andric
297e8d8bef9SDimitry Andric extern "C" SANITIZER_INTERFACE_ATTRIBUTE u32
__sanitizer_unaligned_load32(const uu32 * p)298e8d8bef9SDimitry Andric __sanitizer_unaligned_load32(const uu32 *p) {
299e8d8bef9SDimitry Andric __memprof_record_access(p);
300e8d8bef9SDimitry Andric return *p;
301e8d8bef9SDimitry Andric }
302e8d8bef9SDimitry Andric
303e8d8bef9SDimitry Andric extern "C" SANITIZER_INTERFACE_ATTRIBUTE u64
__sanitizer_unaligned_load64(const uu64 * p)304e8d8bef9SDimitry Andric __sanitizer_unaligned_load64(const uu64 *p) {
305e8d8bef9SDimitry Andric __memprof_record_access(p);
306e8d8bef9SDimitry Andric return *p;
307e8d8bef9SDimitry Andric }
308e8d8bef9SDimitry Andric
309e8d8bef9SDimitry Andric extern "C" SANITIZER_INTERFACE_ATTRIBUTE void
__sanitizer_unaligned_store16(uu16 * p,u16 x)310e8d8bef9SDimitry Andric __sanitizer_unaligned_store16(uu16 *p, u16 x) {
311e8d8bef9SDimitry Andric __memprof_record_access(p);
312e8d8bef9SDimitry Andric *p = x;
313e8d8bef9SDimitry Andric }
314e8d8bef9SDimitry Andric
315e8d8bef9SDimitry Andric extern "C" SANITIZER_INTERFACE_ATTRIBUTE void
__sanitizer_unaligned_store32(uu32 * p,u32 x)316e8d8bef9SDimitry Andric __sanitizer_unaligned_store32(uu32 *p, u32 x) {
317e8d8bef9SDimitry Andric __memprof_record_access(p);
318e8d8bef9SDimitry Andric *p = x;
319e8d8bef9SDimitry Andric }
320e8d8bef9SDimitry Andric
321e8d8bef9SDimitry Andric extern "C" SANITIZER_INTERFACE_ATTRIBUTE void
__sanitizer_unaligned_store64(uu64 * p,u64 x)322e8d8bef9SDimitry Andric __sanitizer_unaligned_store64(uu64 *p, u64 x) {
323e8d8bef9SDimitry Andric __memprof_record_access(p);
324e8d8bef9SDimitry Andric *p = x;
325e8d8bef9SDimitry Andric }
326