#include "src/trace_processor/rpc/rpc.h"
#include <cinttypes>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "perfetto/base/logging.h"
#include "perfetto/base/status.h"
#include "perfetto/base/time.h"
#include "perfetto/ext/base/version.h"
#include "perfetto/ext/protozero/proto_ring_buffer.h"
#include "perfetto/ext/trace_processor/rpc/query_result_serializer.h"
#include "perfetto/protozero/field.h"
#include "perfetto/protozero/proto_utils.h"
#include "perfetto/protozero/scattered_heap_buffer.h"
#include "perfetto/trace_processor/basic_types.h"
#include "perfetto/trace_processor/metatrace_config.h"
#include "perfetto/trace_processor/trace_processor.h"
#include "src/trace_processor/tp_metatrace.h"
#include "src/trace_processor/util/status_macros.h"
#include "protos/perfetto/trace_processor/metatrace_categories.pbzero.h"
#include "protos/perfetto/trace_processor/trace_processor.pbzero.h"
namespace perfetto::trace_processor {
namespace {
constexpr size_t kProgressUpdateBytes = …;
TraceProcessorRpcStream;
RpcProto;
constexpr auto kSliceSize = …;
class Response { … };
Response::Response(int64_t seq, int method) : … { … }
void Response::Send(Rpc::RpcResponseFunction send_fn) { … }
}
Rpc::Rpc(std::unique_ptr<TraceProcessor> preloaded_instance)
: … { … }
Rpc::Rpc() : … { … }
Rpc::~Rpc() = default;
void Rpc::ResetTraceProcessorInternal(const Config& config) { … }
void Rpc::OnRpcRequest(const void* data, size_t len) { … }
namespace {
ProtoEnum;
TraceProcessor::MetatraceCategories MetatraceCategoriesToPublicEnum(
ProtoEnum categories) { … }
}
void Rpc::ParseRpcRequest(const uint8_t* data, size_t len) { … }
base::Status Rpc::Parse(const uint8_t* data, size_t len) { … }
base::Status Rpc::NotifyEndOfFile() { … }
void Rpc::ResetTraceProcessor(const uint8_t* args, size_t len) { … }
base::Status Rpc::RegisterSqlModule(protozero::ConstBytes bytes) { … }
void Rpc::MaybePrintProgress() { … }
void Rpc::Query(const uint8_t* args,
size_t len,
const QueryResultBatchCallback& result_callback) { … }
void Rpc::RestoreInitialTables() { … }
std::vector<uint8_t> Rpc::ComputeMetric(const uint8_t* args, size_t len) { … }
void Rpc::ComputeMetricInternal(const uint8_t* data,
size_t len,
protos::pbzero::ComputeMetricResult* result) { … }
void Rpc::EnableMetatrace(const uint8_t* data, size_t len) { … }
std::vector<uint8_t> Rpc::DisableAndReadMetatrace() { … }
void Rpc::DisableAndReadMetatraceInternal(
protos::pbzero::DisableAndReadMetatraceResult* result) { … }
std::vector<uint8_t> Rpc::GetStatus() { … }
}