51 lines · c
1//===--- rtsan.h - Realtime Sanitizer ---------------------------*- 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-exception6//7//===----------------------------------------------------------------------===//8//9//===----------------------------------------------------------------------===//10 11#pragma once12 13#include "sanitizer_common/sanitizer_internal_defs.h"14 15extern "C" {16 17// Initialise rtsan interceptors.18// A call to this method is added to the preinit array on Linux systems.19SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_init();20 21// Initializes rtsan if it has not been initialized yet.22// Used by the RTSan runtime to ensure that rtsan is initialized before any23// other rtsan functions are called.24SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_ensure_initialized();25 26SANITIZER_INTERFACE_ATTRIBUTE bool __rtsan_is_initialized();27 28// Enter real-time context.29// When in a real-time context, RTSan interceptors will error if realtime30// violations are detected. Calls to this method are injected at the code31// generation stage when RTSan is enabled.32SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_realtime_enter();33 34// Exit the real-time context.35// When not in a real-time context, RTSan interceptors will simply forward36// intercepted method calls to the real methods.37SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_realtime_exit();38 39// See documentation in rtsan_interface.h.40SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_disable();41 42// See documentation in rtsan_interface.h.43SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_enable();44 45SANITIZER_INTERFACE_ATTRIBUTE void46__rtsan_notify_intercepted_call(const char *intercepted_function_name);47 48SANITIZER_INTERFACE_ATTRIBUTE void49__rtsan_notify_blocking_call(const char *blocking_function_name);50} // extern "C"51