Method

SysprofSpawnableadd_trace_fd

Declaration [src]

int
sysprof_spawnable_add_trace_fd (
  SysprofSpawnable* self,
  const char* envvar
)

Description [src]

Adds an environment variable to the spawnable that will contain a “tracing file-descriptor”. The spawned process can use sysprof_capture_writer_new_from_env() if envvar is NULL or with getenv() and sysprof_capture_writer_new_from_fd().

If envvar is NULL, “SYSPROF_TRACE_FD” will be used.

The caller is responsible for closin the resulting FD.

Parameters

envvar

Type: const char*

The environment variable.

The argument can be NULL.
The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.

Return value

Type: int

A file-descriptor which can be used to read the trace or -1 upon failure and errno is set. Caller must close() the FD if >= 0.