class ProducerIPCClient
Defined at line 39 of file ../../third_party/perfetto/include/perfetto/ext/tracing/ipc/producer_ipc_client.h
Allows to connect to a remote Service through a UNIX domain socket.
Exposed to:
Producer(s) of the tracing library.
Implemented in:
src/tracing/ipc/producer/producer_ipc_client_impl.cc
Public Methods
std::unique_ptr<TracingService::ProducerEndpoint> Connect (const char * service_sock_name, Producer * , const std::string & producer_name, base::TaskRunner * , TracingService::ProducerSMBScrapingMode smb_scraping_mode, size_t shared_memory_size_hint_bytes, size_t shared_memory_page_size_hint_bytes, std::unique_ptr<SharedMemory> shm, std::unique_ptr<SharedMemoryArbiter> shm_arbiter, ConnectionFlags )
Connects to the producer port of the Service listening on the given
|service_sock_name|. If the connection is successful, the OnConnect()
method will be invoked asynchronously on the passed Producer interface. If
the connection fails, OnDisconnect() will be invoked instead. The returned
ProducerEndpoint serves also to delimit the scope of the callbacks invoked
on the Producer interface: no more Producer callbacks are invoked
immediately after its destruction and any pending callback will be dropped.
To provide a producer-allocated shared memory buffer, both |shm| and
|shm_arbiter| should be set. |shm_arbiter| should be an unbound
SharedMemoryArbiter instance. When |shm| and |shm_arbiter| are provided,
the service will attempt to adopt the provided SMB. If this fails, the
ProducerEndpoint will disconnect, but the SMB and arbiter will remain valid
until the client is destroyed.
TODO(eseckler): Support adoption failure more gracefully.
TODO(primiano): move all the existing use cases to the Connect(ConnArgs)
below. Also move the functionality of ConnectionFlags into ConnArgs.
std::unique_ptr<TracingService::ProducerEndpoint> Connect (ipc::Client::ConnArgs , Producer * , const std::string & producer_name, base::TaskRunner * , TracingService::ProducerSMBScrapingMode smb_scraping_mode, size_t shared_memory_size_hint_bytes, size_t shared_memory_page_size_hint_bytes, std::unique_ptr<SharedMemory> shm, std::unique_ptr<SharedMemoryArbiter> shm_arbiter, CreateSocketAsync create_socket_async)
Overload of Connect() to support adopting a connected socket using
ipc::Client::ConnArgs.
Protected Methods
void ProducerIPCClient ()
Defined at line 97 of file ../../third_party/perfetto/include/perfetto/ext/tracing/ipc/producer_ipc_client.h
Enumerations
enum ConnectionFlags
| Name | Value |
|---|---|
| kDefault | 0 |
| kRetryIfUnreachable | 1 |
Defined at line 41 of file ../../third_party/perfetto/include/perfetto/ext/tracing/ipc/producer_ipc_client.h