Skip to content

Commit 0cdfe91

Browse files
committed
DPL: add dumping of memory profile in strategic location
1 parent 3961e74 commit 0cdfe91

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Framework/AnalysisSupport/src/DataInputDirector.cxx

Lines changed: 15 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;
@@ -458,6 +462,17 @@ bool DataInputDescriptor::readTree(DataAllocator& outputs, header::DataHeader dh
458462

459463
mIOTime += (uv_hrtime() - ioStart);
460464

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

0 commit comments

Comments
 (0)