#include "src/tracing/ipc/service/producer_ipc_service.h"
#include <cinttypes>
#include "perfetto/base/logging.h"
#include "perfetto/base/task_runner.h"
#include "perfetto/ext/ipc/host.h"
#include "perfetto/ext/ipc/service.h"
#include "perfetto/ext/tracing/core/client_identity.h"
#include "perfetto/ext/tracing/core/commit_data_request.h"
#include "perfetto/ext/tracing/core/tracing_service.h"
#include "perfetto/tracing/core/data_source_config.h"
#include "perfetto/tracing/core/data_source_descriptor.h"
#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
#include "src/tracing/ipc/shared_memory_windows.h"
#else
#include "src/tracing/ipc/posix_shared_memory.h"
#endif
namespace perfetto {
ProducerIPCService::ProducerIPCService(TracingService* core_service)
: … { … }
ProducerIPCService::~ProducerIPCService() = default;
ProducerIPCService::RemoteProducer*
ProducerIPCService::GetProducerForCurrentRequest() { … }
void ProducerIPCService::InitializeConnection(
const protos::gen::InitializeConnectionRequest& req,
DeferredInitializeConnectionResponse response) { … }
void ProducerIPCService::RegisterDataSource(
const protos::gen::RegisterDataSourceRequest& req,
DeferredRegisterDataSourceResponse response) { … }
void ProducerIPCService::UpdateDataSource(
const protos::gen::UpdateDataSourceRequest& req,
DeferredUpdateDataSourceResponse response) { … }
void ProducerIPCService::OnClientDisconnected() { … }
void ProducerIPCService::UnregisterDataSource(
const protos::gen::UnregisterDataSourceRequest& req,
DeferredUnregisterDataSourceResponse response) { … }
void ProducerIPCService::RegisterTraceWriter(
const protos::gen::RegisterTraceWriterRequest& req,
DeferredRegisterTraceWriterResponse response) { … }
void ProducerIPCService::UnregisterTraceWriter(
const protos::gen::UnregisterTraceWriterRequest& req,
DeferredUnregisterTraceWriterResponse response) { … }
void ProducerIPCService::CommitData(const protos::gen::CommitDataRequest& req,
DeferredCommitDataResponse resp) { … }
void ProducerIPCService::NotifyDataSourceStarted(
const protos::gen::NotifyDataSourceStartedRequest& request,
DeferredNotifyDataSourceStartedResponse response) { … }
void ProducerIPCService::NotifyDataSourceStopped(
const protos::gen::NotifyDataSourceStoppedRequest& request,
DeferredNotifyDataSourceStoppedResponse response) { … }
void ProducerIPCService::ActivateTriggers(
const protos::gen::ActivateTriggersRequest& proto_req,
DeferredActivateTriggersResponse resp) { … }
void ProducerIPCService::GetAsyncCommand(
const protos::gen::GetAsyncCommandRequest&,
DeferredGetAsyncCommandResponse response) { … }
void ProducerIPCService::Sync(const protos::gen::SyncRequest&,
DeferredSyncResponse resp) { … }
ProducerIPCService::RemoteProducer::RemoteProducer() = default;
ProducerIPCService::RemoteProducer::~RemoteProducer() = default;
void ProducerIPCService::RemoteProducer::OnConnect() { … }
void ProducerIPCService::RemoteProducer::OnDisconnect() { … }
void ProducerIPCService::RemoteProducer::SetupDataSource(
DataSourceInstanceID dsid,
const DataSourceConfig& cfg) { … }
void ProducerIPCService::RemoteProducer::StartDataSource(
DataSourceInstanceID dsid,
const DataSourceConfig& cfg) { … }
void ProducerIPCService::RemoteProducer::StopDataSource(
DataSourceInstanceID dsid) { … }
void ProducerIPCService::RemoteProducer::OnTracingSetup() { … }
void ProducerIPCService::RemoteProducer::SendSetupTracing() { … }
void ProducerIPCService::RemoteProducer::Flush(
FlushRequestID flush_request_id,
const DataSourceInstanceID* data_source_ids,
size_t num_data_sources,
FlushFlags flush_flags) { … }
void ProducerIPCService::RemoteProducer::ClearIncrementalState(
const DataSourceInstanceID* data_source_ids,
size_t num_data_sources) { … }
}