| 335 | } |
| 336 | |
| 337 | void 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 | //-------------------------------------- |
nothing calls this directly
no test coverage detected