Hi,

I want to call function 'Profiler::printStats' of Ruby when 'dumpresetstats' is executed. So I track the the call stack of dumpresetstats.

   void
   dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
   {
        if (!tc->getCpuPtr()->params()->do_statistics_insts)
            return;


        Tick when = curTick() + delay * SimClock::Int::ns;
        Tick repeat = period * SimClock::Int::ns;

        Stats::schedStatEvent(true, true, when, repeat);
   }
   void
   schedStatEvent(bool dump, bool reset, Tick when, Tick repeat)
   {
        Event *event = new StatEvent(dump, reset, repeat);
        mainEventQueue.schedule(event, when);
   }

and the member function 'process' of class StatEvent is:

        process()
        {
            if (dump)
                Stats::dump();

            if (reset)
                Stats::reset();

            if (repeat) {
                Stats::schedStatEvent(dump, reset, curTick() + repeat,
   repeat);
            }
        }

So, I think to add the calling to Stats::dump, but only find the declaration of it. So how to call some function when execute 'dumpresetstats'.

Thanks

--
Chuanlei Zheng

Department of Computer Science and Technology
Nanjing University

_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to