MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / startSessionFunction

Method startSessionFunction

src/jrd/ProfilerManager.cpp:337–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337void ProfilerPackage::startSessionFunction(ThrowStatusExceptionWrapper* /*status*/,
338 IExternalContext* context, const StartSessionInput::Type* in, StartSessionOutput::Type* out)
339{
340 const auto tdbb = JRD_get_thread_data();
341 const auto attachment = tdbb->getAttachment();
342
343 if (!in->attachmentIdNull && AttNumber(in->attachmentId) != attachment->att_attachment_id)
344 {
345 ProfilerIpc ipc(tdbb, *getDefaultMemoryPool(), in->attachmentId);
346 ipc.sendAndReceive(tdbb, ProfilerIpc::Tag::START_SESSION, in, out);
347 return;
348 }
349
350 const string description(in->description.str, in->descriptionNull ? 0 : in->description.length);
351 const Nullable<SLONG> flushInterval(in->flushIntervalNull ?
352 Nullable<SLONG>() : Nullable<SLONG>(in->flushInterval));
353 const PathName pluginName(in->pluginName.str, in->pluginNameNull ? 0 : in->pluginName.length);
354 const string pluginOptions(in->pluginOptions.str, in->pluginOptionsNull ? 0 : in->pluginOptions.length);
355
356 const auto profilerManager = attachment->getProfilerManager(tdbb);
357
358 out->sessionIdNull = FB_FALSE;
359 out->sessionId = profilerManager->startSession(tdbb, flushInterval, pluginName, description, pluginOptions);
360}
361
362
363//--------------------------------------

Callers

nothing calls this directly

Calls 6

JRD_get_thread_dataFunction · 0.85
getDefaultMemoryPoolFunction · 0.85
sendAndReceiveMethod · 0.80
getProfilerManagerMethod · 0.80
getAttachmentMethod · 0.45
startSessionMethod · 0.45

Tested by

no test coverage detected