Skip to content

Commit febf1f5

Browse files
committed
DPL: add dumping of memory profile in strategic location
1 parent ecbd584 commit febf1f5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Framework/AnalysisSupport/src/DataInputDirector.cxx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "Framework/RootArrowFilesystem.h"
1616
#include "Framework/AnalysisDataModelHelpers.h"
1717
#include "Framework/Output.h"
18+
#include "Framework/Signpost.h"
1819
#include "Headers/DataHeader.h"
1920
#include "Framework/TableTreeHelpers.h"
2021
#include "Monitoring/Tags.h"
@@ -41,6 +42,9 @@
4142
#include <utility>
4243
#endif
4344

45+
#include <dlfcn.h>
46+
O2_DECLARE_DYNAMIC_LOG(reader_memory_dump);
47+
4448
namespace o2::framework
4549
{
4650
using namespace rapidjson;
@@ -460,6 +464,16 @@ bool DataInputDescriptor::readTree(DataAllocator& outputs, header::DataHeader dh
460464

461465
mIOTime += (uv_hrtime() - ioStart);
462466

467+
O2_SIGNPOST_ACTION(reader_memory_dump, [](void*) {
468+
void (*dump_)(const char*);
469+
if (void* sym = dlsym(nullptr, "igprof_dump_now")) {
470+
dump_ = __extension__(void (*)(const char*)) sym;
471+
if (dump_) {
472+
std::string filename = fmt::format("reader-memory-dump-{}.gz", uv_hrtime());
473+
}
474+
}
475+
});
476+
463477
return true;
464478
}
465479

0 commit comments

Comments
 (0)