Inside Bitcoin
Opening the selected file…
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1# Copyright (c) 2024-present The Bitcoin Core developers2# Distributed under the MIT software license, see the accompanying3# file COPYING or https://opensource.org/license/mit/.5#[=======================================================================[6FindUSDT7--------9Finds the Userspace, Statically Defined Tracing header(s).11Imported Targets12^^^^^^^^^^^^^^^^14This module provides imported target ``USDT::headers``, if15USDT has been found.17Result Variables18^^^^^^^^^^^^^^^^20This module defines the following variables:22``USDT_FOUND``23"True" if USDT found.25#]=======================================================================]27find_path(USDT_INCLUDE_DIR28NAMES sys/sdt.h29)30mark_as_advanced(USDT_INCLUDE_DIR)32if(USDT_INCLUDE_DIR)33include(CMakePushCheckState)34cmake_push_check_state(RESET)36include(CheckCXXSourceCompiles)37set(CMAKE_REQUIRED_INCLUDES ${USDT_INCLUDE_DIR})38check_cxx_source_compiles("39#if defined(__arm__)40# define STAP_SDT_ARG_CONSTRAINT g41#endif43// Setting SDT_USE_VARIADIC lets systemtap (sys/sdt.h) know that we want to use44// the optional variadic macros to define tracepoints.45#define SDT_USE_VARIADIC 146#include <sys/sdt.h>48int main()49{50STAP_PROBEV(context, event);51int a, b, c, d, e, f, g;52STAP_PROBEV(context, event, a, b, c, d, e, f, g);53}54" HAVE_USDT_H55)57cmake_pop_check_state()58endif()60include(FindPackageHandleStandardArgs)61find_package_handle_standard_args(USDT62REQUIRED_VARS USDT_INCLUDE_DIR HAVE_USDT_H63)65if(USDT_FOUND AND NOT TARGET USDT::headers)66add_library(USDT::headers INTERFACE IMPORTED)67set_target_properties(USDT::headers PROPERTIES68INTERFACE_INCLUDE_DIRECTORIES "${USDT_INCLUDE_DIR}"69)70set(ENABLE_TRACING TRUE)71endif()
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.