[ELF] Reorder SectionBase/InputSectionBase members
[llvm-project.git] / compiler-rt / lib / memprof / memprof_interface_internal.h
blob318bc410440562fed9b5be3240f1be66764aae27
1 //===-- memprof_interface_internal.h ---------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is a part of MemProfiler, a memory profiler.
11 // This header declares the MemProfiler runtime interface functions.
12 // The runtime library has to define these functions so the instrumented program
13 // could call them.
15 // See also include/sanitizer/memprof_interface.h
16 //===----------------------------------------------------------------------===//
17 #ifndef MEMPROF_INTERFACE_INTERNAL_H
18 #define MEMPROF_INTERFACE_INTERNAL_H
20 #include "sanitizer_common/sanitizer_internal_defs.h"
22 #include "memprof_init_version.h"
24 using __sanitizer::u32;
25 using __sanitizer::u64;
26 using __sanitizer::uptr;
28 extern "C" {
29 // This function should be called at the very beginning of the process,
30 // before any instrumented code is executed and before any call to malloc.
31 SANITIZER_INTERFACE_ATTRIBUTE void __memprof_init();
32 SANITIZER_INTERFACE_ATTRIBUTE void __memprof_preinit();
33 SANITIZER_INTERFACE_ATTRIBUTE void __memprof_version_mismatch_check_v1();
35 SANITIZER_INTERFACE_ATTRIBUTE
36 void __memprof_record_access(void const volatile *addr);
38 SANITIZER_INTERFACE_ATTRIBUTE
39 void __memprof_record_access_range(void const volatile *addr, uptr size);
41 SANITIZER_INTERFACE_ATTRIBUTE void __memprof_print_accumulated_stats();
43 SANITIZER_INTERFACE_ATTRIBUTE
44 const char *__memprof_default_options();
46 SANITIZER_INTERFACE_ATTRIBUTE
47 extern uptr __memprof_shadow_memory_dynamic_address;
49 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE extern char
50 __memprof_profile_filename[1];
51 SANITIZER_INTERFACE_ATTRIBUTE int __memprof_profile_dump();
52 SANITIZER_INTERFACE_ATTRIBUTE void __memprof_profile_reset();
54 SANITIZER_INTERFACE_ATTRIBUTE void __memprof_load(uptr p);
55 SANITIZER_INTERFACE_ATTRIBUTE void __memprof_store(uptr p);
57 SANITIZER_INTERFACE_ATTRIBUTE
58 void *__memprof_memcpy(void *dst, const void *src, uptr size);
59 SANITIZER_INTERFACE_ATTRIBUTE
60 void *__memprof_memset(void *s, int c, uptr n);
61 SANITIZER_INTERFACE_ATTRIBUTE
62 void *__memprof_memmove(void *dest, const void *src, uptr n);
63 } // extern "C"
65 #endif // MEMPROF_INTERFACE_INTERNAL_H