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

Method ProfilerIpc

src/jrd/ProfilerManager.cpp:764–794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

762
763
764ProfilerIpc::ProfilerIpc(thread_db* tdbb, MemoryPool& pool, AttNumber aAttachmentId, bool server)
765 : attachmentId(aAttachmentId),
766 isServer(server)
767{
768 const auto database = tdbb->getDatabase();
769
770 string fileName;
771 static_assert(std::is_same<decltype(attachmentId), FB_UINT64>::value);
772 fileName.printf(PROFILER_FILE, database->getUniqueFileId().c_str(), attachmentId);
773
774 try
775 {
776 sharedMemory = FB_NEW_POOL(pool) SharedMemory<Header>(fileName.c_str(), sizeof(Header), this);
777 }
778 catch (const Exception& ex)
779 {
780 iscLogException("ProfilerManager: cannot initialize the shared memory region", ex);
781 throw;
782 }
783
784 const auto header = sharedMemory->getHeader();
785 checkHeader(header);
786
787 if (isServer)
788 {
789 Guard guard(this);
790
791 if (sharedMemory->eventInit(&header->serverEvent) != FB_SUCCESS)
792 (Arg::Gds(isc_random) << "ProfilerIpc eventInit(serverEvent) failed").raise();
793 }
794}
795
796ProfilerIpc::~ProfilerIpc()
797{

Callers

nothing calls this directly

Calls 8

iscLogExceptionFunction · 0.85
GdsClass · 0.85
getDatabaseMethod · 0.80
eventInitMethod · 0.80
printfMethod · 0.45
c_strMethod · 0.45
getHeaderMethod · 0.45
raiseMethod · 0.45

Tested by

no test coverage detected