Now I try to implement this by modifying process member function of class StatEvent:

   --- a/src/sim/stat_control.cc    Thu Dec 15 00:09:46 2011 -0500
   +++ b/src/sim/stat_control.cc    Mon Dec 17 19:16:21 2012 +0800
   @@ -35,6 +35,7 @@
     #include <iostream>
     #include <list>

   +#include "base/output.hh"
     #include "base/callback.hh"
     #include "base/hostinfo.hh"
     #include "base/statistics.hh"
   @@ -49,6 +50,10 @@
     #include "sim/eventq.hh"
     #include "sim/stat_control.hh"

   +
   +#include "mem/ruby/common/Global.hh"
   +#include "mem/ruby/system/System.hh"
   +
     using namespace std;

     Stats::Formula simSeconds;
   @@ -184,10 +189,25 @@
         process()
         {
             if (dump)
   +        {
                 Stats::dump();
   +            if(g_system_ptr != NULL)
   +            {
   +                std::ostream *os = simout.create("ruby.stats");
   +                g_system_ptr->printConfig(*os);
   +                *os << endl;
   +                g_system_ptr->printStats(*os);
   +            }
   +        }

             if (reset)
   +        {
                 Stats::reset();
   +            if(g_system_ptr != NULL)
   +            {
   +                g_system_ptr->clearStats();
   +            }
   +        }

But this modification caused many building errors:

   In file included from
   build/ALPHA_SE/mem/ruby/slicc_interface/RubyRequest.hh:34,
                     from build/ALPHA_SE/mem/ruby/system/RubyPort.hh:36,
                     from build/ALPHA_SE/mem/ruby/system/System.hh:41,
                     from build/ALPHA_SE/sim/stat_control.cc:55:
   build/ALPHA_SE/mem/protocol/Message.hh:1:87: error:
   /home/zheng/gem5/gem5-MI/build/ALPHA_SE/mem/ruby/slicc_interface/Message.hh:
   No such file or directory
   In file included from
   build/ALPHA_SE/mem/ruby/eventqueue/RubyEventQueue.hh:62,
                     from build/ALPHA_SE/mem/ruby/system/System.hh:40,
                     from build/ALPHA_SE/sim/stat_control.cc:55:
   build/ALPHA_SE/mem/ruby/common/TypeDefines.hh:44: error: conflicting
   declaration 'typedef int64 Time'
   build/ALPHA_SE/base/time.hh:50: error: 'class Time' has a previous
   declaration as 'class Time'
   In file included from build/ALPHA_SE/mem/ruby/system/System.hh:40,
                     from build/ALPHA_SE/sim/stat_control.cc:55:
   build/ALPHA_SE/mem/ruby/eventqueue/RubyEventQueue.hh: In member
   function 'Time RubyEventQueue::getTime() const':
   build/ALPHA_SE/mem/ruby/eventqueue/RubyEventQueue.hh:74: error:
   conversion from 'Tick' to non-scalar type 'Time' requested
   In file included from build/ALPHA_SE/mem/ruby/system/RubyPort.hh:36,
                     from build/ALPHA_SE/mem/ruby/system/System.hh:41,
                     from build/ALPHA_SE/sim/stat_control.cc:55:
   build/ALPHA_SE/mem/ruby/slicc_interface/RubyRequest.hh: At global scope:
   build/ALPHA_SE/mem/ruby/slicc_interface/RubyRequest.hh:44: error:
   expected class-name before '{' token

This may be caused by using g_system_ptr which is a globally available point of ruby system out of ruby module, How can I solve those problems?

Thanks!

On 12/17/2012 05:38 PM, zhengchl wrote:
However, when I call 'dumpresetstats' multi times, there are multi statistics output in default file 'stats.txt', and only one output of ruby in file 'ruby.stats' which is caused by 'RubyExitCallback'. So, I don't think dumping and resetting ruby statistics has been done by 'dumpreststats'.

On 12/16/2012 11:33 PM, Nilay Vaish wrote:
On Sun, 16 Dec 2012, zhengchl wrote:

Hi,

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


I guess you are bent on doing something that already exists.

--
Nilay






--
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