Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::runtime::detail Namespace Reference

Classes

struct  CancelStateBase
 Public part of the shared state so is_cancelled() can inline to one load. More...
struct  LogSinkRegistry
struct  OkTag
struct  ErrTag
struct  TraceAutostartConfig
 A traced plug-in records when PULP_TRACE_PATH is set in its host's environment, but an out-of-process host (AUHostingService, where Logic runs AU v2 plug-ins) inherits nothing from a shell or launchctl setenv. More...
class  TimeoutController
 A single owned, cancellable, joinable timeout. More...

Functions

template<typename T>
void dbg_var_one (std::string_view name, const T &value)
void dbg_var_emit_prefix (std::source_location loc)
void dbg_var_emit_suffix ()
LogSinkRegistry & log_sink_registry ()
bool & in_log_sink_dispatch ()
void dispatch_log_sink (LogLevel level, std::string_view category, std::string_view message)
void log_impl (LogLevel level, std::string_view category, std::string_view message)
void log_impl (LogLevel level, std::string_view message)
std::optional< std::uint32_t > parse_autostart_ring_kb (const char *raw)
 Parse a $PULP_TRACE_RING_KB value.
TraceAutostartConfig parse_trace_autostart (std::string_view text)
 Parse the autostart file's text.
std::string trace_autostart_expand (const std::string &path, const std::string &temp_dir)
 Expand a leading $TMPDIR in an autostart path to temp_dir (the process's own temporary directory: a sandboxed service such as AUHostingService can write there and nowhere else under the user's home).
std::string trace_autostart_output_path (const std::string &path, std::string_view process_name, long pid)
 The file a process writes for path: path itself, or, for a directory (ends with '/'), <path><process>-<pid>.pftrace.
constexpr bool timeout_targets_current_session (std::uint64_t armed_for, std::uint64_t current) noexcept
 True when a timeout armed for armed_for may still act on the session currently identified by current.

Variables

constexpr std::uint32_t default_autostart_ring_kb = 80u * 1024u
 Ring size the env-driven autostart uses when $PULP_TRACE_RING_KB is unset.
constexpr std::uint32_t min_autostart_ring_kb = 1024u
 Accepted bounds for an override: 1 MB to 4 GB, expressed in KB.
constexpr std::uint32_t max_autostart_ring_kb = 4u * 1024u * 1024u

Function Documentation

◆ dbg_var_emit_prefix()

void pulp::runtime::detail::dbg_var_emit_prefix ( std::source_location loc)
inline

◆ dbg_var_emit_suffix()

void pulp::runtime::detail::dbg_var_emit_suffix ( )
inline

◆ dbg_var_one()

template<typename T>
void pulp::runtime::detail::dbg_var_one ( std::string_view name,
const T & value )
inline

◆ dispatch_log_sink()

void pulp::runtime::detail::dispatch_log_sink ( LogLevel level,
std::string_view category,
std::string_view message )
inline

◆ in_log_sink_dispatch()

bool & pulp::runtime::detail::in_log_sink_dispatch ( )
inline

◆ log_impl() [1/2]

void pulp::runtime::detail::log_impl ( LogLevel level,
std::string_view category,
std::string_view message )
inline

◆ log_impl() [2/2]

void pulp::runtime::detail::log_impl ( LogLevel level,
std::string_view message )
inline

◆ log_sink_registry()

LogSinkRegistry & pulp::runtime::detail::log_sink_registry ( )
inline

◆ parse_autostart_ring_kb()

std::optional< std::uint32_t > pulp::runtime::detail::parse_autostart_ring_kb ( const char * raw)
inline

Parse a $PULP_TRACE_RING_KB value.

Returns the requested ring size in KB, or nullopt when raw is absent, empty, not a bare decimal integer, or outside [min_autostart_ring_kb, max_autostart_ring_kb].

This is a separate pure function, and the caller reports a rejection rather than silently falling back, because an undersized ring does not degrade gracefully: the ring wraps, the interned string table at the head of the sequence is overwritten, and every later packet on that sequence becomes unparseable. What lands on disk is then a large .pftrace that opens without complaint and contains zero slices. A typo that quietly kept the default would produce exactly the empty capture this override exists to avoid.

Config-independent, so it is unit-testable in the default OFF build.

◆ parse_trace_autostart()

TraceAutostartConfig pulp::runtime::detail::parse_trace_autostart ( std::string_view text)
inline

Parse the autostart file's text.

Config-independent (testable in the OFF build); values are taken verbatim and validated by their usual readers.

◆ timeout_targets_current_session()

bool pulp::runtime::detail::timeout_targets_current_session ( std::uint64_t armed_for,
std::uint64_t current )
constexprnoexcept

True when a timeout armed for armed_for may still act on the session currently identified by current.

Pure so the rule is testable without a live Perfetto session. 0 means "no session", which nothing may act on — a timeout that fires after the last detach has nothing left to flush.

◆ trace_autostart_expand()

std::string pulp::runtime::detail::trace_autostart_expand ( const std::string & path,
const std::string & temp_dir )
inline

Expand a leading $TMPDIR in an autostart path to temp_dir (the process's own temporary directory: a sandboxed service such as AUHostingService can write there and nowhere else under the user's home).

◆ trace_autostart_output_path()

std::string pulp::runtime::detail::trace_autostart_output_path ( const std::string & path,
std::string_view process_name,
long pid )
inline

The file a process writes for path: path itself, or, for a directory (ends with '/'), <path><process>-<pid>.pftrace.

Variable Documentation

◆ default_autostart_ring_kb

std::uint32_t pulp::runtime::detail::default_autostart_ring_kb = 80u * 1024u
inlineconstexpr

Ring size the env-driven autostart uses when $PULP_TRACE_RING_KB is unset.

Sized for a render/DSP capture.

◆ max_autostart_ring_kb

std::uint32_t pulp::runtime::detail::max_autostart_ring_kb = 4u * 1024u * 1024u
inlineconstexpr

◆ min_autostart_ring_kb

std::uint32_t pulp::runtime::detail::min_autostart_ring_kb = 1024u
inlineconstexpr

Accepted bounds for an override: 1 MB to 4 GB, expressed in KB.