3 The input raw profile test has been generated from the following source code:
6 #include <sanitizer/memprof_interface.h>
9 int main(int argc, char **argv) {
10 char *x = (char *)malloc(10);
13 __memprof_profile_dump();
14 x = (char *)malloc(10);
21 The following commands were used to compile the source to a memprof instrumented
22 executable and collect a raw binary format profile. Since the profile contains
23 virtual addresses for the callstack, we do not expect the raw binary profile to
24 be deterministic. The summary should be deterministic apart from changes to
25 the shared libraries linked in which could change the number of segments
29 clang -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -Wl,-build-id source.c -o rawprofile.out
31 env MEMPROF_OPTIONS=log_path=stdout ./rawprofile.out > multi.memprofraw
34 RUN: llvm-profdata show --memory %p/Inputs/multi.memprofraw -o - | FileCheck %s
36 We expect 2 MIB entries, 1 each for the malloc calls in the program. Unlike the
37 memprof-basic.test we do not see any allocation from glibc.
39 CHECK: MemProf Profile 1
41 CHECK: TotalSizeBytes: 864
44 CHECK: NumStackOffsets: 2
45 CHECK: MemProf Profile 2
47 CHECK: TotalSizeBytes: 864
50 CHECK: NumStackOffsets: 2