3 The input raw profile test has been generated from the following source code:
8 int main(int argc, char **argv) {
9 char *x = (char *)malloc(10);
12 x = (char *)malloc(10);
19 The following commands were used to compile the source to a memprof instrumented
20 executable and collect a raw binary format profile. Since the profile contains
21 virtual addresses for the callstack, we do not expect the raw binary profile to
22 be deterministic. The summary should be deterministic apart from changes to
23 the shared libraries linked in which could change the number of segments
27 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
29 env MEMPROF_OPTIONS=log_path=stdout ./rawprofile.out > basic.memprofraw
32 RUN: llvm-profdata show --memory %p/Inputs/basic.memprofraw -o - | FileCheck %s
34 We expect 3 MIB entries, 1 each for the malloc calls in the program and one
35 additional entry from a realloc in glibc/libio/vasprintf.c.
37 CHECK: MemProf Profile 1
39 CHECK: TotalSizeBytes: 1016
42 CHECK: NumStackOffsets: 3