Path: blob/main/contrib/llvm-project/compiler-rt/lib/memprof/memprof_interface_internal.h
35236 views
//===-- memprof_interface_internal.h ---------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file is a part of MemProfiler, a memory profiler.9//10// This header declares the MemProfiler runtime interface functions.11// The runtime library has to define these functions so the instrumented program12// could call them.13//14// See also include/sanitizer/memprof_interface.h15//===----------------------------------------------------------------------===//16#ifndef MEMPROF_INTERFACE_INTERNAL_H17#define MEMPROF_INTERFACE_INTERNAL_H1819#include "sanitizer_common/sanitizer_internal_defs.h"2021#include "memprof_init_version.h"2223using __sanitizer::u32;24using __sanitizer::u64;25using __sanitizer::uptr;2627extern "C" {28// This function should be called at the very beginning of the process,29// before any instrumented code is executed and before any call to malloc.30SANITIZER_INTERFACE_ATTRIBUTE void __memprof_init();31SANITIZER_INTERFACE_ATTRIBUTE void __memprof_preinit();32SANITIZER_INTERFACE_ATTRIBUTE void __memprof_version_mismatch_check_v1();3334SANITIZER_INTERFACE_ATTRIBUTE35void __memprof_record_access(void const volatile *addr);3637SANITIZER_INTERFACE_ATTRIBUTE38void __memprof_record_access_range(void const volatile *addr, uptr size);3940SANITIZER_INTERFACE_ATTRIBUTE void __memprof_print_accumulated_stats();4142SANITIZER_INTERFACE_ATTRIBUTE43const char *__memprof_default_options();4445SANITIZER_INTERFACE_ATTRIBUTE46extern uptr __memprof_shadow_memory_dynamic_address;4748SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE extern char49__memprof_profile_filename[1];50SANITIZER_INTERFACE_ATTRIBUTE int __memprof_profile_dump();51SANITIZER_INTERFACE_ATTRIBUTE void __memprof_profile_reset();5253SANITIZER_INTERFACE_ATTRIBUTE void __memprof_load(uptr p);54SANITIZER_INTERFACE_ATTRIBUTE void __memprof_store(uptr p);5556SANITIZER_INTERFACE_ATTRIBUTE57void *__memprof_memcpy(void *dst, const void *src, uptr size);58SANITIZER_INTERFACE_ATTRIBUTE59void *__memprof_memset(void *s, int c, uptr n);60SANITIZER_INTERFACE_ATTRIBUTE61void *__memprof_memmove(void *dest, const void *src, uptr n);62} // extern "C"6364#endif // MEMPROF_INTERFACE_INTERNAL_H656667