#include "src/tracing/ipc/service/consumer_ipc_service.h"
#include <cinttypes>
#include "perfetto/base/logging.h"
#include "perfetto/base/task_runner.h"
#include "perfetto/ext/base/scoped_file.h"
#include "perfetto/ext/ipc/basic_types.h"
#include "perfetto/ext/ipc/host.h"
#include "perfetto/ext/tracing/core/shared_memory_abi.h"
#include "perfetto/ext/tracing/core/slice.h"
#include "perfetto/ext/tracing/core/trace_packet.h"
#include "perfetto/ext/tracing/core/trace_stats.h"
#include "perfetto/ext/tracing/core/tracing_service.h"
#include "perfetto/tracing/core/trace_config.h"
#include "perfetto/tracing/core/tracing_service_capabilities.h"
#include "perfetto/tracing/core/tracing_service_state.h"
namespace perfetto {
ConsumerIPCService::ConsumerIPCService(TracingService* core_service)
: … { … }
ConsumerIPCService::~ConsumerIPCService() = default;
ConsumerIPCService::RemoteConsumer*
ConsumerIPCService::GetConsumerForCurrentRequest() { … }
void ConsumerIPCService::OnClientDisconnected() { … }
void ConsumerIPCService::EnableTracing(
const protos::gen::EnableTracingRequest& req,
DeferredEnableTracingResponse resp) { … }
void ConsumerIPCService::StartTracing(const protos::gen::StartTracingRequest&,
DeferredStartTracingResponse resp) { … }
void ConsumerIPCService::ChangeTraceConfig(
const protos::gen::ChangeTraceConfigRequest& req,
DeferredChangeTraceConfigResponse resp) { … }
void ConsumerIPCService::DisableTracing(
const protos::gen::DisableTracingRequest&,
DeferredDisableTracingResponse resp) { … }
void ConsumerIPCService::ReadBuffers(const protos::gen::ReadBuffersRequest&,
DeferredReadBuffersResponse resp) { … }
void ConsumerIPCService::FreeBuffers(const protos::gen::FreeBuffersRequest&,
DeferredFreeBuffersResponse resp) { … }
void ConsumerIPCService::Flush(const protos::gen::FlushRequest& req,
DeferredFlushResponse resp) { … }
void ConsumerIPCService::Detach(const protos::gen::DetachRequest& req,
DeferredDetachResponse resp) { … }
void ConsumerIPCService::Attach(const protos::gen::AttachRequest& req,
DeferredAttachResponse resp) { … }
void ConsumerIPCService::GetTraceStats(const protos::gen::GetTraceStatsRequest&,
DeferredGetTraceStatsResponse resp) { … }
void ConsumerIPCService::ObserveEvents(
const protos::gen::ObserveEventsRequest& req,
DeferredObserveEventsResponse resp) { … }
void ConsumerIPCService::QueryServiceState(
const protos::gen::QueryServiceStateRequest& req,
DeferredQueryServiceStateResponse resp) { … }
void ConsumerIPCService::OnQueryServiceCallback(
bool success,
const TracingServiceState& svc_state,
PendingQuerySvcResponses::iterator pending_response_it) { … }
void ConsumerIPCService::OnFlushCallback(
bool success,
PendingFlushResponses::iterator pending_response_it) { … }
void ConsumerIPCService::QueryCapabilities(
const protos::gen::QueryCapabilitiesRequest&,
DeferredQueryCapabilitiesResponse resp) { … }
void ConsumerIPCService::OnQueryCapabilitiesCallback(
const TracingServiceCapabilities& caps,
PendingQueryCapabilitiesResponses::iterator pending_response_it) { … }
void ConsumerIPCService::SaveTraceForBugreport(
const protos::gen::SaveTraceForBugreportRequest&,
DeferredSaveTraceForBugreportResponse resp) { … }
void ConsumerIPCService::CloneSession(
const protos::gen::CloneSessionRequest& req,
DeferredCloneSessionResponse resp) { … }
void ConsumerIPCService::OnSaveTraceForBugreportCallback(
bool success,
const std::string& msg,
PendingSaveTraceForBugreportResponses::iterator pending_response_it) { … }
ConsumerIPCService::RemoteConsumer::RemoteConsumer() = default;
ConsumerIPCService::RemoteConsumer::~RemoteConsumer() = default;
void ConsumerIPCService::RemoteConsumer::OnConnect() { … }
void ConsumerIPCService::RemoteConsumer::OnDisconnect() { … }
void ConsumerIPCService::RemoteConsumer::OnTracingDisabled(
const std::string& error) { … }
void ConsumerIPCService::RemoteConsumer::OnTraceData(
std::vector<TracePacket> trace_packets,
bool has_more) { … }
void ConsumerIPCService::RemoteConsumer::OnDetach(bool success) { … }
void ConsumerIPCService::RemoteConsumer::OnAttach(
bool success,
const TraceConfig& trace_config) { … }
void ConsumerIPCService::RemoteConsumer::OnTraceStats(bool success,
const TraceStats& stats) { … }
void ConsumerIPCService::RemoteConsumer::OnObservableEvents(
const ObservableEvents& events) { … }
void ConsumerIPCService::RemoteConsumer::CloseObserveEventsResponseStream() { … }
void ConsumerIPCService::RemoteConsumer::OnSessionCloned(
const OnSessionClonedArgs& args) { … }
}