Namespaces

Enumerations

enum BackendType : uint32_t
Name Value Comments
kUnspecifiedBackend 0 --
kInProcessBackend 1 << 0

Connects to a previously-initialized perfetto tracing backend for
in-process. If the in-process backend has not been previously initialized
it will do so and create the tracing service on a dedicated thread.

kSystemBackend 1 << 1

Connects to the system tracing service (e.g. on Linux/Android/Mac uses a
named UNIX socket).

kCustomBackend 1 << 2

Used to provide a custom IPC transport to connect to the service.
TracingInitArgs::custom_backend must be non-null and point to an
indefinitely lived instance.

Defined at line 24 of file ../../third_party/perfetto/include/perfetto/tracing/backend_type.h

enum class BufferExhaustedPolicy
Name Value Comments
kStall 0

SharedMemoryArbiterImpl::GetNewChunk() will stall if no free SMB chunk is
available and wait for the tracing service to free one. Note that this
requires that messages the arbiter sends to the tracing service (from any
TraceWriter thread) will be received by it, even if all TraceWriter threads
are stalled. If no free SMB chunk becomes available after a few seconds,
the process will be aborted.

kDrop 1

SharedMemoryArbiterImpl::GetNewChunk() will return an invalid chunk if no
free SMB chunk is available. In this case, the TraceWriter will fall back
to a garbage chunk and drop written data until acquiring a future chunk
succeeds again.

kStallThenDrop 2

SharedMemoryArbiterImpl::GetNewChunk() will stall if no free SMB chunk is
available and wait for the tracing service to free one. Note that this
requires that messages the arbiter sends to the tracing service (from any
TraceWriter thread) will be received by it, even if all TraceWriter threads
are stalled. If no free SMB chunk becomes available after a few seconds,
SharedMemoryArbiterImpl::GetNewChunk() will return an invalid chunk and
data will be lost.

kDefault kStall

Deprecated alias. Do not use.

Determines how SharedMemoryArbiterImpl::GetNewChunk() behaves when no free

chunks are available.

Defined at line 24 of file ../../third_party/perfetto/include/perfetto/tracing/buffer_exhausted_policy.h

Records

Functions

  • const char * GetConsumerSocket ()
  • TraceConfig::TriggerConfig::TriggerMode GetTriggerMode (const TraceConfig & cfg)

    Defined at line 30 of file ../../third_party/perfetto/include/perfetto/tracing/core/trace_config.h

  • ProducerAndWriterID MkProducerAndWriterID (ProducerID p, WriterID w)

    Defined at line 48 of file ../../third_party/perfetto/include/perfetto/ext/tracing/core/basic_types.h

  • void GetProducerAndWriterID (ProducerAndWriterID x, ProducerID * p, WriterID * w)

    Defined at line 55 of file ../../third_party/perfetto/include/perfetto/ext/tracing/core/basic_types.h

  • std::vector<std::string> TokenizeProducerSockets (const char * producer_socket_names)

    This function is used for tokenize the |producer_socket_names| string into

    multiple producer socket names.

  • const char * GetProducerSocket ()
  • std::string GetRelaySocket ()

    Optionally returns the relay socket name. The relay socket is used

    for forwarding the IPC messages between the local producers and the remote

    tracing service.

  • template <typename MessageType, typename FieldMetadataType, typename ValueType>
    void WriteTracedProtoField (TracedProto<MessageType> & message, FieldMetadataType , ValueType && value)

    Defined at line 398 of file ../../third_party/perfetto/include/perfetto/tracing/traced_proto.h

  • template <typename T>
    void WriteIntoTracedValue (TracedValue context, T && value)

    A type T is writable into a trace if one of the following is defined:

    - T::WriteIntoTracedValue(TracedValue) const

    - T::WriteIntoTrace(TracedValue) const

    - perfetto::TraceFormatTraits

    <T

    >::WriteIntoTracedValue(TracedValue, const T

    &

    )

    - perfetto::TraceFormatTraits

    <T

    >::WriteIntoTrace(TracedValue, const T

    &

    )

    The member forms are preferred for code that can depend on perfetto directly;

    the TraceFormatTraits forms are for types owned by code that cannot. See the

    examples at the top of this file. Primitives, strings, pointers, STL

    containers and protozero enums are supported out of the box.

    If the static_assert below fires, the most common causes are:

    - No conversion is defined for T.

    - The conversion method is not const, or does not take TracedValue by value.

    - The method name is misspelled: only WriteIntoTrace and WriteIntoTracedValue

    are recognised.

    - The TraceFormatTraits

    <T

    > specialisation is not in the perfetto namespace.

    - The header defining the conversion is not included at the TRACE_EVENT call

    site.

    - T is a pointer or smart pointer to a type that is itself not writable.

    - T is a plain enum with no conversion (only protozero enums are automatic).

    Defined at line 497 of file ../../third_party/perfetto/include/perfetto/tracing/traced_value.h

  • template <typename MessageType, typename T>
    void WriteIntoTracedProto (TracedProto<MessageType> context, T && value)

    Defined at line 382 of file ../../third_party/perfetto/include/perfetto/tracing/traced_proto.h

  • template <typename T>
    typename std::enable_if<internal::has_traced_value_support<T>::value>::type WriteIntoTracedValueWithFallback (TracedValue context, T && value, const std::string & )

    Helpers to write a given value into TracedValue even if the given type

    doesn't support conversion (in which case the provided fallback should be

    used). Useful for automatically generating conversions for autogenerated

    code, but otherwise shouldn't be used as non-autogenerated code is expected

    to define WriteIntoTracedValue convertor.

    See WriteWithFallback test in traced_value_unittest.cc for a concrete

    example.

    Defined at line 519 of file ../../third_party/perfetto/include/perfetto/tracing/traced_value.h

  • template <typename T>
    typename std::enable_if<!internal::has_traced_value_support<T>::value>::type WriteIntoTracedValueWithFallback (TracedValue context, T && , const std::string & fallback)

    Defined at line 527 of file ../../third_party/perfetto/include/perfetto/tracing/traced_value.h