Lines Matching refs:ctx
145 if (auto ctx = weakCtx.lock(); ctx != nullptr) { in StartPluginSessions() local
146 ctx->StopPluginSessions(); in StartPluginSessions()
309 auto ctx = std::make_shared<SessionContext>(); in CreateSession() local
310 CHECK_POINTER_NOTNULL(ctx, "alloc SessionContext failed!"); in CreateSession()
313 ctx->service = this; in CreateSession()
315 ctx->dataRepeater = dataRepeater; in CreateSession()
318 ctx->traceFileWriter = traceWriter; in CreateSession()
320 ctx->sessionConfig = *sessionConfig; in CreateSession()
321 ctx->pluginNames = std::move(pluginNames); in CreateSession()
322 ctx->pluginConfigs = std::move(pluginConfigs); in CreateSession()
323 ctx->bufferConfigs = std::move(bufferConfigs); in CreateSession()
326 CHECK_EXPRESSION_TRUE(ctx->CreatePluginSessions(), "create plugin sessions failed!"); in CreateSession()
329 ctx->id = sessionId; in CreateSession()
330 ctx->name = "session-" + std::to_string(sessionId); in CreateSession()
333 CHECK_EXPRESSION_TRUE(AddSessionContext(sessionId, ctx), "sessionId conflict!"); in CreateSession()
340 ctx->SetKeepAliveTime(keepAliveTime); in CreateSession()
341 ctx->StartSessionExpireTask(removeTask_); in CreateSession()
486 auto ctx = GetSessionContext(sessionId); in StartSession() local
487 CHECK_POINTER_NOTNULL(ctx, "session_id invalid!"); in StartSession()
494 …std::set_intersection(requestNames.begin(), requestNames.end(), ctx->pluginNames.begin(), ctx->plu… in StartSession()
502 size_t updates = ctx->UpdatePluginConfigs(newPluginConfigs); in StartSession()
505 CHECK_EXPRESSION_TRUE(ctx->CreatePluginSessions(), "refresh sessions failed!"); in StartSession()
510 CHECK_EXPRESSION_TRUE(ctx->StartPluginSessions(), "start plugin sessions failed!"); in StartSession()
529 auto ctx = GetSessionContext(sessionId); in FetchData() local
530 CHECK_POINTER_NOTNULL(ctx, "session_id invalid!"); in FetchData()
533 …CHECK_EXPRESSION_TRUE(pluginSessionManager_->CheckStatus(ctx->pluginNames, PluginSession::STARTED), in FetchData()
536 if (ctx->sessionConfig.session_mode() == ProfilerSessionConfig::ONLINE) { in FetchData()
537 auto dataRepeater = ctx->dataRepeater; in FetchData()
541 ctx = GetSessionContext(sessionId); in FetchData()
542 CHECK_POINTER_NOTNULL(ctx, "session_id invalid!"); in FetchData()
583 auto ctx = GetSessionContext(sessionId); in StopSession() local
584 CHECK_POINTER_NOTNULL(ctx, "session_id invalid!"); in StopSession()
585 if (ctx->sessionConfig.session_mode() == ProfilerSessionConfig::OFFLINE) { in StopSession()
586 CHECK_POINTER_NOTNULL(ctx->traceFileWriter, "traceFileWriter invalid!"); in StopSession()
587 ctx->traceFileWriter.get()->SetStopSplitFile(true); in StopSession()
589 CHECK_EXPRESSION_TRUE(ctx->StopPluginSessions(), "stop plugin sessions failed!"); in StopSession()
603 auto ctx = GetSessionContext(sessionId); in DestroySession() local
604 CHECK_POINTER_NOTNULL(ctx, "session_id invalid!"); in DestroySession()
607 CHECK_EXPRESSION_TRUE(pluginSessionManager_->RemovePluginSessions(ctx->pluginNames), in DestroySession()
611 if (ctx->sessionConfig.session_mode() == ProfilerSessionConfig::OFFLINE) { in DestroySession()
614 for (size_t i = 0; i < ctx->pluginNames.size(); i++) { in DestroySession()
615 auto pluginName = ctx->pluginNames[i]; in DestroySession()
618 if (!ctx->sessionConfig.split_file()) { in DestroySession()
619 … MergeStandaloneFile(ctx->sessionConfig.result_file(), pluginName, pluginCtx->outFileName, in DestroySession()
637 auto ctx = GetSessionContext(sessionId); in KeepSession() local
638 CHECK_POINTER_NOTNULL(ctx, "session_id invalid!"); in KeepSession()
644 ctx->SetKeepAliveTime(keepAliveTime); in KeepSession()
648 if (ctx->sessionConfig.keep_alive_time() > 0) { in KeepSession()
649 ctx->StopSessionExpireTask(removeTask_); in KeepSession()
650 ctx->StartSessionExpireTask(removeTask_); in KeepSession()