Lines Matching refs:handle

109   HandleDescription(Handle handle): handle_(handle) {}  in HandleDescription()
187 Handle handle = raw_->Create(config_proto, config_len, callback, callback_arg); in Create() local
193 CHECK_EQ(last_created_, handle) << "perfetto handle had unexpected behavior."; in Create()
198 HandleDescription handle_desc{handle}; in Create()
199 handle_desc.handle_ = handle; in Create()
205 bool inserted = states_.insert({handle, handle_desc}).second; in Create()
206 CHECK(inserted) << "perfetto handle was re-used: " << handle; in Create()
208 return handle; in Create()
211 void StartTracing(Handle handle) { in StartTracing()
212 LOG(DEBUG) << "PerfettoConsumer::StartTracing(handle=" << handle << ")"; in StartTracing()
218 auto it = states_.find(handle); in StartTracing()
220 LOG(ERROR) << "Cannot StartTracing(" << handle << "), untracked handle"; in StartTracing()
225 raw_->StartTracing(handle); in StartTracing()
230 CHECK_LE(static_cast<int64_t>(handle), static_cast<int64_t>(std::numeric_limits<int>::max())); in StartTracing()
231 int message_code = static_cast<int>(handle); in StartTracing()
240 TraceBuffer ReadTrace(Handle handle) { in ReadTrace()
241 LOG(DEBUG) << "PerfettoConsumer::ReadTrace(handle=" << handle << ")"; in ReadTrace()
245 auto it = states_.find(handle); in ReadTrace()
247 LOG(ERROR) << "Cannot ReadTrace(" << handle << "), untracked handle"; in ReadTrace()
253 TraceBuffer trace_buffer = raw_->ReadTrace(handle); in ReadTrace()
259 void Destroy(Handle handle) { in Destroy()
260 HandleDescription handle_desc{handle}; in Destroy()
261 TryDestroy(handle, /*do_destroy*/true, /*out*/&handle_desc);; in Destroy()
264 bool TryDestroy(Handle handle, bool do_destroy, /*out*/HandleDescription* handle_desc_out) { in TryDestroy()
267 LOG(VERBOSE) << "PerfettoConsumer::Destroy(handle=" << handle << ")"; in TryDestroy()
271 auto it = states_.find(handle); in TryDestroy()
274 LOG(ERROR) << "Cannot Destroy(" << handle << "), untracked handle"; in TryDestroy()
281 raw_->Destroy(handle); in TryDestroy()
288 last_destroyed_ = handle; in TryDestroy()
294 State PollState(Handle handle) { in PollState()
296 return raw_->PollState(handle); in PollState()
301 HandleDescription GetOrInferHandleDescription(Handle handle) { in GetOrInferHandleDescription()
304 auto it = states_.find(handle); in GetOrInferHandleDescription()
306 HandleDescription state{handle}; in GetOrInferHandleDescription()
308 if (IsDestroyed(handle)) { in GetOrInferHandleDescription()
311 if (!IsUncreated(handle)) { in GetOrInferHandleDescription()
321 void OnTraceMessage(Handle handle) { in OnTraceMessage()
322 LOG(VERBOSE) << "OnTraceMessage(" << static_cast<int64_t>(handle) << ")"; in OnTraceMessage()
323 HandleDescription handle_desc{handle}; in OnTraceMessage()
327 auto it = states_.find(handle); in OnTraceMessage()
331 LOG(VERBOSE) << "OnTraceMessage(" << static_cast<int64_t>(handle) in OnTraceMessage()
342 CHECK(handle_desc.started_tracing_ns_.has_value()) << static_cast<int64_t>(handle); in OnTraceMessage()
351 handle_desc.callback_(handle, State::kTraceFailed, handle_desc.callback_arg_); in OnTraceMessage()
380 LOG(DEBUG) << "Perfetto handle pruned: " << static_cast<int64_t>(handle); in OnTraceMessage()
383 handle_desc.callback_(handle, State::kTraceFailed, handle_desc.callback_arg_); in OnTraceMessage()
448 bool IsDestroyed(Handle handle) const { in IsDestroyed()
449 auto it = states_.find(handle); in IsDestroyed()
455 if (handle == kInvalidHandle) { in IsDestroyed()
462 return handle <= last_destroyed_; in IsDestroyed()
466 if (handle < min_it->first) { in IsDestroyed()
472 if (handle > max_it->first) { in IsDestroyed()
481 bool IsUncreated(Handle handle) const { in IsUncreated()
482 auto it = states_.find(handle); in IsUncreated()
488 if (handle == kInvalidHandle) { in IsUncreated()
496 return handle > last_destroyed_; in IsUncreated()
500 if (handle < min_it->first) { in IsUncreated()
506 if (handle > max_it->first) { in IsUncreated()
592 void PerfettoConsumerImpl::StartTracing(PerfettoConsumer::Handle handle) { in StartTracing() argument
593 impl_->StartTracing(handle); in StartTracing()
596 PerfettoConsumer::TraceBuffer PerfettoConsumerImpl::ReadTrace(PerfettoConsumer::Handle handle) { in ReadTrace() argument
597 return impl_->ReadTrace(handle); in ReadTrace()
600 void PerfettoConsumerImpl::Destroy(PerfettoConsumer::Handle handle) { in Destroy() argument
601 impl_->Destroy(handle); in Destroy()
604 PerfettoConsumer::State PerfettoConsumerImpl::PollState(PerfettoConsumer::Handle handle) { in PollState() argument
605 return impl_->PollState(handle); in PollState()