+
+
+void AliLog::MakeCoreDump(const char *fout){
+ //
+ // Functionality to make a program snapshot
+ // gcore - Generate a core file for a running process
+ // gcore dmake a current snapshot, program can continue further
+ // We assum that gcore is installed
+ // for details see: man gcore
+ //
+ // Example use - make default core file for current process: AliLog::MakeCoreDump(0)
+ //
+ //
+ // Automatic core dump creation in case of the AliFatal can be specified using
+ // static void EnableCoreDump(Bool_t enabled);
+ // Core dump is created in addition to the stack trace ()
+ // marian.ivanov@cern.ch
+ //
+ if (!gSystem) return;
+ printf("AliLog::MakeCoreDump\n");
+ if (fout){
+ gSystem->Exec(Form("gcore -o %s %d",fout, gSystem->GetPid()));
+ }else{
+ gSystem->Exec(Form("gcore %d", gSystem->GetPid()));
+ }
+}