79789092

Date: 2025-10-13 09:11:45
Score: 0.5
Natty:
Report link

I found out how to do it.

It was enough to modify the abortHandler inside src/sim/init_signals.cc, adding the statistics::dump() instruction. Make sure to #include "base/statistics.hh" at the beginning of the file.

/* src/sim/init_signals.cc */

/// Abort signal handler.
void
abortHandler(int sigtype)
{
    const EventQueue *const eq(curEventQueue());
    
    // INSERT STATISTICS DUMP HERE
    // ----------------
    std::cout << "Dumping statistics..." << std::endl;
    statistics::dump();
    // ----------------

    if (eq) {
        ccprintf(std::cerr, "Program aborted at tick %llu\n",
                eq->getCurTick());
    } else {
        STATIC_ERR("Program aborted\n\n");
    }

    print_backtrace();
    raiseFatalSignal(sigtype);
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Teffano