[compiler-rt] [compiler-rt][ctx_instr] Add `ctx_profile` component (PR #89304)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 19 13:24:40 PDT 2024


================
@@ -0,0 +1,38 @@
+//===- CtxInstrProfiling.cpp - contextual instrumented PGO000000 ----------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "CtxInstrProfiling.h"
+#include "sanitizer_common/sanitizer_allocator_internal.h"
+#include "sanitizer_common/sanitizer_common.h"
+#include "sanitizer_common/sanitizer_dense_map.h"
+#include "sanitizer_common/sanitizer_mutex.h"
+#include "sanitizer_common/sanitizer_placement_new.h"
+#include "sanitizer_common/sanitizer_thread_safety.h"
+
+#include <assert.h>
+
+using namespace __ctx_profile;
+
+Arena *Arena::allocateNewArena(size_t Size, Arena *Prev) {
----------------
mtrofin wrote:

OK, but I'll also need other things from sanitizer_common, like __sanitizer::Vector. This is only being used for instrumented profile collection, it's similar to `profile`  or `memprof`.

(that being said, I can switch to malloc or mmap here, though, probably more efficient)

https://github.com/llvm/llvm-project/pull/89304


More information about the llvm-commits mailing list